Python SDK Guide
Installation
Install and configure the Beltic Python SDK for credential validation, signing, and verification.
Coming Soon: The Python SDK is currently in development. The package name and API may change before release. For production workflows, use the CLI or TypeScript SDK.
Requirements
- Python >= 3.10
- pip or pipx for package installation
Installation (Preview)
pip install beltic-sdkpipx install beltic-sdkpoetry add beltic-sdkDependencies
The SDK automatically installs these dependencies:
| Package | Version | Purpose |
|---|---|---|
cryptography | >= 41.0 | Ed25519/ES256 cryptographic operations |
pyjwt[crypto] | >= 2.8 | JWS/JWT encoding and decoding |
jsonschema | >= 4.20 | JSON Schema validation |
pydantic | >= 2.5 | Type validation and serialization |
httpx | >= 0.25 | Async HTTP client for status checks |
Verify Installation
import beltic
print(beltic.__version__)
# Output: 0.1.0Basic Import
from beltic import (
# Validation
validate_developer_credential,
validate_agent_credential,
is_developer_credential,
is_agent_credential,
# Signing
sign_credential,
generate_key_pair,
import_key_from_pem,
export_key_to_pem,
# Verification
verify_credential,
decode_token,
# Trust Chain
verify_agent_trust_chain,
# HTTP Signing (Web Bot Auth)
sign_http_request,
verify_http_signature,
generate_web_bot_auth_setup,
# Errors
ValidationError,
SignatureError,
TrustChainError,
)Development Installation
For contributing or development:
# Clone the repository
git clone https://github.com/belticlabs/fact-python.git
cd fact-python
# Install dev dependencies
pip install -e ".[dev]"
# Run tests
pytest
# Run with coverage
pytest --cov=beltic --cov-report=html
# Type check
mypy src/beltic
# Lint
ruff check src/belticEnvironment Variables
| Variable | Description | Default |
|---|---|---|
BELTIC_LOG_LEVEL | Logging verbosity (DEBUG, INFO, WARNING, ERROR) | WARNING |
BELTIC_CACHE_TTL | Status list cache TTL in seconds | 300 |