mirror of
https://github.com/firecrawl/anydoc.git
synced 2026-09-14 14:18:33 +08:00
74 lines
1.4 KiB
Python
74 lines
1.4 KiB
Python
"""Convert documents to GitHub-Flavored Markdown."""
|
|
|
|
from typing import Literal
|
|
|
|
from anydoc._anydoc import (
|
|
Asset,
|
|
Block,
|
|
Cell,
|
|
CellSlot,
|
|
ConvertError,
|
|
Document,
|
|
EncryptedError,
|
|
ImageSource,
|
|
Inline,
|
|
LinkTarget,
|
|
List,
|
|
ListItem,
|
|
MalformedError,
|
|
MissingPartError,
|
|
NeedsOcrError,
|
|
Note,
|
|
Page,
|
|
ResourceLimitError,
|
|
Style,
|
|
Table,
|
|
UnsupportedError,
|
|
format_from_bytes,
|
|
format_from_extension,
|
|
format_from_path,
|
|
to_document,
|
|
to_markdown,
|
|
to_markdown_bytes,
|
|
to_markdown_pages,
|
|
)
|
|
|
|
Format = Literal[
|
|
"doc", "docx", "odt", "pdf", "ppt", "pptx", "rtf", "epub", "xlsx", "ods", "odp", "csv"
|
|
]
|
|
"""Input format, named after the extension that identifies it. Container
|
|
variants that share a parser (`.docm`, `.xlsm`, `.ppsx`, ...) map onto these
|
|
via `format_from_bytes` or `format_from_extension`."""
|
|
|
|
__all__ = [
|
|
"Asset",
|
|
"Block",
|
|
"Cell",
|
|
"CellSlot",
|
|
"ConvertError",
|
|
"Document",
|
|
"EncryptedError",
|
|
"Format",
|
|
"ImageSource",
|
|
"Inline",
|
|
"LinkTarget",
|
|
"List",
|
|
"ListItem",
|
|
"MalformedError",
|
|
"MissingPartError",
|
|
"NeedsOcrError",
|
|
"Note",
|
|
"Page",
|
|
"ResourceLimitError",
|
|
"Style",
|
|
"Table",
|
|
"UnsupportedError",
|
|
"format_from_bytes",
|
|
"format_from_extension",
|
|
"format_from_path",
|
|
"to_document",
|
|
"to_markdown",
|
|
"to_markdown_bytes",
|
|
"to_markdown_pages",
|
|
]
|