Skip to main content

Fast EVM log decoding library

Project description

evm-log-father

evm-log-father

Fast EVM log decoding library with Python bindings.

Performance

Benchmark Results

400-500k logs/second with parallel decoding on large parquet files.

Features

  • Decode Ethereum event logs using alloy's dynamic ABI
  • Read logs from parquet files (multiple schema formats supported)
  • Batch decode raw logs from any source (RPC, databases, etc.)
  • Parallel decoding with rayon
  • Python bindings via PyO3
  • CLI for quick testing

Installation

Python (from PyPI)

pip install evm-log-father

Python (from source)

pip install maturin
maturin develop --features python

Rust

[dependencies]
evm-log-father = "0.1"

Usage

Python

from evm_log_father import EventSchema, decode_parquet, decode_logs

# Create schema from event signature
schema = EventSchema("Transfer(address indexed from, address indexed to, uint256 value)")

# Decode logs from parquet file
logs = decode_parquet("transfers.parquet", schema, parallel=True)

for log in logs:
    print(f"Block {log['block_number']}: {log['params']['from']} -> {log['params']['to']}")

# Batch decode raw logs (e.g. from RPC or other sources)
raw_logs = [
    {
        "topics": ["0xddf252ad...", "0x000...sender", "0x000...receiver"],
        "data": "0x00000000000000000000000000000000000000000000000000000000000f4240",
        "block_number": 12345678,
        "tx_hash": "0xabc...",
        "log_index": 0,
        "contract": "0xdac17f958d2ee523a2206206994597c13d831ec7",
    }
]
decoded = decode_logs(schema, raw_logs, parallel=True)

Rust

use evm_log_father::{EventSchema, decode_parquet_parallel};

let schema = EventSchema::new("Transfer(address indexed from, address indexed to, uint256 value)")?;
let logs = decode_parquet_parallel("transfers.parquet", &schema)?;

for log in logs {
    println!("Block {}: {:?}", log.block_number, log.params);
}

CLI

# Decode logs and output JSON
evm-log-father decode \
  --parquet transfers.parquet \
  --event "Transfer(address indexed from, address indexed to, uint256 value)" \
  --output decoded.json \
  --parallel \
  --timing

# Show event info
evm-log-father info --event "Transfer(address indexed from, address indexed to, uint256 value)"

Parquet Schema Support

Flexible schema support for various parquet formats:

Column Names

Both snake_case and camelCase supported:

  • block_number / blockNumber
  • transaction_hash / transactionHash / tx_hash
  • log_index / logIndex
  • contract / address

Topics Format

  • Individual columns: topic0, topic1, topic2, topic3
  • List column: topics (Spark format)

Data Types

  • block_number: u64 or i64
  • log_index: u32, u64, or i64
  • data: binary or hex string

Benchmarking

python examples/benchmark.py transfers.parquet

License

MIT

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

evm_log_father-0.2.0.tar.gz (1.6 MB view details)

Uploaded Source

Built Distributions

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

evm_log_father-0.2.0-cp312-cp312-win_amd64.whl (3.3 MB view details)

Uploaded CPython 3.12Windows x86-64

evm_log_father-0.2.0-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (3.9 MB view details)

Uploaded CPython 3.12manylinux: glibc 2.17+ x86-64

evm_log_father-0.2.0-cp312-cp312-macosx_11_0_arm64.whl (3.3 MB view details)

Uploaded CPython 3.12macOS 11.0+ ARM64

evm_log_father-0.2.0-cp312-cp312-macosx_10_12_x86_64.whl (3.6 MB view details)

Uploaded CPython 3.12macOS 10.12+ x86-64

File details

Details for the file evm_log_father-0.2.0.tar.gz.

File metadata

  • Download URL: evm_log_father-0.2.0.tar.gz
  • Upload date:
  • Size: 1.6 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: maturin/1.11.5

File hashes

Hashes for evm_log_father-0.2.0.tar.gz
Algorithm Hash digest
SHA256 72551f28e94c712ff29add08b6126905c9defa4f9566e616e0c66a9969913e16
MD5 f8bcb097a9a2384c13d0396462e4e7e4
BLAKE2b-256 853327906aea90282d94f893693d4a91aa1941900c11d35c387e656b82b58be5

See more details on using hashes here.

File details

Details for the file evm_log_father-0.2.0-cp312-cp312-win_amd64.whl.

File metadata

File hashes

Hashes for evm_log_father-0.2.0-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 e114ed1a1d50ab017acf8356296dee3bdee48f56ea5ed3cc37af341185c17672
MD5 d2f598d89d540f92b6eaf1d0cb1b4429
BLAKE2b-256 b07092c2fccd32a879c1f5e62a0c85dced10c60064519674f22cdbd2f6be5f45

See more details on using hashes here.

File details

Details for the file evm_log_father-0.2.0-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for evm_log_father-0.2.0-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 bb6594e4a0625ede4b93f02a508ffae459d4faa2c76f98fab3acbc66376313bd
MD5 7c22d1242c91507469b64b598f27204c
BLAKE2b-256 ce7dedfedcdc1a9649b8705ca4e2bc56e73b9d17937c12583e07533568235ef8

See more details on using hashes here.

File details

Details for the file evm_log_father-0.2.0-cp312-cp312-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for evm_log_father-0.2.0-cp312-cp312-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 ad16b902db45877d8d4b76a5e7e305e4cbaad39df304d3c725ff6dc57cebb143
MD5 2c95c471679732022530b97ca4a16f15
BLAKE2b-256 9292d7834136eb0eb481cde21cd753b66d3ea49736bd2749aa1e1a0d6e1e6201

See more details on using hashes here.

File details

Details for the file evm_log_father-0.2.0-cp312-cp312-macosx_10_12_x86_64.whl.

File metadata

File hashes

Hashes for evm_log_father-0.2.0-cp312-cp312-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 120477eae33d102bcdf32adc26b463bfec88f52792be4dcafbba486677bbdecf
MD5 91cf084f22ce875e7950d3770dc57f70
BLAKE2b-256 dfbcc1d3be4cbab85fc2eff539b7d84a1192614fe4c0ccf79cfe2a9deb7251c2

See more details on using hashes here.

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