Simple bencode parser (for Python 2, Python 3 and PyPy)
Project description
Simple bencode parser (for Python 2, Python 3 and PyPy), forked from the bencode package by Thomas Rampelberg.
Usage
Encode:
import bencode
bencode.encode({'title': 'Example'})
# 'd5:title7:Examplee'
bencode.encode(12)
# 'i12e'
Decode:
import bencode
bencode.decode('d5:title7:Examplee')
# {'title': 'Example'}
bencode.decode('i12e')
# 12
API
bencode.bencode(value)
bencode.encode(value)
Encode value into the bencode format.
bencode.bdecode(value)
bencode.decode(value)
Decode bencode formatted string value.
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
bencode.py-1.2.0.tar.gz
(5.5 kB
view hashes)
Built Distribution
Close
Hashes for bencode.py-1.2.0-py2.py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 133e74efe4f9bdab7e4e39bd42204096e268952a90fdf43c97198f0cf5cc5a0a |
|
MD5 | d82505d83bb57ea89342d78ea8da4b1a |
|
BLAKE2b-256 | 9cc914a2fe2ce1acc458d390af16cf53f1b669230581093bba553f4bc855a617 |