Fast, cross-platform readers for .txt, .xlsx/.xls, .docx/.doc, .pptx/.ppt implemented in Rust via PyO3 and packaged with maturin.
Project description
industrial_readers
Industrial-grade document readers for Python, implemented in Rust with PyO3 and packaged using maturin.
Supports:
- Text:
.txt - Spreadsheets:
.xlsx,.xls(viacalamine) - Word:
.docx(viadocx-parser),.doc(best-effort UTF‑16LE text extraction) - PowerPoint:
.pptx(viapptx-to-md),.ppt(best-effort UTF‑16LE text extraction) - PDF:
.pdf(plain-text extraction viapdf-extract) - Images:
.png,.jpg,.jpeg,.gif,.bmp,.ico,.tiff,.webp(basic metadata viaimage)
Legacy binary formats (
.docand.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/.pptare parsed via UTF‑16LE text scanning; this avoids unsafe native deps and keeps wheels portable.ReaderConfiglets you cap rows/cells to prevent memory blowups.
License
MIT
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distributions
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file industrial_readers-0.1.0-cp38-abi3-win_amd64.whl.
File metadata
- Download URL: industrial_readers-0.1.0-cp38-abi3-win_amd64.whl
- Upload date:
- Size: 3.7 MB
- Tags: CPython 3.8+, Windows x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
d881385d1e6777b749fa9cdc8e1b11935e0f742e4ede514c4fe2bf688533c5b2
|
|
| MD5 |
19450692fdf4ae9fb7e8336c66e8e937
|
|
| BLAKE2b-256 |
5884d8935096b552d2ed63c502ffe898fef55edcead5c700a3d8d53719a43877
|