Skip to main content

High-level Python 3 module for creating and parsing torrent files

Project description

torf provides a high-level, flexible Torrent class that holds torrent metainfo and can export it to and import it from .torrent files. It can also create BTIH magnet links.

It started as a fork of dottorrent but turned into a rewrite with more features like full control over the torrent’s metainfo, validation, randomization of the info hash to help with cross-seeding and more.


t = torf.Torrent(path='path/to/content',
                 comment='This is a comment')
t.private = True
except torf.WriteError as e:
    print(f'Cannot write file: {e}')
except torf.MetainfoError as e:
    print(f'Invalid torrent metainfo: {e}')


Documentation is in the docstrings. Read it locally by running pydoc3 torf.Torrent after the installation. It’s also available online.


torf is available on PyPI.

The latest development version is in the master branch on GitHub.



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 torf, version 1.0rc5
Filename, size File type Python version Upload date Hashes
Filename, size torf-1.0rc5.tar.gz (13.8 kB) File type Source Python version None Upload date Hashes View

Supported by

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