Skip to main content

firecrawl-anydoc

PyPI License: MIT

Convert Word, PowerPoint, Excel, OpenDocument, RTF, EPUB, CSV, and PDF files into clean GitHub-Flavored Markdown. Python bindings for the anydoc Rust crate, built by Firecrawl. Also available as a hosted API through Firecrawl Parse, which adds our OCR models for the scanned pages anydoc can't read on its own.

Every format parses into one shared document model and renders through a single Markdown serializer, so headings, tables, lists, and footnotes come out the same no matter which format goes in. Conversion releases the GIL, so other threads keep running. Type stubs ship with the package.

pip install firecrawl-anydoc

The package installs as firecrawl-anydoc and imports as anydoc.

Supported formats

Format Extensions
Word .doc, .docx, .docm
PowerPoint .ppt, .pps, .pot, .pptx, .pptm, .ppsx, .ppsm
Excel .xls, .xlsx, .xlsm, .xlsb
OpenDocument .odt, .ods, .odp
Rich Text Format .rtf
EPUB .epub
CSV .csv
PDF .pdf

Usage

import anydoc

# From a file path:
markdown = anydoc.to_markdown("report.docx")

# From bytes, with the format detected from the content:
markdown = anydoc.to_markdown_bytes(data)

# Or name it, which signature-less formats (CSV) need:
markdown = anydoc.to_markdown_bytes(data, "csv")

# Or stop at the document model, which also carries embedded assets:
document = anydoc.to_document(data)

Scanned pages

anydoc converts locally and does not do OCR, so a PDF with scanned or image-only pages raises NeedsOcrError. Opt in with ocr="hosted" to send that document to Firecrawl Parse. No signup needed. Set api_key or FIRECRAWL_API_KEY for higher limits.

markdown = anydoc.to_markdown("scan.pdf", ocr="hosted")

Errors

A conversion raises only when no complete Markdown could come out of the file. The exception type names what went wrong:

try:
    return anydoc.to_markdown(path)
except (anydoc.EncryptedError, anydoc.UnsupportedError) as error:
    # No document comes out of these, so record the file and take the next one.
    unconverted.append((path, type(error).__name__))
    return None
Exception Raised when
UnsupportedError Unknown format, or one that cannot be converted
NeedsOcrError Scanned or image-only pages of a PDF, listed in pages
MalformedError Structurally unusable: no meaningful content could be extracted
EncryptedError Encrypted or password-protected
ResourceLimitError Crossed a fixed safety limit (decompression, nesting, node count)
MissingPartError A part required for any meaningful output is absent
HostedError ocr="hosted" could not get the document through Firecrawl Parse
OSError The file could not be read, from to_markdown only

Every conversion failure subclasses anydoc.ConvertError, so catching that handles all of them at once. MalformedError.part and MissingPartError.part name the package part at fault, ResourceLimitError.limit names the limit crossed, and str(error) carries the whole message. A format argument naming no supported format raises ValueError.

Format detection

The format is read from the file content, using the marker its specification designates: the PDF header, the RTF open group, OLE stream names, the ZIP package mimetype and content types. CSV has no such marker, so detection returns None for it and the extension, or an explicit format, names it instead.

anydoc.format_from_bytes(data)  # 'docx', or None when nothing matches
anydoc.format_from_extension(".pptm")  # 'pptx'
anydoc.format_from_path("report.odt")  # 'odt'

Images and embedded objects

Markdown cannot embed bytes, so an embedded image renders as its alt text while the bytes stay on document.assets, tagged with a media type and the part they came from. Images that carry an external URL render as ordinary Markdown images.

Full behavior notes and benchmarks live in the repository README.

License

MIT

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

firecrawl_anydoc-0.2.4.tar.gz (270.7 kB view details)

Uploaded Source

Built Distributions

If you're not sure about the file name format, learn more about wheel file names.

firecrawl_anydoc-0.2.4-cp310-abi3-win_amd64.whl (3.6 MB view details)

Uploaded CPython 3.10+Windows x86-64

firecrawl_anydoc-0.2.4-cp310-abi3-musllinux_1_2_x86_64.whl (3.7 MB view details)

Uploaded CPython 3.10+musllinux: musl 1.2+ x86-64

firecrawl_anydoc-0.2.4-cp310-abi3-musllinux_1_2_aarch64.whl (3.4 MB view details)

Uploaded CPython 3.10+musllinux: musl 1.2+ ARM64

firecrawl_anydoc-0.2.4-cp310-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (3.5 MB view details)

Uploaded CPython 3.10+manylinux: glibc 2.17+ x86-64

firecrawl_anydoc-0.2.4-cp310-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (3.3 MB view details)

Uploaded CPython 3.10+manylinux: glibc 2.17+ ARM64

firecrawl_anydoc-0.2.4-cp310-abi3-macosx_11_0_arm64.whl (3.3 MB view details)

Uploaded CPython 3.10+macOS 11.0+ ARM64

firecrawl_anydoc-0.2.4-cp310-abi3-macosx_10_12_x86_64.whl (3.4 MB view details)

Uploaded CPython 3.10+macOS 10.12+ x86-64

File details

Details for the file firecrawl_anydoc-0.2.4.tar.gz.

File metadata

  • Download URL: firecrawl_anydoc-0.2.4.tar.gz
  • Upload date:
  • Size: 270.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for firecrawl_anydoc-0.2.4.tar.gz
Algorithm Hash digest
SHA256 3e29460272fea81cde08fd5af11f6b0f1ff05919214ddc939867f72362c83032
MD5 f27ceb84b5b9c39be10f923bccfc0eed
BLAKE2b-256 3554ee43b1661a954e53eaed85878a7ccc37ed73e02e6577bb26437ec5f9de94

