Skip to main content

zeroset-anydoc

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 zeroset-anydoc

The package installs as zeroset-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 get Markdown and the document model from one parse. Rendered parts map
# source units and embedded assets back to exact ranges in document.blocks:
document = anydoc.to_document(data)
markdown = document.markdown
for part in document.rendered_parts:
    blocks = document.blocks[part.start_block : part.end_block]
    assets = [document.assets[asset_id] for asset_id in part.asset_ids]

# Skip the Python document graph when only rendered text and provenance are
# needed:
rendered = anydoc.to_rendered_parts(data)
for part in rendered.parts:
    source = (
        rendered.source_units[part.source_unit_index]
        if part.source_unit_index is not None
        else None
    )

# Read bounded XLSX/XLSM image ownership without parsing spreadsheet cells:
manifest = anydoc.extract_spreadsheet_assets(xlsx_data)
for sheet in manifest.source_units:
    images = [manifest.assets[asset_id] for asset_id in sheet.asset_ids]

# Bound application-level payload retention without losing text, asset ids,
# or part/sheet provenance. Omitted assets have data=None plus a reason.
policy = anydoc.AssetRetentionPolicy(
    max_unique_assets=200,
    max_total_bytes=32 * 1024 * 1024,
    max_asset_bytes=32 * 1024 * 1024,
)
document = anydoc.to_document(data, asset_policy=policy)
omitted = [asset for asset in document.assets if asset.data is None]

Errors

A conversion raises only when no meaningful 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 (an image-only PDF)
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
OSError The file could not be read, from to_markdown only

The five conversion failures subclass 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 its record stays on document.assets, tagged with a media type and source part. By default asset.data carries the bytes. An AssetRetentionPolicy can omit payloads by unique count, aggregate bytes, or individual bytes; the same asset id remains in rendered parts and source units, while data, byte_len, and omission_reason expose the structured outcome. Images that carry an external URL render as ordinary Markdown images. Standard XLSX/XLSM DrawingML images retain their sheet and bounded cell placement.

Presentation slides and spreadsheet sheets are exposed through document.source_units. Each unit carries its 1-based ordinal, optional source name, extraction status, and a half-open range into document.blocks; empty and skipped units are retained.

document.rendered_parts is the ordered partition for consuming that model. Each part carries Markdown for its block range, the corresponding source-unit index when one exists, and recursively discovered embedded asset ids. Gaps and assets without honest source-unit provenance remain in unowned parts rather than being attributed to the nearest slide or sheet.

Full behavior notes and benchmarks live in the repository README.

License

MIT

Metadata

Release files for zeroset-anydoc 0.2.4

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Built distributions (wheels)

Table of built distributions (wheels) for zeroset-anydoc 0.2.4
File Actions
zeroset_anydoc-0.2.4-cp310-abi3-win_amd64.whl CPython 3.10 abi3 Windows x86-64 Details for zeroset_anydoc-0.2.4-cp310-abi3-win_amd64.whl
zeroset_anydoc-0.2.4-cp310-abi3-musllinux_1_2_x86_64.whl CPython 3.10 abi3 Linux musl 1.2+ x86-64 Details for zeroset_anydoc-0.2.4-cp310-abi3-musllinux_1_2_x86_64.whl
zeroset_anydoc-0.2.4-cp310-abi3-musllinux_1_2_aarch64.whl CPython 3.10 abi3 Linux musl 1.2+ ARM64 Details for zeroset_anydoc-0.2.4-cp310-abi3-musllinux_1_2_aarch64.whl
zeroset_anydoc-0.2.4-cp310-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl CPython 3.10 abi3 Linux glibc 2.17+ x86-64 Details for zeroset_anydoc-0.2.4-cp310-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
zeroset_anydoc-0.2.4-cp310-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl CPython 3.10 abi3 Linux glibc 2.17+ ARM64 Details for zeroset_anydoc-0.2.4-cp310-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
zeroset_anydoc-0.2.4-cp310-abi3-macosx_11_0_arm64.whl CPython 3.10 abi3 macOS 11.0+ ARM64 Details for zeroset_anydoc-0.2.4-cp310-abi3-macosx_11_0_arm64.whl
zeroset_anydoc-0.2.4-cp310-abi3-macosx_10_12_x86_64.whl CPython 3.10 abi3 macOS 10.12+ x86-64 Details for zeroset_anydoc-0.2.4-cp310-abi3-macosx_10_12_x86_64.whl

Total release size: 24.1 MB

Release files / zeroset_anydoc-0.2.4-cp310-abi3-win_amd64.whl

