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:
| Format | Feature |
|---|---|
| txt, md, json, yaml, xml, csv, tsv, html, vtt, srt | always |
pdf | |
| docx, pptx | office |
| xlsx, xls, ods | spreadsheet |
| epub | epub |
| eml | email |
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::Servicesto override the defaults; workflow config can only lower them. - Document
Extractor Node - Extracts text from a file or a list of files.
- Extraction
- Result of
extract_detailed. - Options
- Extraction options and limits.
Enums§
- DocError
- Extraction failure.
- Output
Format - 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-extractornode. - resolve_
format - Determine the format: MIME type, then extension, then content sniffing.