Skip to main content

ouro-sdk

Python SDK for the Ouroboros decentralized blockchain network.

Install

pip install ouro-sdk

# For async support (AsyncOuroClient):
pip install ouro-sdk[async]

Quick Start (sync)

from ouro_sdk import OuroClient

client = OuroClient("http://localhost:8000", api_key="your-api-key")

# Check health
print(client.health())  # {'status': 'healthy', ...}

# Get consensus state
c = client.consensus()
print(f"View: {c['view']}, Leader: {c['leader']}")

# Get balance
bal = client.balance("ouro1myaddress")
print(f"Balance: {bal['balance']} nanoouro")

# Submit a transaction
result = client.submit_transaction({
    "sender": "ouro1abc...",
    "recipient": "ouro1xyz...",
    "amount": 1_000_000_000,  # 1 OURO
    "signature": "hex-encoded-signature",
})
print(f"TX: {result['tx_id']}")

# Combined status snapshot
status = client.status()
print(f"Online: {status['online']}, Block: {status.get('metrics', {}).get('block_height')}")

Quick Start (async)

import asyncio
from ouro_sdk import AsyncOuroClient

async def main():
    client = AsyncOuroClient("http://localhost:8000", api_key="your-api-key")
    health = await client.health()
    consensus = await client.consensus()
    status = await client.status()
    print(status)

asyncio.run(main())

API Reference

Method Endpoint Auth Description
health() GET /health No Node liveness
identity() GET /identity No Node ID, role, uptime
consensus() GET /consensus No View, leader, last block
peers() GET /peers No Connected peers
balance(address) GET /ouro/balance/:addr No OURO balance
nonce(address) GET /ouro/nonce/:addr No Account nonce
metrics() GET /metrics/json Yes TPS, sync %, mempool
resources() GET /resources Yes CPU, RAM, disk
mempool() GET /mempool Yes Mempool contents
network_stats() GET /network/stats Yes Network stats
get_transaction(id) GET /tx/:id Yes Transaction lookup
submit_transaction(tx) POST /tx/submit Yes Submit transaction
transfer(from, to, amt) POST /ouro/transfer Yes Transfer OURO
status() combined - Full snapshot

Environment Variables

  • OURO_API_KEY — API key for protected endpoints

License

MIT

Metadata

Release files for ouro-sdk 1.0.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for ouro-sdk 1.0.0
File Size Uploaded
ouro_sdk-1.0.0.tar.gz 4.6 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for ouro-sdk 1.0.0
File Interpreter ABI Platform
ouro_sdk-1.0.0-py3-none-any.whl Python 3 none any Details

Total release size: 9.7 kB

Release files / ouro_sdk-1.0.0.tar.gz

Download URL ouro_sdk-1.0.0.tar.gz
Size 4.6 kB
Tags Source
SHA-256 checksum
How to use checksums
21e33c7da7fa1ac1dd04301b443312d4bba783efba510710276d7470ea859f24
BLAKE2b-256 checksum
How to use checksums
f6ddfe21b787d9ac4cf2dc39320a1b1c4d98df6f4052eed21256af6f5f4caeb7
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.11.14

Release files / ouro_sdk-1.0.0-py3-none-any.whl

Download URL ouro_sdk-1.0.0-py3-none-any.whl
Size 5.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
6e0b54c34f1d01affe3fd11ca84c569b7813b193dc8a92f7f26523ea787da7ac
BLAKE2b-256 checksum
How to use checksums
520bf7bdc2475d9a800cc3850efef898797d5eba6d7ab9516630c8a035adebd3
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.11.14

Release history Release notifications | RSS feed

This release

1.0.0 This release

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page