Skip to main content

Bencodex reader/writer for Python

Project description

Build Status

This package implements Bencodex serialization format which extends Bencoding.

Usage

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

Examples

>>> 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']}

License

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.

Source Distribution

bencodex-1.0.1.tar.gz (8.7 kB view details)

Uploaded Source

Built Distribution

bencodex-1.0.1-py3-none-any.whl (16.1 kB view details)

Uploaded Python 3

File details

Details for the file bencodex-1.0.1.tar.gz.

File metadata

  • Download URL: bencodex-1.0.1.tar.gz
  • Upload date:
  • Size: 8.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: Python-urllib/3.7

File hashes

Hashes for bencodex-1.0.1.tar.gz
Algorithm Hash digest
SHA256 a15c9f1cd3ca6c0b012bd03c1c936fadfa4c24ce476a6582e0ef91298d045547
MD5 8dc4c973bfbfe791d81b8c69f1bed833
BLAKE2b-256 484de6d8eccbb4aeedc69f7c2ea07f2debf62a0d06837f4dc6efe12f69192722

See more details on using hashes here.

File details

Details for the file bencodex-1.0.1-py3-none-any.whl.

File metadata

  • Download URL: bencodex-1.0.1-py3-none-any.whl
  • Upload date:
  • Size: 16.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: Python-urllib/3.7

File hashes

Hashes for bencodex-1.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 8d16764f1621eaaf06258abc167bcecd2f762be7e1e4958f7e715784ae3da59b
MD5 583ce5aabbe2285b9da0ad7ed88ebf71
BLAKE2b-256 885cc72be7960a95129d3f2d8c4f0f039f9acd528179c986a8b65fc6f150e6e7

See more details on using hashes here.

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