Metadata-Version: 2.4
Name: ethereum-rlp
Version: 0.1.7
Summary: Recursive-length prefix (RLP) serialization as used by the Ethereum Specification.
Home-page: https://github.com/ethereum/ethereum-rlp
Classifier: License :: CC0 1.0 Universal (CC0 1.0) Public Domain Dedication
Requires-Python: >=3.11
Description-Content-Type: text/markdown
License-File: LICENSE.md
Requires-Dist: ethereum-types<0.5,>=0.2.1
Requires-Dist: typing-extensions>=4.12.2
Provides-Extra: test
Requires-Dist: pytest<9,>=8.2.2; extra == "test"
Requires-Dist: pytest-cov<6,>=5; extra == "test"
Requires-Dist: pytest-xdist<4,>=3.6.1; extra == "test"
Provides-Extra: lint
Requires-Dist: types-setuptools<71,>=70.3.0.1; extra == "lint"
Requires-Dist: isort==5.13.2; extra == "lint"
Requires-Dist: mypy==1.10.1; extra == "lint"
Requires-Dist: black==24.4.2; extra == "lint"
Requires-Dist: flake8==7.1.0; extra == "lint"
Requires-Dist: flake8-bugbear==24.4.26; extra == "lint"
Requires-Dist: flake8-docstrings==1.7.0; extra == "lint"
Provides-Extra: doc
Requires-Dist: docc<0.3.0,>=0.2.0; extra == "doc"
Dynamic: license-file

Ethereum RLP
============

Recursive-length prefix (RLP) serialization as used by the [Ethereum Execution Layer Specification (EELS)][eels].

[eels]: https://github.com/ethereum/execution-specs

## Usage

Here's a very basic example demonstrating how to define a schema, then encode/decode it:

```python
from dataclasses import dataclass
from ethereum_rlp import encode, decode_to
from ethereum_types.numeric import Uint
from typing import List

@dataclass
class Stuff:
    toggle: bool
    number: Uint
    sequence: List["Stuff"]

encoded = encode(Stuff(toggle=True, number=Uint(3), sequence=[]))
decoded = decode_to(Stuff, encoded)
assert decoded.number == Uint(3)
```

See the `tests/` directory for more examples.
