Skip to main content


Project description


用于编码、解码torrent文件的bencode格式, 需要Python3.5+


pip3 install torrent-bencode3


  1. git clone
  2. cd TorrentBEncode3
  3. pip3 install -r requirements-test.txt
  4. tox


from bencode import dumps, loads, dump, load

s = loads(b'11:hello world')  # b'hello world'
dumps(s)  # b'11:hello world'

with open('/path/to/torrent', 'rb') as f:
    obj = load(f)
    with open('/path/to/save/torrent', 'wb') as wf:
        dump(obj, wf)

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 torrent-bencode3, version 0.1.1
Filename, size File type Python version Upload date Hashes
Filename, size torrent-bencode3-0.1.1.tar.gz (4.3 kB) File type Source Python version None Upload date Hashes View hashes

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