Skip to main content
Python Software Foundation 20th Year Anniversary Fundraiser  Donate today!

Library that encodes/decodes bencode formated strings topython objects.

Project description

bencode-parser build

Bencode parser for python.

For more information about bencode format please refer to wiki_page

INSTALLATION

$ pip install bencode-parser

USAGE

>>> import bencode
>>> bencode.decode('3:abc')
'abc'
>>> bencode.decode('i123e')
123
>>> bencode.decode('li1ei2ei3ee')
[1, 2, 3]
>>> bencode.decode('d1:1i1e1:2i2e1:3i3ee')
{'1': 1, '3': 3, '2': 2}
>>> bencode.encode('abc')
'3:abc'
>>> bencode.encode(123)
'i123e'
>>> bencode.encode([1,2,3])
'li1ei2ei3ee'
>>> bencode.encode({'1': 1, '3': 3, '2': 2})
'd1:1i1e1:3i3e1:2i2ee'

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 bencode-parser, version 1.0.1
Filename, size File type Python version Upload date Hashes
Filename, size bencode-parser-1.0.1.macosx-10.11-x86_64.exe (66.1 kB) File type Windows Installer Python version any Upload date Hashes View
Filename, size bencode-parser-1.0.1.tar.gz (2.7 kB) File type Source Python version None Upload date Hashes View

Supported by

AWS AWS Cloud computing Datadog Datadog Monitoring DigiCert DigiCert EV certificate Facebook / Instagram Facebook / Instagram PSF Sponsor Fastly Fastly CDN Google Google Object Storage and Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Salesforce Salesforce PSF Sponsor Sentry Sentry Error logging StatusPage StatusPage Status page