HiraraReader
Self-hosted Office-document reader for AI agents — docx, pptx, xlsx → text. No API keys.
Part of the Hirara tool hub.
Pure-Python — python-docx,
python-pptx, and
openpyxl. URL fetches route
through the hub's shared SSRF guard, hirara-core.
One tool, three formats
office_read takes a Word, PowerPoint, or Excel file and returns clean
markdown (plus the plain text). The format is auto-detected from the file
contents — they are all ZIP containers, told apart by what's inside — so the
agent never has to pick; it just says "read this file."
| Format | What comes out |
|---|---|
.docx |
Headings (#), bullet lists (-), and tables preserved as markdown |
.pptx |
Per-slide text under ## Slide N, plus speaker notes |
.xlsx |
One markdown table per sheet, under ## Sheet: <name> |
It pairs with the hub's other readers: hirarapdf for PDFs
and hiraraocr for images and scans. This one owns the Office
formats.
Legacy binary formats (
.doc/.xls/.ppt) are recognized and rejected with a clear message — save as the modern OOXML format instead.
Quick start
pip install -e ../hirara-core # shared SSRF guard (repo-local)
pip install -e ".[service,mcp]"
As an HTTP service:
uvicorn hirarareader.service:app --host 127.0.0.1 --port 8500
Read a document (base64, path, or URL) → markdown + text:
curl -X POST localhost:8500/office_read -H 'content-type: application/json' \
-d '{"file_path":"/path/to/report.docx"}'
Or upload it directly:
curl -X POST localhost:8500/office_read/upload -F file=@deck.pptx
As an MCP server over stdio (Claude Desktop / Cursor / agent runtimes):
python -m hirarareader.mcp_server
With Docker (loopback-bound, nothing to download at boot):
docker compose up -d --build
API
| Endpoint | Purpose |
|---|---|
POST /office_read |
Read one document. file_path / file_url / file_base64, filename |
POST /office_read/upload |
Same, multipart file upload |
GET /schemas |
Tool definition, ready for an LLM tools array |
GET /health |
Liveness + supported formats |
Response carries kind (docx/pptx/xlsx), markdown, text, meta
(paragraph/slide/sheet counts), truncated, source, and error. Errors come
back in the body, not as HTTP status codes: the caller is an agent loop, and
"unrecognized document" is a result to reason about.
Security
file_urlis off by default. When enabled (CRDR_ALLOW_URL_FETCH=true), the fetch goes throughhirara-core'ssafe_download— resolve-then-pin, every redirect hop re-validated, streamed under a byte cap — never a barehttpx.get.- Local file access is gated.
file_pathlets a caller name any file on the host; fine for a local/MCP server, off in the Docker image. SetCRDR_ALLOW_LOCAL_PATH=trueonly for a trusted, local deployment. - Everything is size-capped — input by
CRDR_MAX_BYTES, output byCRDR_MAX_CHARS(flagstruncated), spreadsheet rows byCRDR_MAX_ROWS.
Configuration
All via environment variable.
| Variable | Default | Notes |
|---|---|---|
CRDR_MAX_BYTES |
26214400 |
Cap on an input file (25 MB) |
CRDR_MAX_CHARS |
500000 |
Cap on output text/markdown; flags truncated |
CRDR_MAX_ROWS |
2000 |
Per-sheet row cap for spreadsheets |
CRDR_ALLOW_URL_FETCH |
false |
Enable file_url (through the SSRF guard) |
CRDR_ALLOW_LOCAL_PATH |
true (lib) / false (image) |
file_path reads |
Testing
pip install -e ".[dev]"
pytest -q
The suite builds tiny real .docx/.pptx/.xlsx files in memory and reads
them back — so it exercises the actual libraries end-to-end, no fixtures checked
in. Verified on a live server: all three formats read to the expected markdown.
License
Apache License 2.0 — see LICENSE and NOTICE.
Copyright 2026 Lucas D Marshall (Kaung Myat San).
Metadata
Release files for hirarareader 0.1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| hirarareader-0.1.0.tar.gz | 19.8 kB | With provenance | Details for hirarareader-0.1.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| hirarareader-0.1.0-py3-none-any.whl | Python 3 | none | any | Details for hirarareader-0.1.0-py3-none-any.whl |
Total release size: 38.7 kB
Release files / hirarareader-0.1.0.tar.gz
| Download URL | hirarareader-0.1.0.tar.gz |
|---|---|
| Size | 19.8 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
afa4e7d58bfba1ceaf530f572150fb9bad77e0eaca90d10f1feead93f978cfbe
|
|
BLAKE2b-256 checksum How to use checksums |
10c8bcadcad82f58532344c5fee47531aec52bac8a5236e80806f90c4aff0259
|
| 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 logRelease files / hirarareader-0.1.0-py3-none-any.whl
| Download URL | hirarareader-0.1.0-py3-none-any.whl |
|---|---|
| Size | 18.9 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
e20c6a9effebc385472ef12ad65cf23f800670821655f9f16a25b1c1ac276dcf
|
|
BLAKE2b-256 checksum How to use checksums |
9d012cb6d707d99034378db3e45a948b229d5dbe90c47694078e86bc479b9782
|
| 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 logSecurity for hirarareader 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.
Full provenance
Both files in this release have been uploaded with provenance metadata.
Attestation for hirarareader-0.1.0.tar.gz
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 logA 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.