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.

Source Distribution

torrent-bencode3-0.1.1.tar.gz (4.3 kB view hashes)

Uploaded source

Supported by

AWS AWS Cloud computing Datadog Datadog Monitoring Facebook / Instagram Facebook / Instagram PSF Sponsor Fastly Fastly CDN Google Google Object Storage and Download Analytics Huawei Huawei PSF Sponsor Microsoft Microsoft PSF Sponsor NVIDIA NVIDIA PSF Sponsor Pingdom Pingdom Monitoring Salesforce Salesforce PSF Sponsor Sentry Sentry Error logging StatusPage StatusPage Status page