Python helpers for BitTorrent tracker queries, peer communication, and metadata inspection.
torrentlib is not a full BitTorrent client. It can:
- load
.torrentmetadata - 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
.torrentfiles
It does not manage piece downloads/uploads for complete content transfer.
pip install torrentlibSupports Python 3.10 through 3.14.
from torrentlib import Torrent, TorrentMetaInfo, TorrentStatus, Peer
from torrentlib.Tracker import Check, QueryPlease refer to the Wiki for detailed usage examples and API reference.
MIT. See LICENSE.