Skip to main content

Yet another bencode implementation in Cython

Project description

A fast bencode implementation in Cython supports both Python2 & Python3 .

macOS Test Status Windows Test Status Linux Test Status PyPI License Codecov Coverage bencoder-pyx PyPI Downloads

Install

pip install bencoder.pyx

Usage

from bencoder import bencode, bdecode, bdecode2

assert bencode("WWWWWW") == b'6:WWWWWW'
assert bencode(233) == b'i233e'

with open("debian-8.3.0-amd64-netinst.iso.torrent", "rb") as f:
    torrent = bdecode(f.read())
    print(torrent['announce'])

decoded, length = bdecode2(b'6:WWWWWWi233e')
assert decoded == b'WWWWWW'
assert length == 8

ChangeLog

Version 2.0.0

  • Use built-in dict instead of OrderedDict on Python >= 3.7
  • Drop support for Python 3.3
  • Fix bytes parsing when used with python-future #41

Version 1.2.1

  • Drop support for Python 2.6
  • Performance boost for bencode method. #7

Version 1.2.0

  • Add bdecode2 method. #6

Version 1.1.3

  • Performance Improvement
  • Fix package metainfo #3

Version 1.1.2

  • Support encode large int

Version 1.1.0

  • Use OrderedDict instaed of dict
  • Support encoding subclasses of dict

Project details


Download files

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

Filename, size & hash SHA256 hash help File type Python version Upload date
bencoder.pyx-2.0.0-cp27-cp27m-macosx_10_13_x86_64.whl (49.5 kB) Copy SHA256 hash SHA256 Wheel cp27
bencoder.pyx-2.0.0-cp27-cp27m-macosx_10_6_intel.macosx_10_9_intel.macosx_10_9_x86_64.macosx_10_10_intel.macosx_10_10_x86_64.whl (90.8 kB) Copy SHA256 hash SHA256 Wheel cp27
bencoder.pyx-2.0.0-cp27-cp27m-manylinux1_i686.whl (143.2 kB) Copy SHA256 hash SHA256 Wheel cp27
bencoder.pyx-2.0.0-cp27-cp27m-manylinux1_x86_64.whl (157.3 kB) Copy SHA256 hash SHA256 Wheel cp27
bencoder.pyx-2.0.0-cp27-cp27mu-manylinux1_i686.whl (143.3 kB) Copy SHA256 hash SHA256 Wheel cp27
bencoder.pyx-2.0.0-cp27-cp27mu-manylinux1_x86_64.whl (157.1 kB) Copy SHA256 hash SHA256 Wheel cp27
bencoder.pyx-2.0.0-cp27-cp27m-win32.whl (36.6 kB) Copy SHA256 hash SHA256 Wheel cp27
bencoder.pyx-2.0.0-cp27-cp27m-win_amd64.whl (42.7 kB) Copy SHA256 hash SHA256 Wheel cp27
bencoder.pyx-2.0.0-cp34-cp34m-macosx_10_6_intel.macosx_10_9_intel.macosx_10_9_x86_64.macosx_10_10_intel.macosx_10_10_x86_64.whl (97.2 kB) Copy SHA256 hash SHA256 Wheel cp34
bencoder.pyx-2.0.0-cp34-cp34m-manylinux1_i686.whl (159.4 kB) Copy SHA256 hash SHA256 Wheel cp34
bencoder.pyx-2.0.0-cp34-cp34m-manylinux1_x86_64.whl (169.2 kB) Copy SHA256 hash SHA256 Wheel cp34
bencoder.pyx-2.0.0-cp34-cp34m-win32.whl (37.1 kB) Copy SHA256 hash SHA256 Wheel cp34
bencoder.pyx-2.0.0-cp34-cp34m-win_amd64.whl (42.7 kB) Copy SHA256 hash SHA256 Wheel cp34
bencoder.pyx-2.0.0-cp35-cp35m-macosx_10_6_intel.macosx_10_9_intel.macosx_10_9_x86_64.macosx_10_10_intel.macosx_10_10_x86_64.whl (97.3 kB) Copy SHA256 hash SHA256 Wheel cp35
bencoder.pyx-2.0.0-cp35-cp35m-manylinux1_i686.whl (156.3 kB) Copy SHA256 hash SHA256 Wheel cp35
bencoder.pyx-2.0.0-cp35-cp35m-manylinux1_x86_64.whl (166.0 kB) Copy SHA256 hash SHA256 Wheel cp35
bencoder.pyx-2.0.0-cp35-cp35m-win32.whl (36.0 kB) Copy SHA256 hash SHA256 Wheel cp35
bencoder.pyx-2.0.0-cp35-cp35m-win_amd64.whl (43.2 kB) Copy SHA256 hash SHA256 Wheel cp35
bencoder.pyx-2.0.0-cp36-cp36m-macosx_10_6_intel.macosx_10_9_intel.macosx_10_9_x86_64.macosx_10_10_intel.macosx_10_10_x86_64.whl (99.8 kB) Copy SHA256 hash SHA256 Wheel cp36
bencoder.pyx-2.0.0-cp36-cp36m-manylinux1_i686.whl (162.7 kB) Copy SHA256 hash SHA256 Wheel cp36
bencoder.pyx-2.0.0-cp36-cp36m-manylinux1_x86_64.whl (171.7 kB) Copy SHA256 hash SHA256 Wheel cp36
bencoder.pyx-2.0.0-cp36-cp36m-win32.whl (36.7 kB) Copy SHA256 hash SHA256 Wheel cp36
bencoder.pyx-2.0.0-cp36-cp36m-win_amd64.whl (44.0 kB) Copy SHA256 hash SHA256 Wheel cp36
bencoder.pyx-2.0.0-cp37-cp37m-macosx_10_6_intel.macosx_10_9_intel.macosx_10_9_x86_64.macosx_10_10_intel.macosx_10_10_x86_64.whl (99.5 kB) Copy SHA256 hash SHA256 Wheel cp37
bencoder.pyx-2.0.0-cp37-cp37m-manylinux1_i686.whl (161.4 kB) Copy SHA256 hash SHA256 Wheel cp37
bencoder.pyx-2.0.0-cp37-cp37m-manylinux1_x86_64.whl (171.7 kB) Copy SHA256 hash SHA256 Wheel cp37
bencoder.pyx-2.0.0-cp37-cp37m-win32.whl (36.5 kB) Copy SHA256 hash SHA256 Wheel cp37
bencoder.pyx-2.0.0-cp37-cp37m-win_amd64.whl (43.9 kB) Copy SHA256 hash SHA256 Wheel cp37
bencoder.pyx-2.0.0.tar.gz (81.7 kB) Copy SHA256 hash SHA256 Source None

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