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.

Example

t = torf.Torrent(path='path/to/content',
                 trackers=['https://tracker1.example.org:1234/announce',
                           'https://tracker1.example.org:1234/announce'],
                 comment='This is a comment')
t.private = True
try:
    t.write(f)
except torf.WriteError as e:
    print(f'Cannot write file: {e}')
except torf.MetainfoError as e:
    print(f'Invalid torrent metainfo: {e}')

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 of course always welcome.

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-1.1.tar.gz (14.0 kB view details)

Uploaded Source

File details

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

File metadata

  • Download URL: torf-1.1.tar.gz
  • Upload date:
  • Size: 14.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for torf-1.1.tar.gz
Algorithm Hash digest
SHA256 8e80cf7c222e86f56d8ba9a8bf9c4faa99ea103cb17a098d59acc2f13d3e8ac0
MD5 d362747f4c1478cec5222381c5b33092
BLAKE2b-256 82936053fc300e4ad62b3a42316ded3b4272098e19388b73126f375d4fac4b8b

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