Skip to main content

Bencodex reader/writer for Python

Project description

Build Status

This package implements Bencodex serializtion format which extends Bencoding.


This package’s API follows the tradition of Python’s pickle and json modules:

  • bencodex.dump(obj: bencodex.BValue, fileobj: typing.BinaryIO) -> None
  • bencodex.dumps(obj: bencodex.BValue) -> bytes
  • bencodex.load(fileobj: typing.BinaryIO) -> bencodex.BValue
  • bencodex.loads(encoded: bytes) -> bencodex.BValue


>>> from bencodex import dumps, loads
>>> dumps({'name': 'Jane Doe', 'age': 30, 'nationality': ['BR', 'US']})
b'du3:agei30eu4:nameu8:Jane Doeu11:nationalitylu2:BRu2:USee'
>>> loads(_)
{'age': 30, 'name': 'Jane Doe', 'nationality': ['BR', 'US']}


Distributed under GPLv3 or later.

Project details

Download files

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

Files for bencodex, version 1.0.0
Filename, size File type Python version Upload date Hashes
Filename, size bencodex-1.0.0-py3-none-any.whl (16.0 kB) File type Wheel Python version 3.7 Upload date Hashes View hashes
Filename, size bencodex-1.0.0.tar.gz (8.6 kB) File type Source Python version None Upload date Hashes View hashes

Supported by

Elastic Elastic Search Pingdom Pingdom Monitoring Google Google BigQuery Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN SignalFx SignalFx Supporter DigiCert DigiCert EV certificate StatusPage StatusPage Status page