semvec/pypi-packages huggingface dataset:
beacon-client-py 0.2.0
A Python Client for interacting with the Ethereum Beacon Chain API
Requires Python: >=3.10,<4.0

# beacon-client-py
A Python client for interacting with the Ethereum Beacon Chain API

[Beacon Chain API Reference](https://ethereum.github.io/beacon-APIs)

[Ethereum Consensus Specification](https://github.com/ethereum/consensus-specs/blob/dev/specs/phase0/beacon-chain.md)

[Ethereum Consensus Specification Annotated](https://eth2book.info/altair/part3)

This implementation also leans on types implemented [here](https://github.com/ralexstokes/beacon-api-client)

## Installation
```bash
pip install beacon-client-py
```

## Simple Example

```python
from beacon_client.api import BeaconChainAPI

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

## Streaming Example
```python
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 

```bash
poetry run mkdocs serve
```

Formatter
```bash
poetry run black .
```

Tests
```bash
poetry run pytest -vv
```

linter
```bash
poetry run flake8
```

_note_: requires poetry version 1.2.x or higher
python-lorem-picsum 0.0.1
Python wrapper for lorem-picsum online service.
Requires Python: >=3.3

# Lorem-picsum

## Developper section

### Configure environment

Initial setup based on Anaconda3 but may work by using a virtual environment.


``` bash
conda create -n picsum python=3.10
conda activate picsum
pip install -r requirements.txt
pip install -e .
```

### Unit tests

1) Load test data

Only required once.

``` bash
./tests/load_data.sh
```

2) Run

``` bash
python -m unittest tests
```