hebrah
Official Python SDK for the hebrah control plane API (hebrah-api).
Install
pip install hebrah
Requires Python 3.10+.
Quick start
import os
from hebrah import HebrahClient, verify_webhook_signature
with HebrahClient(
api_key=os.environ["HEBRAH_API_KEY"],
default_connection_id=os.environ.get("HEBRAH_CONNECTION_ID"),
) as client:
catalog = client.sandbox.catalog()
patient_id = catalog["sample_patient_ids"][0]
patient = client.sandbox.resource("Patient", patient_id)
client.webhooks.trigger_mock_event(
event="patient.admitted",
patient_id=patient_id,
)
v0.8:
default_connection_idis applied when sandbox methods omitconnection_id.client.patients.list()/get()emitDeprecationWarning— usesandbox.list_synthetic_resources("Patient")instead.
Webhook verification
from hebrah import verify_webhook_signature
payload = verify_webhook_signature(
request.get_data(),
request.headers.get("X-Hebrah-Signature"),
webhook_secret,
)
Security
- Store
HEBRAH_API_KEYandHEBRAH_WEBHOOK_SECRETin server-side environment variables or a secrets manager only — never expose them to browsers or commit.envfiles. - The SDK does not persist credentials; they live in memory for the lifetime of each
HebrahClientinstance. base_urlmust behttps://in production, orhttp://localhost/http://127.0.0.1for local dev — otherhttp://hosts are rejected at construction to reduce API-key exfiltration risk.- Treat
HebrahApiError.detailas operator-only diagnostics. Do not log or return it to end users — it may contain internal paths or sensitive API error payloads. Setinclude_error_detail=FalseonHebrahClientto omitdetailfrom errors.
See SECURITY.md for supported versions and vulnerability reporting.
API surface (v0.8)
Sandbox & resources
| Method | Description |
|---|---|
client.health() |
GET /health (no API key on separate httpx call) |
client.sandbox.catalog(connection_id=None) |
GET /v1/sandbox/catalog — uses default_connection_id when omitted |
client.sandbox.domains() |
GET /v1/sandbox/domains |
client.sandbox.domain(domain_id) |
GET /v1/sandbox/domains/{id} |
client.sandbox.list_synthetic_resources(resource_type, connection_id=None) |
GET /v1/sandbox/resources/{type} |
client.sandbox.resource(resource_type, resource_id, patient_id=None) |
GET /v1/sandbox/resources/{type}/{id} |
client.sandbox.run_scenario(scenario_id, ...) |
POST /v1/sandbox/scenarios/{id}/run |
client.sandbox.synthetic_ehr_profile(connection_id=...) |
GET /v1/sandbox/synthetic-ehr/profile |
client.sandbox.list_ehr_models() |
GET /v1/sandbox/ehr-models |
client.sandbox.reset_synthetic_ehr(connection_id=...) |
POST /v1/sandbox/synthetic-ehr/reset |
client.sandbox.payer_rules(payer_id) |
GET /v1/sandbox/payer-rules/{id} |
client.patients.list(connection_id=None) |
Deprecated — GET /v1/patients |
client.patients.get(id, connection_id=None) |
Deprecated — GET /v1/patients/{id} |
HL7, webhooks, interop
| Method | Description |
|---|---|
client.sandbox.hl7_templates() |
GET /v1/sandbox/hl7/templates |
client.sandbox.inject_hl7(...) |
POST /v1/sandbox/hl7/inject |
client.sandbox.configure_webhook_reliability(**profile) |
PATCH /v1/sandbox/webhook-reliability |
client.sandbox.run_webhook_reliability_scenario(scenario_id, ...) |
POST /v1/sandbox/scenarios/{id}/run (alias) |
client.sandbox.run_mpi_match(...) |
POST /v1/sandbox/mpi/match |
client.sandbox.run_aggregator_query(...) |
POST /v1/sandbox/aggregator/query |
client.sandbox.get_practitioner_credentialing(practitioner_id) |
GET /v1/sandbox/credentialing/practitioners/{id} |
client.webhooks.trigger_mock_event(...) |
POST /v1/webhooks/trigger-mock-event |
client.webhooks.list_deliveries(...) |
GET /v1/webhooks/deliveries |
client.webhooks.replay_delivery(delivery_id) |
POST /v1/webhooks/deliveries/{id}/replay |
verify_webhook_signature(raw_body, signature, secret) |
Local HMAC-SHA256 verify |
SMART & FHIR
| Method | Description |
|---|---|
client.smart.launch(...) |
POST /v1/smart/launch |
client.smart.register_client(...) |
POST /v1/smart/clients |
client.smart.exchange_token(...) |
POST /oauth/token (form-encoded; no API key) |
client.fhir.read_patient(patient_id, access_token) |
GET /fhir/R4/Patient/{id} (SMART access token) |
Advanced: BYOM agent harness
HebrahAgentHarness is exported for bring-your-own-model EHR workflows (MCP + integration-agent). It is not part of the core integrator quick start — harness improvements are tracked separately from the core client.
Configuration
| Variable | Description |
|---|---|
HEBRAH_API_KEY |
Pass to HebrahClient(api_key=...) |
HEBRAH_API_BASE_URL |
Optional; default https://api.hebrah.com |
HEBRAH_CONNECTION_ID |
Optional; pass to default_connection_id for sandbox reads |
HEBRAH_WEBHOOK_SECRET |
For verify_webhook_signature |
Docs
Full integrator reference: hebrah-app /docs/sdk.
License
MIT
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 hebrah-0.8.1.tar.gz.
File metadata
- Download URL: hebrah-0.8.1.tar.gz
- Upload date:
- Size: 12.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via:
twine/6.1.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
545997e9884c1fe9ed2b17342c0445cfae3addb2643bc1522ebbf635243bcc47
|
|
| MD5 |
3aa9c89f4ba1aba8af089fff2b6a5923
|
|
| BLAKE2b-256 |
acf5ad268421a5f745036a40f786daa11af20bdfed261eda18852071528c3a99
|
Provenance
The following attestation bundles were made for hebrah-0.8.1.tar.gz:
Publisher:
ci.yml on Hebrah-inc/hebrah-sdk-python
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
hebrah-0.8.1.tar.gz -
Subject digest:
545997e9884c1fe9ed2b17342c0445cfae3addb2643bc1522ebbf635243bcc47 - Sigstore transparency entry: 2250361897
- Sigstore integration time:
-
Permalink:
Hebrah-inc/hebrah-sdk-python@d4d3a4fd5bebe4ba488af365e77b6045e55e5608 -
Branch / Tag:
refs/tags/sdk-python-v0.8.1 - Owner: https://github.com/Hebrah-inc
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
ci.yml@d4d3a4fd5bebe4ba488af365e77b6045e55e5608 -
Trigger Event:
push
-
Statement type:
File details
Details for the file hebrah-0.8.1-py3-none-any.whl.
File metadata
- Download URL: hebrah-0.8.1-py3-none-any.whl
- Upload date:
- Size: 11.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via:
twine/6.1.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
a95a9cc1f2a25e0f8de46fa8c337f5499e7e2134d387d2bd7288c46286541dad
|
|
| MD5 |
9e2e99b6c60ae24f6a901cd7ec6c674d
|
|
| BLAKE2b-256 |
bf722a15c5325863261039a73897a25eb2faf254a577f681676e0b60c45fb5b5
|
Provenance
The following attestation bundles were made for hebrah-0.8.1-py3-none-any.whl:
Publisher:
ci.yml on Hebrah-inc/hebrah-sdk-python
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
hebrah-0.8.1-py3-none-any.whl -
Subject digest:
a95a9cc1f2a25e0f8de46fa8c337f5499e7e2134d387d2bd7288c46286541dad - Sigstore transparency entry: 2250361989
- Sigstore integration time:
-
Permalink:
Hebrah-inc/hebrah-sdk-python@d4d3a4fd5bebe4ba488af365e77b6045e55e5608 -
Branch / Tag:
refs/tags/sdk-python-v0.8.1 - Owner: https://github.com/Hebrah-inc
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
ci.yml@d4d3a4fd5bebe4ba488af365e77b6045e55e5608 -
Trigger Event:
push
-
Statement type: