Skip to main content

humanhours SDK: one HTTP call per AI agent task, automatic proof of hours and euros saved.

Project description

humanhours (Python)

The ROI meter for your AI agents. One HTTP call per task, automatic proof of hours and euros saved.

pip install humanhours

60-second quickstart

from humanhours import Humanhours

hh = Humanhours(api_key="hh_live_...")

hh.track(
    agent_id="support-classifier",
    task_type="email_classification",
    outcome="success",
)

That's it. The dashboard at humanhours.dev shows the saved hours and euros.

Decorator

from humanhours import Humanhours, track

hh = Humanhours(api_key="...", default_agent_id="support-classifier")

@track(hh, task_type="email_classification")
def classify(subject: str) -> str:
    ...

The decorator times the function, captures the outcome (success on return, failure on raise), and reports automatically. Failures re-raise — your code keeps its normal control flow.

Ambient client (context manager)

with Humanhours(api_key="...") as hh:
    @track(task_type="contract_clause_review", agent_id="legal-clause-reviewer")
    def review_clause(text):
        ...
    review_clause("...")

@track without client= picks up the active with scope. Useful when you can't pass the client through a deep call tree.

Read your numbers

hh.summary(period="30d")
hh.agents()
hh.report("/time-saved", {"period": "30d", "group_by": "agent"})

Errors

from humanhours import Humanhours, HumanhoursError

try:
    hh.track(task_type="...", agent_id="...", outcome="success")
except HumanhoursError as e:
    if e.code == "unknown_task_type":
        ...
    raise

Configuration

Argument Default Notes
api_key (required) hh_live_... from the dashboard
base_url https://humanhours.dev Override for self-hosted or local dev
default_agent_id None Skip the field on every track()
timeout 10.0 Per-call seconds
client None Inject your own httpx.Client

The decorator also reads HUMANHOURS_API_KEY / HUMANHOURS_BASE_URL from the environment as a fallback.

License

MIT.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

humanhours-0.0.1.tar.gz (4.6 kB view details)

Uploaded Source

Built Distribution

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

humanhours-0.0.1-py3-none-any.whl (5.2 kB view details)

Uploaded Python 3

File details

Details for the file humanhours-0.0.1.tar.gz.

File metadata

  • Download URL: humanhours-0.0.1.tar.gz
  • Upload date:
  • Size: 4.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.9.6

File hashes

Hashes for humanhours-0.0.1.tar.gz
Algorithm Hash digest
SHA256 e30929a0a7c9ec40882e632a213d3ac2e5fbeec03e46f1f50d0da79d284e0a93
MD5 8707dabc26ad51873a91ab4e30b1d1ff
BLAKE2b-256 6759105148a5f6ad3f6280d127155e29435460e3650766aedf85dcf875ac9a1b

See more details on using hashes here.

File details

Details for the file humanhours-0.0.1-py3-none-any.whl.

File metadata

  • Download URL: humanhours-0.0.1-py3-none-any.whl
  • Upload date:
  • Size: 5.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.9.6

File hashes

Hashes for humanhours-0.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 1b055a860ee1c0bf0811db9ef660f26047b9b359ae05dadd57cbe5e3cc4a26f3
MD5 00bee254a79798a35c5b254b6c8628eb
BLAKE2b-256 5ccaeae8ed4a38e1a6a90c5b398a320c44ca7afe7049eb4c6c2d37d9cc851535

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