Python client for OpenChainBench live crypto infrastructure benchmarks
Project description
openchainbench
Official Python client for OpenChainBench, the live, reproducible benchmark suite for crypto infrastructure (RPC latency, bridge fees, perp venues, oracle deviation, and more).
The data served by openchainbench.com is published under CC-BY-4.0. Attribute with a link back to the benchmark page (pageUrl on every payload).
Install
pip install openchainbench
Requires Python 3.10+.
Quick start
from openchainbench import OpenChainBench
with OpenChainBench() as ocb:
for bench in ocb.list_benchmarks():
if bench.leader:
print(f"{bench.title}: {bench.leader.name} -> {bench.value}")
Fetch one benchmark
from openchainbench import OpenChainBench
with OpenChainBench() as ocb:
bench = ocb.get_benchmark("bridge-fee")
print(bench.headline)
for row in bench.rankings[:3]:
print(row.slug, row.ms.p50, row.success_rate)
Fetch a time series
from openchainbench import OpenChainBench
with OpenChainBench() as ocb:
series = ocb.get_series("bridge-fee", range="24h")
for provider in series.providers:
print(provider.name, provider.values[-1])
Filter by chain or region
bench = ocb.get_benchmark("network-fees", chain="ethereum")
series = ocb.get_series("network-fees", range="7d", chain="ethereum", region="eu-west")
Error handling
The client maps HTTP responses to a typed exception hierarchy so callers can react to intent rather than status codes.
from openchainbench import (
OpenChainBench,
NotFoundError,
RateLimitError,
APIUnavailableError,
)
with OpenChainBench() as ocb:
try:
ocb.get_benchmark("not-a-real-slug")
except NotFoundError:
...
except RateLimitError as exc:
print(f"retry after {exc.retry_after_sec}s")
except APIUnavailableError:
# cold cache or Prom blackout, retry later
...
API reference
| Method | Endpoint | Returns |
|---|---|---|
list_benchmarks() |
GET /api/citable |
list[BenchmarkSummary] |
fetch_citable_index() |
GET /api/citable |
CitableIndex |
get_benchmark(slug, *, chain=None, region=None) |
GET /api/stat/<slug> |
Benchmark |
get_series(slug, *, range="24h", chain=None, region=None, providers=None) |
GET /api/series/<slug> |
Series |
All models are immutable dataclasses (frozen=True).
Rate limits
The public API allows 60 requests per minute per IP. The client surfaces
HTTP 429 as a RateLimitError with a retry_after_sec attribute.
Citation
If you use the data in a paper, post, or product, please link the
benchmark page. The license is CC-BY-4.0. Every payload includes a
ready-to-paste quote field that already contains the attribution.
Links
- Site: https://openchainbench.com
- Docs: https://openchainbench.com/docs
- Repository: https://github.com/ChainBench/OpenChainBench
- Issues: https://github.com/ChainBench/OpenChainBench/issues
License
MIT. The data fetched from the API stays under CC-BY-4.0; this client license only covers the code.
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 openchainbench-0.1.0.tar.gz.
File metadata
- Download URL: openchainbench-0.1.0.tar.gz
- Upload date:
- Size: 11.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
d855442988f907f845f7568f2b378909089bf9061819cb94898ae88cb0a38ff1
|
|
| MD5 |
8bd36c877404d0b12d2da64fe514d61a
|
|
| BLAKE2b-256 |
590fe6360946c1130526a6c0f67300a7eb29b374daef77a77b1d27ca44493f1d
|
Provenance
The following attestation bundles were made for openchainbench-0.1.0.tar.gz:
Publisher:
pypi-publish.yml on ChainBench/OpenChainBench
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
openchainbench-0.1.0.tar.gz -
Subject digest:
d855442988f907f845f7568f2b378909089bf9061819cb94898ae88cb0a38ff1 - Sigstore transparency entry: 1968061900
- Sigstore integration time:
-
Permalink:
ChainBench/OpenChainBench@3d469f3469f9309b7a4983c5397336bc305be5ae -
Branch / Tag:
refs/tags/python-v0.1.0 - Owner: https://github.com/ChainBench
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
pypi-publish.yml@3d469f3469f9309b7a4983c5397336bc305be5ae -
Trigger Event:
push
-
Statement type:
File details
Details for the file openchainbench-0.1.0-py3-none-any.whl.
File metadata
- Download URL: openchainbench-0.1.0-py3-none-any.whl
- Upload date:
- Size: 9.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
abfe03723d9701b842fcd09851a889169d7f8070bfb757a64a48152a47c094ee
|
|
| MD5 |
8d927620b137d37fac950b210fd42fce
|
|
| BLAKE2b-256 |
cd17c94c18a25279f7cecf1b81f6072f610c09fc2f67206b90e761fa6ced4d28
|
Provenance
The following attestation bundles were made for openchainbench-0.1.0-py3-none-any.whl:
Publisher:
pypi-publish.yml on ChainBench/OpenChainBench
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
openchainbench-0.1.0-py3-none-any.whl -
Subject digest:
abfe03723d9701b842fcd09851a889169d7f8070bfb757a64a48152a47c094ee - Sigstore transparency entry: 1968061959
- Sigstore integration time:
-
Permalink:
ChainBench/OpenChainBench@3d469f3469f9309b7a4983c5397336bc305be5ae -
Branch / Tag:
refs/tags/python-v0.1.0 - Owner: https://github.com/ChainBench
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
pypi-publish.yml@3d469f3469f9309b7a4983c5397336bc305be5ae -
Trigger Event:
push
-
Statement type: