Skip to content

synodriver/fast-bencode

Repository files navigation

✨ fast-bencode ✨

The cython version of bencode

pypi python implementation wheel license action

forked from bencode to support latest version of python

  • extra cython extension to speedup
  • typing with mypy check

Usage

from pprint import pprint
from bencode import bdecode, bencode

with open("test.torrent", "rb") as f:
    data = f.read()

raw = bdecode(data)
pprint(raw)

assert bencode(raw) == data
  • There are alias function loads for bdecode and dumps for bencode

build

git clone https://github.com/synodriver/fast-bencode.git
cd fast-bencode
python setup.py build_ext -i