Skip to main content

Renity Protocol Buffer

PyPI Status Python Version License

Documentation Status Tests Codecov

pre-commit Black

Renity is an Open Source Python Object-Binary-Mapper(OBM) Binary Protocol Buffer that provides a way to rapidly define the de/serialization format of packets.

Installation 🔧

You can install Renity via pip from PyPI:

$ pip install renity

✨ Features

  • Improved throughput & reduced latency by reducing the data size transferred over the network
  • Serialization & Deserialization
  • Efficiency Compared to other formats like JSON & XML
  • Strict schema definition(s) for messages
  • Backward Compatible Schema(s)
  • Development effort is reduced with an easy-to-use interface that creates a Serialization Format from an Object Model.

Example 📏

import requests
from rentity import Message, StringField, IntField

# Define Message Schema
>>> class CustomMessage(Message):
...     hello=StringField(default="World")
...     sentence=ListField(StringField(required=True),IntField())
...

# Create a message
>>> example = CustomMessage({"sentence": ["Number of Apples:", 2]})

# Deserialized Message
>>> example.message
{"type": "CustomMessage", "hello": "World", "sentence": ["Number of Apples:", 2]}

# Serialized Message
>>> example.bytes
b"\x97\x88\rCustomMessage\x03\x92\x88\x05World\x8a\x88\x16\x92\x88\x11Number of Apples:\x88\x02"

# Post Serialized Message
>>> requests.post(url='http://example.com/message',
...                data=example.bytes,
...                headers={'Content-Type': 'application/octet-stream'})
...

# GET Example
>>> res = requests.get('http://example.com/message')
>>> response = CustomMessage(res.content)
>>> response.message
{"type": "CustomMessage", "hello": "World", "sentence": ["Number of Apples:", 2]}

🔬 Tests

It is recommended to set up Python 3.8, 3.9, 3.10 using pyenv.

    # Install Poetry
    $ pip install poetry

    # Install Nox
    $ pip install nox

    # Install nox-poetry
    $ pip install nox-poetry

    # Install dependencies
    $ poetry install

    # Run Nox tests sessions
    $ nox --session

Contributing 🧠

We welcome contributions of all types: from fixing typos to bug fixes to new features. For further questions about any of the below, please refer to the Contributor Guide. Reach out! We encourage all contributors to reach out for work reference's. We're here to help and are available for any inquiries regarding our contributors!

🎓 Interactive Practice

Keep practicing so that your coding skills don't get rusty.

  • Udemy
  • FreeCodeCamp
  • LeetCode

Usage

Please see the Command-line Reference for details.

License

Distributed under the terms of the Apache license, Renity is free and open source software.

Issues

If you encounter any problems, please file an issue along with a detailed description.

Credits

GooglePythonGodot EngineDjangoSteam

Metadata

Release files for renity 2.1.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 renity 2.1.0
File Size Uploaded
renity-2.1.0.tar.gz 23.2 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for renity 2.1.0
File Interpreter ABI Platform
renity-2.1.0-py3-none-any.whl Python 3 none any Details

Total release size: 51.5 kB

Release files / renity-2.1.0.tar.gz

Download URL renity-2.1.0.tar.gz
Size 23.2 kB
Tags Source
SHA-256 checksum
How to use checksums
75bf0a557ed1789f1d0dd1856b5a323f64229c6c186ee607ad76a6adc5de22d4
BLAKE2b-256 checksum
How to use checksums
284d71fc463fc627d817556ac2b6f32269a3cfbfe63db40b50128dfd4536db6a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.1.1 CPython/3.9.19

Release files / renity-2.1.0-py3-none-any.whl

Download URL renity-2.1.0-py3-none-any.whl
Size 28.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
26981627b5c361e68003ef12257b89a48f8a54f9d2e80731caac9fb7a45352f0
BLAKE2b-256 checksum
How to use checksums
913c4b0b85a1e02331fc0061c3d9e0cd0d0f581e85924ea1e0e5786afe6e2975
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.1.1 CPython/3.9.19

Release history Release notifications | RSS feed

This release

2.1.0 This release

2 release files

2.0.9

2 release files

2.0.8

2 release files

2.0.7

2 release files

2.0.6

2 release files

2.0.5

2 release files

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