See more details on using hashes here.

Provenance

The following attestation bundles were made for firecrawl_anydoc-0.2.4.tar.gz:

Publisher: release.yml on firecrawl/anydoc

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file firecrawl_anydoc-0.2.4-cp310-abi3-win_amd64.whl.

File metadata

File hashes

Hashes for firecrawl_anydoc-0.2.4-cp310-abi3-win_amd64.whl
Algorithm Hash digest
SHA256 7c9ffc81946e6954c124560ed1d395e0103a1a08fdc0f6be382e2f35daf6dbc9
MD5 465ba3c3a9bc4628231335c6ae470818
BLAKE2b-256 65346d54fed906055e5507dd94efd63f4a05021f103dc684ea62a3b0876b7595

See more details on using hashes here.

Provenance

The following attestation bundles were made for firecrawl_anydoc-0.2.4-cp310-abi3-win_amd64.whl:

Publisher: release.yml on firecrawl/anydoc

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file firecrawl_anydoc-0.2.4-cp310-abi3-musllinux_1_2_x86_64.whl.

File metadata

File hashes

Hashes for firecrawl_anydoc-0.2.4-cp310-abi3-musllinux_1_2_x86_64.whl
Algorithm Hash digest
SHA256 e57c79093c1592929dd8dfaf6c60b49eefe631721d96fb833c3f465472b37b9f
MD5 ef06b762a568cda59ce32cf563180a95
BLAKE2b-256 cb2950c52b0ea5dd645aea6d195da913c8d9e136601eec465bd9a590edd250c7

See more details on using hashes here.

Provenance

The following attestation bundles were made for firecrawl_anydoc-0.2.4-cp310-abi3-musllinux_1_2_x86_64.whl:

Publisher: release.yml on firecrawl/anydoc

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file firecrawl_anydoc-0.2.4-cp310-abi3-musllinux_1_2_aarch64.whl.

File metadata

File hashes

Hashes for firecrawl_anydoc-0.2.4-cp310-abi3-musllinux_1_2_aarch64.whl
Algorithm Hash digest
SHA256 dd162b5eb64478fcf02f53abe7765e26f4350ba657f36c25f055c4cc3dbade0a
MD5 cdf09b9ef31708ff631e0ea02f9fcb15
BLAKE2b-256 1428b4d0d3c5345cdd65c0b9113c6e6ff1b717fe360dccb658db2a9952315f9c

See more details on using hashes here.

Provenance

The following attestation bundles were made for firecrawl_anydoc-0.2.4-cp310-abi3-musllinux_1_2_aarch64.whl:

Publisher: release.yml on firecrawl/anydoc

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file firecrawl_anydoc-0.2.4-cp310-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for firecrawl_anydoc-0.2.4-cp310-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 0e5aed01bf6d4e5c588d3363888293f2ceeb9feb00449a32e0ba993797cf0bd3
MD5 b07e92a6af9a723e0a75a9aeeea1f745
BLAKE2b-256 fc16feeca9705bfdb237f1cb69ede0b373b144c0d51df4297e595a74b815557e

See more details on using hashes here.

Provenance

The following attestation bundles were made for firecrawl_anydoc-0.2.4-cp310-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl:

Publisher: release.yml on firecrawl/anydoc

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file firecrawl_anydoc-0.2.4-cp310-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl.

File metadata

File hashes

Hashes for firecrawl_anydoc-0.2.4-cp310-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 17720ba093820654162891d7995fd2dbae948b16fe1c174ba799bddfc0b92ad6
MD5 e99c53c5dad0258c7e32fc13619eac5c
BLAKE2b-256 77b55784fc514f58ca19328faee701d2cc2e25961389c2d4908b2a51a1071ee4

See more details on using hashes here.

Provenance

The following attestation bundles were made for firecrawl_anydoc-0.2.4-cp310-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl:

Publisher: release.yml on firecrawl/anydoc

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file firecrawl_anydoc-0.2.4-cp310-abi3-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for firecrawl_anydoc-0.2.4-cp310-abi3-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 b2a01eecaa0b99f99ff6749a098f8c7a5250d41db9c53673eb93536ad575bfed
MD5 3593c89a2848d413d6e159bb6683c82f
BLAKE2b-256 597d4b2a466c8953af3b9d94471081b04ce8636680111402d2140105f98c02e5

See more details on using hashes here.

Provenance

The following attestation bundles were made for firecrawl_anydoc-0.2.4-cp310-abi3-macosx_11_0_arm64.whl:

Publisher: release.yml on firecrawl/anydoc

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file firecrawl_anydoc-0.2.4-cp310-abi3-macosx_10_12_x86_64.whl.

File metadata

File hashes

Hashes for firecrawl_anydoc-0.2.4-cp310-abi3-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 e3745a8b108d6575beafd37bcefe52e3f6c7ab44138e05cbdf4c6adf63caba84
MD5 1f3bce73b93fb45378f83d4184f75402
BLAKE2b-256 25f15616b8d703b2bf5688eda86ede4b35620356d9c60346fe2d3efbec2a872d

See more details on using hashes here.

Provenance

The following attestation bundles were made for firecrawl_anydoc-0.2.4-cp310-abi3-macosx_10_12_x86_64.whl:

Publisher: release.yml on firecrawl/anydoc

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Release history Release notifications | RSS feed

This release

0.2.4 This release

8 files

0.2.3

8 files

0.2.2

8 files

0.2.1

8 files

0.2.0

8 files

0.1.9

8 files

0.1.8

8 files

0.1.7

8 files

0.1.6

8 files

0.1.5

8 files

0.1.4

8 files

0.1.3

8 files

0.1.2

8 files

0.1.1

8 files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page