Download URL zeroset_anydoc-0.2.4-cp310-abi3-win_amd64.whl
Size 3.6 MB
Tags CPython 3.10 Windows x86-64 abi3
SHA-256 checksum
How to use checksums
a3b3696e92c319f63e754655572351e77c467dd31d21c831cc453a27574d6b16
BLAKE2b-256 checksum
How to use checksums
35ad0d5853d0e96c732392b5ff58bb1e16a9dc984056d84d509c7a8026fc5499
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Aug 7, 2026.

Transparency log

Release files / zeroset_anydoc-0.2.4-cp310-abi3-musllinux_1_2_x86_64.whl

Download URL zeroset_anydoc-0.2.4-cp310-abi3-musllinux_1_2_x86_64.whl
Size 3.7 MB
Tags CPython 3.10 Linux musl 1.2+ x86-64 abi3
SHA-256 checksum
How to use checksums
12714e5776bf21408388c665471e3ba81b8881990ed946a13503def622f471b0
BLAKE2b-256 checksum
How to use checksums
a1fe3b3eb705c2d626d64c8e3cf04b21cd4a9348a7f8b3046e712f5f8cb999f2
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Aug 7, 2026.

Transparency log

Release files / zeroset_anydoc-0.2.4-cp310-abi3-musllinux_1_2_aarch64.whl

Download URL zeroset_anydoc-0.2.4-cp310-abi3-musllinux_1_2_aarch64.whl
Size 3.4 MB
Tags CPython 3.10 Linux musl 1.2+ ARM64 abi3
SHA-256 checksum
How to use checksums
d5540565119a9155dd4daef290cfd65f68e952d32f8c5ed2a4786c24639fbf41
BLAKE2b-256 checksum
How to use checksums
99776308804c3dcbe4f1a252d2e0ae78ea6e3457ac90058223eff12449ba3046
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Aug 7, 2026.

Transparency log

Release files / zeroset_anydoc-0.2.4-cp310-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl

Download URL zeroset_anydoc-0.2.4-cp310-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Size 3.5 MB
Tags CPython 3.10 Linux glibc 2.17+ x86-64 abi3
SHA-256 checksum
How to use checksums
11013ace0f70a67725aee99ff7f0561afe8e562fec6594f6e148a47f13e40a0c
BLAKE2b-256 checksum
How to use checksums
de5bd3a83c70754b0eb5be8898768775eda8fcd86225c514876ae43fc22a4438
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Aug 7, 2026.

Transparency log

Release files / zeroset_anydoc-0.2.4-cp310-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl

Download URL zeroset_anydoc-0.2.4-cp310-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Size 3.3 MB
Tags CPython 3.10 Linux glibc 2.17+ ARM64 abi3
SHA-256 checksum
How to use checksums
35ece64fb3fe1a871b297c5454409f7fa8bc7c5a3c6a45d493bfc221543d33c4
BLAKE2b-256 checksum
How to use checksums
7916c84a6188d976636eb206b08a9816662031476f25dccebb7cd0d666cb817c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Aug 7, 2026.

Transparency log

Release files / zeroset_anydoc-0.2.4-cp310-abi3-macosx_11_0_arm64.whl

Download URL zeroset_anydoc-0.2.4-cp310-abi3-macosx_11_0_arm64.whl
Size 3.2 MB
Tags CPython 3.10 abi3 macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
05c905a41125ba616e97a2ad16cf591877a11db0ff05a845290430948a6028f8
BLAKE2b-256 checksum
How to use checksums
10e4fff19261b8364736e07e06cac3c6c2d5003d9e3e5046d0ad138e241c0498
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Aug 7, 2026.

Transparency log

Release files / zeroset_anydoc-0.2.4-cp310-abi3-macosx_10_12_x86_64.whl

Download URL zeroset_anydoc-0.2.4-cp310-abi3-macosx_10_12_x86_64.whl
Size 3.4 MB
Tags CPython 3.10 abi3 macOS 10.12+ x86-64
SHA-256 checksum
How to use checksums
3d413994db9f9d711165659867397054ede6445b79d7be778d0e8ef321bfaf4f
BLAKE2b-256 checksum
How to use checksums
23a57a1eab27ba35484b9d31f6d89b2e60f47827d492b84ef1dc71178e1c94c9
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Aug 7, 2026.

Transparency log

Security for zeroset-anydoc 0.2.4

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

All 7 files in this release have been uploaded with provenance metadata.

Select from 7 files

Attestation for zeroset_anydoc-0.2.4-cp310-abi3-win_amd64.whl

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Aug 7, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

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