Python SDK for Hedera standards and Registry Broker parity with TypeScript and Go SDKs.
Project description
HOL HCS SDK (Python)
| Python reference implementation of the Hiero Consensus Specifications (HCS) and Registry Broker utilities with parity against the TypeScript and Go SDKs. 📚 Standards SDK Documentation 📖 Hiero Consensus Specifications Documentation |
|---|
Quick Start
cd standards-sdk-py
python -m venv .venv
source .venv/bin/activate
pip install -e ".[dev]"
pytest -q
Install
pip install standards-sdk-py
Developer Tooling
cd standards-sdk-py
.venv/bin/pre-commit install
.venv/bin/pre-commit run --all-files
Documentation
For standards and API documentation:
Supported Packages
| Package | Coverage |
|---|---|
standards_sdk_py.hcs2 |
HCS-2 registry topic creation, indexed entry operations, memo helpers, mirror reads. |
standards_sdk_py.hcs3 |
HCS-3 recursive file loading helpers. |
standards_sdk_py.hcs5 |
HCS-5 hashinal inscription and minting helpers. |
standards_sdk_py.hcs6 |
HCS-6 non-indexed registry creation, registration helpers, memo helpers. |
standards_sdk_py.hcs7 |
HCS-7 indexed registry and metadata registration helpers. |
standards_sdk_py.hcs10 |
HCS-10 topic/message builders and communication helpers. |
standards_sdk_py.hcs11 |
HCS-11 profile models/builders, validation, inscription helpers. |
standards_sdk_py.hcs12 |
HCS-12 action/assembly/hashlinks helpers. |
standards_sdk_py.hcs14 |
HCS-14 UAID parsing and resolution helpers. |
standards_sdk_py.hcs15 |
HCS-15 account creation and memo helpers. |
standards_sdk_py.hcs16 |
HCS-16 flora account/topic/message helpers. |
standards_sdk_py.hcs17 |
HCS-17 state-hash helpers. |
standards_sdk_py.hcs18 |
HCS-18 discovery topic/message helpers. |
standards_sdk_py.hcs20 |
HCS-20 points message and validation helpers. |
standards_sdk_py.hcs21 |
HCS-21 adapter declaration helpers. |
standards_sdk_py.hcs26 |
HCS-26 memo parser/resolver helpers. |
standards_sdk_py.hcs27 |
HCS-27 checkpoint helpers. |
standards_sdk_py.inscriber |
Inscriber auth, quote, submit, and polling workflows. |
standards_sdk_py.registry_broker |
Full Registry Broker client (search, adapters, registries, credits, verification, chat/encryption, skills, ledger auth). |
standards_sdk_py.mirror |
Mirror node client used by standards and inscriber modules. |
standards_sdk_py.shared |
transport, config, network/operator helpers, and shared typing. |
Usage Examples
Registry Broker
from standards_sdk_py.registry_broker import RegistryBrokerClient
client = RegistryBrokerClient()
result = client.search(query="hcs", limit=5)
print(result.total)
client.close()
HCS-10
from standards_sdk_py.hcs10 import HCS10Client
client = HCS10Client()
message = client.build_text_message(sender="agent-a", recipient="agent-b", text="hello")
print(message.op)
Inscriber
from standards_sdk_py.inscriber import InscriberAuthClient, InscriberClient
auth_client = InscriberAuthClient()
auth = auth_client.authenticate(account_id="0.0.1234", private_key="<private-key>", network="testnet")
client = InscriberClient(api_key=auth.api_key, network="testnet")
quote = client.generate_quote(files=[{"name": "hello.txt", "data": b"hello"}])
print(quote.total_hbar)
Environment Variables
Common:
HEDERA_NETWORKHEDERA_ACCOUNT_IDorHEDERA_OPERATOR_IDHEDERA_PRIVATE_KEYorHEDERA_OPERATOR_KEY
Network-scoped overrides:
TESTNET_HEDERA_ACCOUNT_IDTESTNET_HEDERA_PRIVATE_KEYMAINNET_HEDERA_ACCOUNT_IDMAINNET_HEDERA_PRIVATE_KEY
Registry Broker:
REGISTRY_BROKER_BASE_URLREGISTRY_BROKER_API_KEYREGISTRY_BROKER_LEDGER_API_KEY
Inscriber integration:
RUN_INTEGRATION=1RUN_INSCRIBER_INTEGRATION=1
Tests
Unit and contract tests:
cd standards-sdk-py
.venv/bin/pytest -q
Parity checks:
cd standards-sdk-py
.venv/bin/standards-sdk-py-generate-inventory --repo-root ..
.venv/bin/standards-sdk-py-check-parity
Live testnet inscriber end-to-end:
cd standards-sdk-py
cp ../standards-sdk/.env ./.env
pip install hedera-sdk-py
set -a
source <(grep -E '^[A-Za-z_][A-Za-z0-9_]*=' ./.env)
set +a
export RUN_INTEGRATION=1
export RUN_INSCRIBER_INTEGRATION=1
.venv/bin/pytest -m integration -k inscriber_registry_broker_end_to_end_testnet -vv -rs
Live testnet HCS-2 end-to-end:
cd standards-sdk-py
export RUN_INTEGRATION=1
export RUN_HCS2_INTEGRATION=1
export HEDERA_NETWORK=testnet
export TESTNET_HEDERA_ACCOUNT_ID="<your-testnet-account-id>"
export TESTNET_HEDERA_PRIVATE_KEY="<your-testnet-private-key>"
.venv/bin/pytest -m integration -k hcs2_end_to_end_testnet -vv -rs
Notes:
- Set
HEDERA_NETWORK=testnet(and do not set a conflictingINSCRIBER_HEDERA_NETWORK). - The test uses ledger challenge auth from your testnet credentials to avoid accidentally using a mainnet-scoped API key.
CI/CD and Security
- Python matrix CI (
3.11,3.12,3.13) forruff,black,mypy, unit tests, parity checks, and package validation. - Security workflows for dependency review,
pip-audit, Bandit SARIF upload, CodeQL, and verified TruffleHog secret scanning. - Release workflow for build +
twine check, TestPyPI/PyPI trusted publishing, checksum artifacts, provenance attestations, and GitHub release notes.
Contributing
Open issues or pull requests in the repository:
Security
For disclosure and response policy, see SECURITY.md.
Maintainers
Maintained by Hashgraph Online.
Resources
License
MIT
Project details
Release history Release notifications | RSS feed
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 standards_sdk_py-0.1.0.tar.gz.
File metadata
- Download URL: standards_sdk_py-0.1.0.tar.gz
- Upload date:
- Size: 289.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
40ddca4df27fc4cc93ecece7ca275b12c007cbeebeb29e90bfe650d0f9eb19db
|
|
| MD5 |
b07fc59290b30efed01db72fd89c6586
|
|
| BLAKE2b-256 |
663783980fddda2c6828e37369f40dbef33025bf4ad2a3cf22952250b3efa143
|
Provenance
The following attestation bundles were made for standards_sdk_py-0.1.0.tar.gz:
Publisher:
publish.yml on hashgraph-online/standards-sdk-py
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
standards_sdk_py-0.1.0.tar.gz -
Subject digest:
40ddca4df27fc4cc93ecece7ca275b12c007cbeebeb29e90bfe650d0f9eb19db - Sigstore transparency entry: 1031415817
- Sigstore integration time:
-
Permalink:
hashgraph-online/standards-sdk-py@7afdbcafd6c2c44424b1bb969b204c93afd58cb0 -
Branch / Tag:
refs/heads/main - Owner: https://github.com/hashgraph-online
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@7afdbcafd6c2c44424b1bb969b204c93afd58cb0 -
Trigger Event:
workflow_dispatch
-
Statement type:
File details
Details for the file standards_sdk_py-0.1.0-py3-none-any.whl.
File metadata
- Download URL: standards_sdk_py-0.1.0-py3-none-any.whl
- Upload date:
- Size: 145.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
a4d712beb16d1e74fb17546910f4665be16acdb347d2396a0ae611e3efca2a18
|
|
| MD5 |
ba2ebcd831e8dfd8c548cd7a86aa4986
|
|
| BLAKE2b-256 |
d5f50cc24822a75b4f0b91900df74ef3e94d4d17600a848329237430d65a4e5c
|
Provenance
The following attestation bundles were made for standards_sdk_py-0.1.0-py3-none-any.whl:
Publisher:
publish.yml on hashgraph-online/standards-sdk-py
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
standards_sdk_py-0.1.0-py3-none-any.whl -
Subject digest:
a4d712beb16d1e74fb17546910f4665be16acdb347d2396a0ae611e3efca2a18 - Sigstore transparency entry: 1031415897
- Sigstore integration time:
-
Permalink:
hashgraph-online/standards-sdk-py@7afdbcafd6c2c44424b1bb969b204c93afd58cb0 -
Branch / Tag:
refs/heads/main - Owner: https://github.com/hashgraph-online
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@7afdbcafd6c2c44424b1bb969b204c93afd58cb0 -
Trigger Event:
workflow_dispatch
-
Statement type: