Bencodex reader/writer for Python
Project description
This package implements Bencodex serializtion 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
Release history Release notifications | RSS feed
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.0.tar.gz
(8.6 kB
view details)
Built Distribution
bencodex-1.0.0-py3-none-any.whl
(16.0 kB
view details)
File details
Details for the file bencodex-1.0.0.tar.gz
.
File metadata
- Download URL: bencodex-1.0.0.tar.gz
- Upload date:
- Size: 8.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: Python-urllib/3.7
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 9e4d1a170b5f8c4fca92a8190bd945ab2292f962d4321a6c320124998e0e17b7 |
|
MD5 | 24235833cbccb1514f6715b4ef20cc38 |
|
BLAKE2b-256 | f8b5e8fe54f2b3c0273b5b80ae22736e87a3e2b06efe47157db7b611801b6401 |
File details
Details for the file bencodex-1.0.0-py3-none-any.whl
.
File metadata
- Download URL: bencodex-1.0.0-py3-none-any.whl
- Upload date:
- Size: 16.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: Python-urllib/3.7
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | e5c407cc40ce7ccbc2594d52937861fdcb773a674053e144c778e76807b458e8 |
|
MD5 | 9567ac70dc8dbfe6835fc85ecf55fa9f |
|
BLAKE2b-256 | 6a1e80fe8d1ef0d83fc2df2bc843ab3fa6c96835160bca28d06875ea11dc4354 |