here is a sneak preview of a very simple python package for creating and handling .torrent
files.
https://torrent-models.readthedocs.io/en/latest/
https://github.com/p2p-ld/torrent-models
- Full v2 and hybrid torrent support.
- model-based validation, editing, and parsing with modern python type annotations and metadata.
- Reasonable to use object when loaded with kind serdes handling (not just a wrapper around a bytestring dict)
- Fast enough to use with a tracker/web service (a surprising amount of the existing packages have O(n2) spots for no reason, this is ~dozens-thousands of times faster than
torf
). - TODO: implement the rest of the BEPs, add methods for partial rehashing, more testing.
I was surprised this needed to be written since torrents are a relatively simple file format, but it did - none of the existing packages are suited for use as a library e.g. for tracker/client software and most can only do v1. I wrote this for sciop, where we want to be experimenting on the format, but also do stuff like dynamically modifying torrents to add trackers, webseeds, and other metadata. I'll do a full announcement after implementing the rest of the BEPs.
#Bittorrent #Python #Sciop #NewWork