jonny (good kind)<p>here is a sneak preview of a very simple python package for creating and handling <code>.torrent</code> files.</p><p><a href="https://torrent-models.readthedocs.io/en/latest/" rel="nofollow noopener noreferrer" translate="no" target="_blank"><span class="invisible">https://</span><span class="ellipsis">torrent-models.readthedocs.io/</span><span class="invisible">en/latest/</span></a></p><p><a href="https://github.com/p2p-ld/torrent-models" rel="nofollow noopener noreferrer" translate="no" target="_blank"><span class="invisible">https://</span><span class="ellipsis">github.com/p2p-ld/torrent-mode</span><span class="invisible">ls</span></a></p><ul><li>Full v2 and hybrid torrent support. </li><li>model-based validation, editing, and parsing with modern python type annotations and metadata.</li><li>Reasonable to use object when loaded with kind serdes handling (not just a wrapper around a bytestring dict)</li><li>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 <code>torf</code>).</li><li>TODO: implement the rest of the BEPs, add methods for partial rehashing, more testing.</li></ul><p>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.</p><p><a href="https://neuromatch.social/tags/Bittorrent" class="mention hashtag" rel="nofollow noopener noreferrer" target="_blank">#<span>Bittorrent</span></a> <a href="https://neuromatch.social/tags/Python" class="mention hashtag" rel="nofollow noopener noreferrer" target="_blank">#<span>Python</span></a> <a href="https://neuromatch.social/tags/Sciop" class="mention hashtag" rel="nofollow noopener noreferrer" target="_blank">#<span>Sciop</span></a> <a href="https://neuromatch.social/tags/NewWork" class="mention hashtag" rel="nofollow noopener noreferrer" target="_blank">#<span>NewWork</span></a></p>