Skip to main content

torrentlib

Python helpers for BitTorrent tracker queries, peer communication, and metadata inspection.

torrentlib is not a full BitTorrent client. It can:

  • load .torrent metadata
  • announce to HTTP and UDP trackers
  • collect IPv4 and IPv6 peer lists
  • connect to peers and download metadata
  • process peer exchange (ut_pex) messages
  • edit and rebuild .torrent files

It does not manage piece downloads/uploads for complete content transfer.

Installation

pip install torrentlib

Supports Python 3.10 through 3.14.

Public API

from torrentlib import Torrent, TorrentMetaInfo, TorrentStatus, Peer
from torrentlib.Tracker import Check, Query

Usage

Please refer to the Wiki for detailed usage examples and API reference.

License

MIT. See LICENSE.

Metadata

Release files for torrentlib 1.2.1

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

Source distribution (sdist)

Source distribution for torrentlib 1.2.1
File Size Uploaded Provenance Actions
torrentlib-1.2.1.tar.gz 23.3 kB Without provenance Details for torrentlib-1.2.1.tar.gz

Built distribution (wheel)

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

Total release size: 47.0 kB

Release files / torrentlib-1.2.1.tar.gz

Download URL torrentlib-1.2.1.tar.gz
Size 23.3 kB
Tags Source
SHA-256 checksum
How to use checksums
cb19883bba2e7b94922223a546626112a579a5bc879316dc150fbc065c86e470
BLAKE2b-256 checksum
How to use checksums
e9bef8eaa475785e61e49f7ec0cbc7e61aa1f3bde9c87025adae1e2f8593760b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.15.0

Release files / torrentlib-1.2.1-py3-none-any.whl

Download URL torrentlib-1.2.1-py3-none-any.whl
Size 23.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
8d8e388f7f27e2fc44e8c4a629d977f283d69af472178cb97baeaeef7dda2c8e
BLAKE2b-256 checksum
How to use checksums
05601bf19ba249dd63f8a1e388526be08257d93bcc5d16f5c158dcf2bfa7f2ea
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.15.0

Security for torrentlib 1.2.1

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