Skip to main content

industrial_readers

Industrial-grade document readers for Python, implemented in Rust with PyO3 and packaged using maturin.
Supports:

  • Text: .txt
  • Spreadsheets: .xlsx, .xls (via calamine)
  • Word: .docx (via docx-parser), .doc (best-effort UTF‑16LE text extraction)
  • PowerPoint: .pptx (via pptx-to-md), .ppt (best-effort UTF‑16LE text extraction)
  • PDF: .pdf (plain-text extraction via pdf-extract)
  • Images: .png, .jpg, .jpeg, .gif, .bmp, .ico, .tiff, .webp (basic metadata via image)

Legacy binary formats (.doc and .ppt) are parsed best-effort by scanning for UTF‑16LE text. This is robust for plain text extraction but does not recover full formatting or embedded objects. If you need full-fidelity parsing of legacy formats, consider first converting them to OOXML (.docx/.pptx).

Install (developers)

This project builds universal abi3 wheels for CPython ≥ 3.8 on Windows and Linux.

# 1) Create a virtualenv (recommended)
python -m venv .venv && . .venv/bin/activate  # Windows: .venv\Scripts\activate

# 2) Install maturin
pip install maturin

# 3) Build a wheel
# Linux: build manylinux-compliant wheel (requires Docker if you don't have a manylinux host)
maturin build --release --compatibility manylinux_2_28

# Windows: regular build
maturin build --release

# 4) Install the generated wheel (found in target/wheels/)
pip install target/wheels/industrial_readers-*.whl

See the maturin docs for additional options and platform tags.

Python usage

import industrial_readers as ir

# Read anything (format is auto-detected by signature, not just extension)
obj = ir.read_any("sample.xlsx")
print(type(obj))  # Python dicts/lists/strings depending on format

# Format-specific readers
sheets = ir.read_xlsx("sample.xlsx")     # [{'name': ..., 'nrows': ..., 'ncols': ..., 'rows': [[...], ...]}, ...]
docx   = ir.read_docx("sample.docx")     # {'markdown': '...', 'json': '...'}
pptx   = ir.read_pptx("sample.pptx")     # [{'index': 1, 'markdown': '...'}, ...]
text   = ir.read_txt("sample.txt")       # '...'

# PDF and images
pdf_text = ir.read_pdf("sample.pdf")      # plain text content
img_info = ir.read_image("sample.png")    # {'width': ..., 'height': ..., 'color_type': '...', 'format': '...'}

# Legacy formats (best-effort plain text):
doc_text = ir.read_doc("sample.doc")
ppt_text = ir.read_ppt("sample.ppt")

# Optional config (limits & legacy tuning)
cfg = ir.ReaderConfig(max_rows_per_sheet=10_000, max_cells_per_sheet=1_000_000, legacy_min_run=4)
obj = ir.read_any("big.xlsx", cfg)

Additional APIs

# Explicit format detection (by signatures, not just extension)
fmt = ir.detect("mystery_file.bin")   # e.g. "xlsx", "docx", "pptx", "txt", ...

# Dedicated XLS reader (same structure as read_xlsx)
xls_sheets = ir.read_xls("legacy.xls")

Encryption helpers

import industrial_readers as ir

# Generate a fresh random 32-byte key
key = ir.generate_key()          # bytes

# High-level helpers: .sequa files
enc_path = ir.encrypt_to_sequa("secret.txt", key)  # -> "secret.txt.sequa"
dec_path = ir.decrypt_sequa(enc_path, key)          # -> "secret.txt"

# Lower-level helpers: explicit output paths
ir.encrypt_file("secret.txt", "secret.bin", key)
ir.decrypt_file("secret.bin", "secret.txt", key)

Safety & limits

  • OOXML readers (.xlsx, .docx, .pptx) rely on well-maintained, pure-Rust crates.
  • .doc/.ppt are parsed via UTF‑16LE text scanning; this avoids unsafe native deps and keeps wheels portable.
  • ReaderConfig lets you cap rows/cells to prevent memory blowups.

License

MIT

Metadata

Release files for industrial-readers 0.1.0

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

Built distribution (wheel)

Table of built distributions (wheels) for industrial-readers 0.1.0
File Interpreter ABI Platform
industrial_readers-0.1.0-cp38-abi3-win_amd64.whl CPython 3.8 abi3 Windows x86-64 Details

Release files / industrial_readers-0.1.0-cp38-abi3-win_amd64.whl

Download URL industrial_readers-0.1.0-cp38-abi3-win_amd64.whl
Size 3.7 MB
Tags CPython 3.8 Windows x86-64 abi3
SHA-256 checksum
How to use checksums
d881385d1e6777b749fa9cdc8e1b11935e0f742e4ede514c4fe2bf688533c5b2
BLAKE2b-256 checksum
How to use checksums
5884d8935096b552d2ed63c502ffe898fef55edcead5c700a3d8d53719a43877
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.13.9

Security for industrial-readers 0.1.0

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.

No provenance found

None of the files in this release were uploaded with provenance metadata.

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.

Release history Release notifications | RSS feed

This release

0.1.0 This release

1 release file No provenance

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