Skip to main content

Python RLP serialization/deserialization based on a rapid fast Rust implementation.

Project description

Rusty-RLP

Rapid fast RLP serialization / deserialization for Python.

As the name suggest, rusty-rlp is written in Rust and based on the battle-tested, MIT-licensed rlp implementation that is also used by OpenEthereum.

Usage

from rusty_rlp import decode_raw, encode_raw

encoded = encode_raw(b'some_string')
decoded = decode_raw(encoded)

Running the tests

The library exposes a pure Python API and all tests are implemented in python_tests.py

Run the tests:

make test

Note: There do exists some tests implemented in Rust that can be run with cargo tests but those do not test this library but the underlying rlp library instead. They exist merely to prove some assumptions about the underlying library.

Benchmarks

We provide some benchmarks against pyrlp.

Encoding (msec/loop) Decoding (msec/loop)
PyRLP 0.016 0.014
rusty-rlp 0.00173 (~9x) 0.00595 (~2.35x)

Running the benchmarks

make benchmark

Project details


Download files

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

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distributions

rusty_rlp-0.4.0-cp312-none-win_amd64.whl (110.8 kB view hashes)

Uploaded CPython 3.12 Windows x86-64

rusty_rlp-0.4.0-cp312-cp312-manylinux_2_34_x86_64.whl (236.6 kB view hashes)

Uploaded CPython 3.12 manylinux: glibc 2.34+ x86-64

rusty_rlp-0.4.0-cp312-cp312-macosx_10_12_x86_64.whl (178.8 kB view hashes)

Uploaded CPython 3.12 macOS 10.12+ x86-64

rusty_rlp-0.4.0-cp311-none-win_amd64.whl (110.8 kB view hashes)

Uploaded CPython 3.11 Windows x86-64

rusty_rlp-0.4.0-cp311-cp311-manylinux_2_34_x86_64.whl (236.6 kB view hashes)

Uploaded CPython 3.11 manylinux: glibc 2.34+ x86-64

rusty_rlp-0.4.0-cp311-cp311-macosx_10_12_x86_64.whl (178.8 kB view hashes)

Uploaded CPython 3.11 macOS 10.12+ x86-64

rusty_rlp-0.4.0-cp310-none-win_amd64.whl (110.8 kB view hashes)

Uploaded CPython 3.10 Windows x86-64

rusty_rlp-0.4.0-cp310-cp310-manylinux_2_34_x86_64.whl (236.6 kB view hashes)

Uploaded CPython 3.10 manylinux: glibc 2.34+ x86-64

rusty_rlp-0.4.0-cp310-cp310-macosx_10_12_x86_64.whl (178.8 kB view hashes)

Uploaded CPython 3.10 macOS 10.12+ x86-64

rusty_rlp-0.4.0-cp39-none-win_amd64.whl (110.8 kB view hashes)

Uploaded CPython 3.9 Windows x86-64

rusty_rlp-0.4.0-cp39-cp39-manylinux_2_34_x86_64.whl (236.6 kB view hashes)

Uploaded CPython 3.9 manylinux: glibc 2.34+ x86-64

rusty_rlp-0.4.0-cp39-cp39-macosx_10_12_x86_64.whl (178.8 kB view hashes)

Uploaded CPython 3.9 macOS 10.12+ x86-64

rusty_rlp-0.4.0-cp38-none-win_amd64.whl (110.8 kB view hashes)

Uploaded CPython 3.8 Windows x86-64

rusty_rlp-0.4.0-cp38-cp38-manylinux_2_34_x86_64.whl (236.6 kB view hashes)

Uploaded CPython 3.8 manylinux: glibc 2.34+ x86-64

rusty_rlp-0.4.0-cp38-cp38-macosx_10_12_x86_64.whl (178.8 kB view hashes)

Uploaded CPython 3.8 macOS 10.12+ x86-64

Supported by

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