Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

itdaniher/bencoder.pyx

Open more actions menu
 
 

Repository files navigation

Bencoder.pyx

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

https://img.shields.io/travis/whtsky/bencoder.pyx/master.svg?maxAge=3600&label=macOS https://img.shields.io/appveyor/ci/whtsky/bencoder-pyx/master.svg?maxAge=3600&label=Windows https://img.shields.io/travis/whtsky/bencoder.pyx/master.svg?maxAge=3600&label=wheels

Install

pip install bencoder.pyx

Usage

from bencoder import bencode, bdecode

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'])

ChangeLog

Version 1.1.3

  • Performance Improvement
  • Fix package metainfo ` #3 <whtsky#3>`_

Version 1.1.2

  • Support encode large int

Version 1.1.0

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

About

A fast bencode implementation in Cython

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Python 90.2%
  • Shell 9.8%
Morty Proxy This is a proxified and sanitized view of the page, visit original site.