Skip to main content

Yet another bencode implementation in Cython

Project description

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

Linux Test Status PyPI License Codecov Coverage

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.1

  • Add support for Python 3.8
  • Drop support for Python 3.4

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

Download files

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

Files for bencoder.pyx, version 2.0.1
Filename, size File type Python version Upload date Hashes
Filename, size bencoder.pyx-2.0.1-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 (91.2 kB) File type Wheel Python version cp27 Upload date Hashes View
Filename, size bencoder.pyx-2.0.1-cp27-cp27m-manylinux1_i686.whl (136.4 kB) File type Wheel Python version cp27 Upload date Hashes View
Filename, size bencoder.pyx-2.0.1-cp27-cp27m-manylinux1_x86_64.whl (178.1 kB) File type Wheel Python version cp27 Upload date Hashes View
Filename, size bencoder.pyx-2.0.1-cp27-cp27m-manylinux2010_i686.whl (136.4 kB) File type Wheel Python version cp27 Upload date Hashes View
Filename, size bencoder.pyx-2.0.1-cp27-cp27m-manylinux2010_x86_64.whl (178.1 kB) File type Wheel Python version cp27 Upload date Hashes View
Filename, size bencoder.pyx-2.0.1-cp27-cp27mu-manylinux1_i686.whl (136.6 kB) File type Wheel Python version cp27 Upload date Hashes View
Filename, size bencoder.pyx-2.0.1-cp27-cp27mu-manylinux1_x86_64.whl (177.8 kB) File type Wheel Python version cp27 Upload date Hashes View
Filename, size bencoder.pyx-2.0.1-cp27-cp27mu-manylinux2010_i686.whl (136.6 kB) File type Wheel Python version cp27 Upload date Hashes View
Filename, size bencoder.pyx-2.0.1-cp27-cp27mu-manylinux2010_x86_64.whl (177.9 kB) File type Wheel Python version cp27 Upload date Hashes View
Filename, size bencoder.pyx-2.0.1-cp27-cp27m-win32.whl (36.7 kB) File type Wheel Python version cp27 Upload date Hashes View
Filename, size bencoder.pyx-2.0.1-cp27-cp27m-win_amd64.whl (42.8 kB) File type Wheel Python version cp27 Upload date Hashes View
Filename, size bencoder.pyx-2.0.1-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 (94.0 kB) File type Wheel Python version cp35 Upload date Hashes View
Filename, size bencoder.pyx-2.0.1-cp35-cp35m-manylinux1_i686.whl (153.6 kB) File type Wheel Python version cp35 Upload date Hashes View
Filename, size bencoder.pyx-2.0.1-cp35-cp35m-manylinux1_x86_64.whl (201.3 kB) File type Wheel Python version cp35 Upload date Hashes View
Filename, size bencoder.pyx-2.0.1-cp35-cp35m-manylinux2010_i686.whl (153.6 kB) File type Wheel Python version cp35 Upload date Hashes View
Filename, size bencoder.pyx-2.0.1-cp35-cp35m-manylinux2010_x86_64.whl (201.3 kB) File type Wheel Python version cp35 Upload date Hashes View
Filename, size bencoder.pyx-2.0.1-cp35-cp35m-win32.whl (36.6 kB) File type Wheel Python version cp35 Upload date Hashes View
Filename, size bencoder.pyx-2.0.1-cp35-cp35m-win_amd64.whl (44.6 kB) File type Wheel Python version cp35 Upload date Hashes View
Filename, size bencoder.pyx-2.0.1-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 (101.6 kB) File type Wheel Python version cp36 Upload date Hashes View
Filename, size bencoder.pyx-2.0.1-cp36-cp36m-manylinux1_i686.whl (159.5 kB) File type Wheel Python version cp36 Upload date Hashes View
Filename, size bencoder.pyx-2.0.1-cp36-cp36m-manylinux1_x86_64.whl (211.2 kB) File type Wheel Python version cp36 Upload date Hashes View
Filename, size bencoder.pyx-2.0.1-cp36-cp36m-manylinux2010_i686.whl (159.5 kB) File type Wheel Python version cp36 Upload date Hashes View
Filename, size bencoder.pyx-2.0.1-cp36-cp36m-manylinux2010_x86_64.whl (211.2 kB) File type Wheel Python version cp36 Upload date Hashes View
Filename, size bencoder.pyx-2.0.1-cp36-cp36m-win32.whl (38.7 kB) File type Wheel Python version cp36 Upload date Hashes View
Filename, size bencoder.pyx-2.0.1-cp36-cp36m-win_amd64.whl (46.9 kB) File type Wheel Python version cp36 Upload date Hashes View
Filename, size bencoder.pyx-2.0.1-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.2 kB) File type Wheel Python version cp37 Upload date Hashes View
Filename, size bencoder.pyx-2.0.1-cp37-cp37m-manylinux1_i686.whl (159.8 kB) File type Wheel Python version cp37 Upload date Hashes View
Filename, size bencoder.pyx-2.0.1-cp37-cp37m-manylinux1_x86_64.whl (209.5 kB) File type Wheel Python version cp37 Upload date Hashes View
Filename, size bencoder.pyx-2.0.1-cp37-cp37m-manylinux2010_i686.whl (159.8 kB) File type Wheel Python version cp37 Upload date Hashes View
Filename, size bencoder.pyx-2.0.1-cp37-cp37m-manylinux2010_x86_64.whl (209.5 kB) File type Wheel Python version cp37 Upload date Hashes View
Filename, size bencoder.pyx-2.0.1-cp37-cp37m-win32.whl (38.7 kB) File type Wheel Python version cp37 Upload date Hashes View
Filename, size bencoder.pyx-2.0.1-cp37-cp37m-win_amd64.whl (46.9 kB) File type Wheel Python version cp37 Upload date Hashes View
Filename, size bencoder.pyx-2.0.1-cp38-cp38-macosx_10_9_x86_64.whl (52.7 kB) File type Wheel Python version cp38 Upload date Hashes View
Filename, size bencoder.pyx-2.0.1-cp38-cp38-manylinux1_i686.whl (185.7 kB) File type Wheel Python version cp38 Upload date Hashes View
Filename, size bencoder.pyx-2.0.1-cp38-cp38-manylinux1_x86_64.whl (247.6 kB) File type Wheel Python version cp38 Upload date Hashes View
Filename, size bencoder.pyx-2.0.1-cp38-cp38-manylinux2010_i686.whl (185.7 kB) File type Wheel Python version cp38 Upload date Hashes View
Filename, size bencoder.pyx-2.0.1-cp38-cp38-manylinux2010_x86_64.whl (247.6 kB) File type Wheel Python version cp38 Upload date Hashes View
Filename, size bencoder.pyx-2.0.1-cp38-cp38-win32.whl (40.1 kB) File type Wheel Python version cp38 Upload date Hashes View
Filename, size bencoder.pyx-2.0.1-cp38-cp38-win_amd64.whl (48.0 kB) File type Wheel Python version cp38 Upload date Hashes View
Filename, size bencoder.pyx-2.0.1.tar.gz (84.2 kB) File type Source Python version None Upload date Hashes View

Supported by

Pingdom Pingdom Monitoring Google Google Object Storage and Download Analytics Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN DigiCert DigiCert EV certificate StatusPage StatusPage Status page