Skip to main content

Fetch EVM benchmark suites from the Benchmarkoor API and produce clean tabular outputs.

Project description

benchmarkoor-fetch

PyPI version Python versions CI Docs License: CC0-1.0

Fetch EVM benchmark suites from the Benchmarkoor API and write clean tabular outputs (runtimes.csv, opcounts.json, bench_data.parquet, trace.parquet, meta.json).

Data-ingestion only — no modelling, no gas analysis. The artifact bundle feeds evm-gasfit, which owns the gas-cost estimation step.

Install

pip install benchmarkoor-fetch

Requires Python ≥ 3.11.

Auth

The Benchmarkoor API requires a bearer token. Set it once:

export BENCHMARKOOR_TOKEN=...

You can also pass it per-call: --token … on the CLI, or BenchmarkoorClient(token=…) in Python. It is never read from the YAML config.

CLI quickstart

Write a fetch.yaml:

query:
  network: jochemnet
  fork: amsterdam
  test_type: compute
  start_date: "2026-05-18"
  end_date: "2026-05-20"

fork is always required. network and test_type are used to discover the latest matching suite_hash; if you already know the hashes, list them under suites: instead and omit network / test_type:

query:
  fork: amsterdam
  suites:
    - 0xaaa111
    - 0xbbb222

Then run:

benchmarkoor-fetch run --config fetch.yaml --out ./data

If --out is omitted, outputs land in ./{earliest_run_ts}_{latest_run_ts}/ using the actual run timestamps of the data fetched (not the configured window).

Any query.* or output.* field can be overridden on the command line:

benchmarkoor-fetch run --config fetch.yaml \
    --fork osaka --start-date 2026-05-01 --end-date 2026-05-08 \
    --out ./data

Resolve the latest suite hash for a (network, fork, test_type) tuple without fetching the bundle:

benchmarkoor-fetch suites --network jochemnet --fork amsterdam --test-type compute

Exit codes: 0 success · 1 config/input error · 2 HTTP error · 3 empty result.

Verbosity: by default the CLI prints high-level milestones (suite resolution, runs listed, trace fetch) and a tqdm progress bar while fetching test stats. Pass --verbose to also emit per-event detail (cache hit/miss, per-run fetch lines), or --quiet to suppress milestones and progress; only warnings and errors are shown. --verbose and --quiet are mutually exclusive.

Python / notebook quickstart

Style A — config-driven, full pipeline:

from benchmarkoor_fetch import BenchmarkoorClient, FetchConfig

config = FetchConfig.from_yaml("fetch.yaml")
client = BenchmarkoorClient()           # picks up BENCHMARKOOR_TOKEN
result = client.run(config)             # returns FetchResult
result.bench_df                         # merged DataFrame
result.trace_df                         # per-fixture opcode counts
result.write("./data")                  # writes the artifact bundle

Style B — granular, for notebooks that want to inspect mid-pipeline (see examples/quickstart.ipynb for the runnable version):

client = BenchmarkoorClient()
suite_hash = client.resolve_suite(
    network="jochemnet", fork="amsterdam", test_type="compute"
)
runs = client.list_runs(suite_hash, start_date="2026-05-18", end_date="2026-05-20")
raw_df = client.fetch_test_stats(runs, suite_hash=suite_hash)
trace = client.fetch_trace(suite_hash)
bench_df, trace_df = client.parse(raw_df, trace, fork="amsterdam")

Outputs

Written to --out:

File Contents
runtimes.csv client_name, fixture_name, test_runtime_ms — one row per benchmark run.
opcounts.json {fixture_name: {opcount, OPCODE: count, …}}.
bench_data.parquet The full merged frame: run_id, client_name, test_title, test_file, test_name, test_opcode, test_params, test_runtime_ms, ingestion_timestamp, block_limit_million, opcount.
trace.parquet Per-fixture trace keyed by test_title.
meta.json Resolved suite hashes, query block, fetched-at timestamp, package version, row counts.

Runtimes are kept in milliseconds (test_runtime_ms) on the wire and on disk — converting to seconds is left to the consumer.

Feeding evm-gasfit

The two-step workflow is:

# 1. Ingest with benchmarkoor-fetch
benchmarkoor-fetch run --config fetch.yaml --out ./data

# 2. Estimate gas costs with evm-gasfit, pointing at the same folder
evm-gasfit fit --inputs ./data ...

evm-gasfit consumes runtimes.csv + opcounts.json from the output directory; bench_data.parquet and trace.parquet are there for direct DataFrame analysis.

Caching

Responses are cached on disk under ./.cache/benchmarkoor-fetch/ (relative to the current working directory) by default. The cache is content-addressed and never expires — keys are built so that a hit guarantees byte-identical bytes. Suite discovery is intentionally not cached (it must always reflect the latest suite).

Bypass per-run with --no-cache, relocate with --cache-dir <path>, or disable in YAML via cache.enabled: false.

Development

pip install -e ".[dev]"
pytest
ruff check src tests
ruff format src tests

License

See LICENSE.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

benchmarkoor_fetch-0.1.1.tar.gz (48.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

benchmarkoor_fetch-0.1.1-py3-none-any.whl (37.5 kB view details)

Uploaded Python 3

File details

Details for the file benchmarkoor_fetch-0.1.1.tar.gz.

File metadata

  • Download URL: benchmarkoor_fetch-0.1.1.tar.gz
  • Upload date:
  • Size: 48.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for benchmarkoor_fetch-0.1.1.tar.gz
Algorithm Hash digest
SHA256 413d288e83b9a1be496b054fcc50afad0ee1882cb9bc8e6d5d354bd043df62a3
MD5 dae40cfdfaff54191391929fe9ee5c5f
BLAKE2b-256 12662d03d5018cb1abcaab9df72f31629350f8b6a017be64f98df7c9c30a7e65

See more details on using hashes here.

Provenance

The following attestation bundles were made for benchmarkoor_fetch-0.1.1.tar.gz:

Publisher: release.yml on misilva73/benchmarkoor-fetch

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file benchmarkoor_fetch-0.1.1-py3-none-any.whl.

File metadata

File hashes

Hashes for benchmarkoor_fetch-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 cc825d9cb207ee30a00c31a85389899e8af792670140a52cc6702c36d2ddac95
MD5 2648699aae64b5c618ef4cd0b49b0ec5
BLAKE2b-256 1405fa312fa99e94947e4bbb9cff3bf8865718a9b5944016843cf374947bcea8

See more details on using hashes here.

Provenance

The following attestation bundles were made for benchmarkoor_fetch-0.1.1-py3-none-any.whl:

Publisher: release.yml on misilva73/benchmarkoor-fetch

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page