Skip to main content

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

Project description

torf provides a high-level Torrent class that represents the metainfo of a torrent. Torrent instances can be created from scratch, from a file path or from a file-like object. A Torrent instance can create a .torrent file or a BTIH magnet link.

This project 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.

torf-cli is a command line tool that makes use of torf.


from torf import Torrent
t = Torrent(path='path/to/content',
            comment='This is a comment')
t.private = True


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.


I consider this project feature complete, but feel free to request new features or improvements. Bug reports are always welcome, of course.



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 2.1.0
Filename, size File type Python version Upload date Hashes
Filename, size torf-2.1.0-py3-none-any.whl (18.0 kB) File type Wheel Python version py3 Upload date Hashes View
Filename, size torf-2.1.0.tar.gz (15.9 kB) File type Source Python version None Upload date Hashes View

Supported by

Pingdom Pingdom Monitoring Google Google Object Storage and Download Analytics Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN DigiCert DigiCert EV certificate StatusPage StatusPage Status page