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).
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
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 hirara-0.2.0.tar.gz.
File metadata
- Download URL: hirara-0.2.0.tar.gz
- Upload date:
- Size: 15.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/7.0.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
60814d07802f38da2020c36f74ecb34836907e5c85b3b25b768a8572a6268b67
|
|
| MD5 |
bd088141a3efc11c7175937ac55b03a9
|
|
| BLAKE2b-256 |
ff17e6dff1fcf0a2fd1de999d03159f3dca24e489d12d7d154eebb649d15710c
|
Provenance
The following attestation bundles were made for hirara-0.2.0.tar.gz:
Publisher:
pypi-publish.yml on lucasdmarshall/Hirara
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
hirara-0.2.0.tar.gz -
Subject digest:
60814d07802f38da2020c36f74ecb34836907e5c85b3b25b768a8572a6268b67 - Sigstore transparency entry: 2361780254
- Sigstore integration time:
-
Permalink:
lucasdmarshall/Hirara@a2dce6ceff7db8527a994bec2286597464bec7f9 -
Branch / Tag:
refs/heads/main - Owner: https://github.com/lucasdmarshall
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
pypi-publish.yml@a2dce6ceff7db8527a994bec2286597464bec7f9 -
Trigger Event:
workflow_dispatch
-
Statement type:
File details
Details for the file hirara-0.2.0-py3-none-any.whl.
File metadata
- Download URL: hirara-0.2.0-py3-none-any.whl
- Upload date:
- Size: 14.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/7.0.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
e4ac3cdf286c2a7142f7bbf5c699c5eae0bd959682655f2ae4dc43808daac6b4
|
|
| MD5 |
eea3d5e3154d2ade08629c132c541324
|
|
| BLAKE2b-256 |
4db9fddacddc1dd2197b9565fea07d2fe5da1c24cd78e697441ec03c34b792b0
|
Provenance
The following attestation bundles were made for hirara-0.2.0-py3-none-any.whl:
Publisher:
pypi-publish.yml on lucasdmarshall/Hirara
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
hirara-0.2.0-py3-none-any.whl -
Subject digest:
e4ac3cdf286c2a7142f7bbf5c699c5eae0bd959682655f2ae4dc43808daac6b4 - Sigstore transparency entry: 2361780258
- Sigstore integration time:
-
Permalink:
lucasdmarshall/Hirara@a2dce6ceff7db8527a994bec2286597464bec7f9 -
Branch / Tag:
refs/heads/main - Owner: https://github.com/lucasdmarshall
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
pypi-publish.yml@a2dce6ceff7db8527a994bec2286597464bec7f9 -
Trigger Event:
workflow_dispatch
-
Statement type: