Skip to main content

Crate graphrt_doc

Crate graphrt_doc 

Source
Expand description

§graphrt-doc

Text extraction from documents, as a library (extract) and as the document-extractor workflow node (register).

Everything is pure Rust. Formats and the features that enable them:

FormatFeature
txt, md, json, yaml, xml, csv, tsv, html, vtt, srtalways
pdfpdf
docx, pptxoffice
xlsx, xls, odsspreadsheet
epubepub
emlemail

The format is chosen from the MIME type, then the file extension, then the content itself. Archives are read with entry-count and decompressed-size limits (zip-bomb protection), and parsers that are known to panic on malformed input are isolated with catch_unwind (effective only in builds that unwind on panic).

Re-exports§

pub use detect::Format;

Modules§

detect
Format detection: MIME type first, then file extension, then content sniffing.
text
Text-based formats: plain text, delimited tables, HTML, subtitles.

Structs§

DocLimits
Host-level limits for document extraction. Register in graphrt_core::Services to override the defaults; workflow config can only lower them.
DocumentExtractorNode
Extracts text from a file or a list of files.
Extraction
Result of extract_detailed.
Options
Extraction options and limits.

Enums§

DocError
Extraction failure.
OutputFormat
Shape of the extracted text.

Constants§

KIND
Node kind handled by this crate.

Functions§

descriptor
Catalog descriptor for the node.
extract
Extract the text of a document.
extract_as
Extract text from bytes known to be in format.
extract_detailed
Like extract, also reporting the detected format and truncation.
register
Register the document-extractor node.
resolve_format
Determine the format: MIME type, then extension, then content sniffing.