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.

Example

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

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

Installation

torf is available on PyPI.

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

Contributing

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

License

MIT

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

torf-2.1.0.tar.gz (15.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

torf-2.1.0-py3-none-any.whl (18.0 kB view details)

Uploaded Python 3

File details

Details for the file torf-2.1.0.tar.gz.

File metadata

  • Download URL: torf-2.1.0.tar.gz
  • Upload date:
  • Size: 15.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.13.0 pkginfo/1.4.2 requests/2.21.0 setuptools/40.8.0 requests-toolbelt/0.8.0 tqdm/4.28.1 CPython/3.7.3

File hashes

Hashes for torf-2.1.0.tar.gz
Algorithm Hash digest
SHA256 34fa9b0c9819bac6627aa3fcd60838f83d4751860f932a6c95ffbf4410d2c930
MD5 102f39f8dec10a56a9b4f04b7af7655b
BLAKE2b-256 5456f418e2b07f49fc0ba4680924e8c22b9266d0bb7a1bbc22ac6a991b9eb5b4

See more details on using hashes here.

File details

Details for the file torf-2.1.0-py3-none-any.whl.

File metadata

  • Download URL: torf-2.1.0-py3-none-any.whl
  • Upload date:
  • Size: 18.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.13.0 pkginfo/1.4.2 requests/2.21.0 setuptools/40.8.0 requests-toolbelt/0.8.0 tqdm/4.28.1 CPython/3.7.3

File hashes

Hashes for torf-2.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 064f31b43913dea75f32eb73992084e7d8fab55e05ff6be45d3b9fdf304fae37
MD5 e2c5c9e78d7e003b41ae75e3bf49e0b0
BLAKE2b-256 142759b8e6849de6f2c9058f0328678080445d847616e9a64db31c6ad3a38083

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page