hirara
The Python client for the Hirara self-hosted agent tool hub.
Call web search, PDF, OCR, code execution, and Office-document tools like functions — against a hub you run. No API keys.
pip install hirara
import hirara
hirara.configure("http://localhost:8080") # or set HIRARA_HUB_URL
hirara.web_search("rust borrow checker", max_results=5)
hirara.pdf_read(path="report.pdf") # client reads + base64s the file for you
hirara.office_read(path="deck.pptx")["markdown"]
hirara.execute_code("python", "print(sum(range(10)))")
hirara.ocr_read(path="scan.png", languages=["en"])
Or an explicit client (multiple hubs, threads, custom timeout):
from hirara import Client
hub = Client("http://localhost:8080", token="…") # or HIRARA_HUB_TOKEN
hub.form_extract(path="invoice.pdf")["fields"]
It talks to a running hub
hirara is a thin client — it does not bundle the tools (some need Docker,
SearXNG, or heavy models). It forwards calls to a running Hirara hub,
which you self-host:
docker compose -f docker-compose.hub.yml up -d --build
pip install hirara + a hub running = tools that work. No hub, no results.
Nice touches
- Local files just work. Pass
path=and the client reads the file and sends it as base64 — so it works even when the hub has no access to your disk (the default for a networked hub). Or passurl=/base64=. - Errors are exceptions. A tool that reports a problem (blocked URL, bad
input) raises
HiraraToolError; an unreachable hub or bad token raisesHiraraError. Passraise_on_error=Falsetocall()to get the raw dict. - Discovery.
hirara.tools()returns the hub's aggregated tool schemas;hirara.health()reports which backends are up. - Auth. Set a token (arg or
HIRARA_HUB_TOKEN) and it's sent as a bearer header — needed only when the hub is exposed on a network.
Tools
| Method | Tool |
|---|---|
web_search(query, …) · web_fetch(url, …) |
web |
pdf_read(...) · pdf_info(...) · pdf_create(content, …) |
|
ocr_read(...) · form_extract(...) |
OCR / forms |
office_read(...) |
Word / PowerPoint / Excel |
execute_code(language, code, …) |
sandboxed code |
call(name, arguments) |
any tool, raw |
File tools accept path= (local, auto-base64), url=, or base64=.
Environment
| Variable | Purpose |
|---|---|
HIRARA_HUB_URL |
Hub base URL (default http://localhost:8080) |
HIRARA_HUB_TOKEN |
Bearer token, if the hub requires auth |
Testing
pip install -e ".[dev]"
pytest -q
The suite drives the client against a mock hub (httpx MockTransport):
argument forwarding, path= → base64, one-source validation, error-to-exception
mapping, auth headers, and discovery.
License
Apache License 2.0 — see LICENSE and NOTICE.
Copyright 2026 Lucas D Marshall (Kaung Myat San).
Release files for hirara 0.2.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 | |
|---|---|---|---|
| hirara-0.2.0.tar.gz | 15.9 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| hirara-0.2.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 29.9 kB
Release files / hirara-0.2.0.tar.gz
| Download URL | hirara-0.2.0.tar.gz |
|---|---|
| Size | 15.9 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
60814d07802f38da2020c36f74ecb34836907e5c85b3b25b768a8572a6268b67
|
|
BLAKE2b-256 checksum How to use checksums |
ff17e6dff1fcf0a2fd1de999d03159f3dca24e489d12d7d154eebb649d15710c
|
| 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 6, 2026.
Transparency logRelease files / hirara-0.2.0-py3-none-any.whl
| Download URL | hirara-0.2.0-py3-none-any.whl |
|---|---|
| Size | 14.0 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
e4ac3cdf286c2a7142f7bbf5c699c5eae0bd959682655f2ae4dc43808daac6b4
|
|
BLAKE2b-256 checksum How to use checksums |
4db9fddacddc1dd2197b9565fea07d2fe5da1c24cd78e697441ec03c34b792b0
|
| 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 6, 2026.
Transparency log