High-level Python 3 module for creating and parsing torrent files
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', trackers=['https://tracker1.example.org:1234/announce', 'https://tracker2.example.org:5678/announce'], comment='This is a comment') t.private = True t.generate() t.write('my.torrent')
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.
Release history Release notifications | RSS feed
|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|