Skip to main content

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.

License Python


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 pass url= / base64=.
  • Errors are exceptions. A tool that reports a problem (blocked URL, bad input) raises HiraraToolError; an unreachable hub or bad token raises HiraraError. Pass raise_on_error=False to call() 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, …) PDF
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

hirara-0.1.0.tar.gz (11.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

hirara-0.1.0-py3-none-any.whl (10.7 kB view details)

Uploaded Python 3

File details

Details for the file hirara-0.1.0.tar.gz.

File metadata

  • Download URL: hirara-0.1.0.tar.gz
  • Upload date:
  • Size: 11.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/7.0.0 CPython/3.14.5

File hashes

Hashes for hirara-0.1.0.tar.gz
Algorithm Hash digest
SHA256 51c6b3ae1caf86e67790087d8100798de191fc75e2728f17c2e7b060231e3195
MD5 a70b5a9e320e37a02069ef8878d3896b
BLAKE2b-256 d30df352111c45d31e5f2071255cb7ac9de1f4a47820021e493e8c4e7a91b42c

See more details on using hashes here.

File details

Details for the file hirara-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: hirara-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 10.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/7.0.0 CPython/3.14.5

File hashes

Hashes for hirara-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 85e36c46ab6e476b2279f5b9afed62d558fde936f921f61a988e2991f2480cac
MD5 39dd6b63e6e487cf546f708a90d5f68c
BLAKE2b-256 92fd9cfc1fa7408c33917df67e594195eb4cfa0ab04ee6a44b5538b1ae031493

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page