Skip to main content

beacon-client-py

A Python client for interacting with the Ethereum Beacon Chain API

Beacon Chain API Reference

Ethereum Consensus Specification

Ethereum Consensus Specification Annotated

This implementation also leans on types implemented here

Installation

pip install beacon-client-py

Simple Example

from beacon_client.api import BeaconChainAPI

client = BeaconChainAPI("http://localhost:5052")
client.get_headers_from_block_id(block_id="head")

Streaming Example

for event in client.stream_events(head=True, block=True, attestation=True):
    match event.event:
        case "head":
            print(client.parse_head(event.data))
        case "block":
            print(client.parse_block(event.data))
        case "attestation":
            print(client.parse_attestation(event.data))
        case other:
            pass

Development

Run the docs locally

poetry run mkdocs serve

Formatter

poetry run black .

Tests

poetry run pytest -vv

linter

poetry run flake8

note: requires poetry version 1.2.x or higher

Metadata

Release files for beacon-client-py 0.2.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 beacon-client-py 0.2.0
File Size Uploaded Provenance
beacon_client_py-0.2.0.tar.gz 11.6 kB Without provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for beacon-client-py 0.2.0
File Interpreter ABI Platform
beacon_client_py-0.2.0-py3-none-any.whl Python 3 none any Details

Total release size: 24.9 kB

Release files / beacon_client_py-0.2.0.tar.gz

Download URL beacon_client_py-0.2.0.tar.gz
Size 11.6 kB
Tags Source
SHA-256 checksum
How to use checksums
45b2a3c142fb04be3361dc21fa656eb6ae9f93d9578e0077311714215d595f37
BLAKE2b-256 checksum
How to use checksums
d64fff17217b5d0858c0516be6826fcdba670ce7cffb6df1e681e816f6fffae2
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.3.1 CPython/3.11.0 Darwin/21.4.0

Release files / beacon_client_py-0.2.0-py3-none-any.whl

Download URL beacon_client_py-0.2.0-py3-none-any.whl
Size 13.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
e81c1d0a59ae61de7c54348e8003ae781006d80bafbe4f4b66bacef6e0a9f0c2
BLAKE2b-256 checksum
How to use checksums
58f33c8931be6b318f243856ec82c3850c466b2d384514fee054eb13757f4a11
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.3.1 CPython/3.11.0 Darwin/21.4.0

Security for beacon-client-py 0.2.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

Release history Release notifications | RSS feed

This release

0.2.0 This release

2 release files No provenance

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