Skip to main content

torrentool

https://github.com/idlesign/torrentool

release lic coverage

Description

The tool to work with torrent files.

Works on Python 3.10+.

Includes:

  • Command line interface. Requires click package to be installed.

    Use pip install torrentool[cli] to install this dependency automatically.

  • Torrent utils (file creation, read and modification).

  • Bencoding utils (decoder, encoder).

Using CLI

# Make .torrent out of `video.mkv`
$ torrentool torrent create /home/my/files_here/video.mkv

# Make .torrent out of entire `/home/my/files_here` dir,
# and put some open trackers announce URLs into it,
# and publish file on torrent caching service, so it is ready to share.
$ torrentool torrent create /home/my/files_here --open_trackers --cache

# Print out existing file info.
$ torrentool torrent info /home/my/some.torrent

Use command line --help switch to know more.

!!! note

Some commands require `requests` package to be installed.

From your Python code

from torrentool.api import Torrent

# Reading and modifying an existing file.
my_torrent = Torrent.from_file('/home/idle/some.torrent')
my_torrent.total_size  # Total files size in bytes.
my_torrent.magnet_link  # Magnet link for you.
my_torrent.comment = 'Your torrents are mine.'  # Set a comment.
my_torrent.to_file()  # Save changes.

# Or we can create a new torrent from a directory.
new_torrent = Torrent.create_from('/home/idle/my_stuff/')  # or it could have been a single file
new_torrent.announce_urls = 'udp://tracker.openbittorrent.com:80'
new_torrent.to_file('/home/idle/another.torrent')

# Basic data (info hash, name, trackers) can also be read from a magnet link:
another_torrent = Torrent.from_magnet('magnet:?xt=urn:btih=0123456789abcdef0123456789abcdef01234567&dn=Stuff')

Metadata

Release files for torrentool 1.3.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for torrentool 1.3.0
File Size Uploaded Provenance Actions
torrentool-1.3.0.tar.gz 11.1 kB Without provenance Details for torrentool-1.3.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for torrentool 1.3.0
File Interpreter ABI Platform Actions
torrentool-1.3.0-py3-none-any.whl Python 3 none any Details for torrentool-1.3.0-py3-none-any.whl

Total release size: 24.8 kB

Release files / torrentool-1.3.0.tar.gz

Download URL torrentool-1.3.0.tar.gz
Size 11.1 kB
Tags Source
SHA-256 checksum
How to use checksums
66bbbf3ccf8251549c738cbb0da9990348be3142ce3a6f6fbace39974181b7cd
BLAKE2b-256 checksum
How to use checksums
881d0c6df409a2b46d16309816b99487aaac138ec601ffe2db2bc4f6d9bfa9b1
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.13.7 {"installer":{"name":"uv","version":"0.13.7","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"26.04","id":"resolute","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

Release files / torrentool-1.3.0-py3-none-any.whl

Download URL torrentool-1.3.0-py3-none-any.whl
Size 13.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
2945356e995f214391aa0a69df47557e55ba4f5758e82d95d3ca443374622a08
BLAKE2b-256 checksum
How to use checksums
e21b97ded0c391be33fc4f7dad7e3c396406e6fd36d0b40f4c90456de590e279
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.13.7 {"installer":{"name":"uv","version":"0.13.7","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"26.04","id":"resolute","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

Security for torrentool 1.3.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page