Skip to main content

torrent-models

docs PyPI - Version PyPI - Python Version PyPI - License

.torrent file parsing and creation with pydantic (and models for other bittorrent things too)

While there are many other torrent packages, this one:

  • Is simple and focused
  • Can create and parse v1, v2, hybrid, and other BEPs
  • Is focused on library usage (but does cli things too)
  • Validates torrent files (e.g. when accepting them as user input!)
  • Treats .torrent files as an extensible rather than fixed format
  • Is performant! (and asyncio compatible when hashing!)
  • Uses python typing and is mypy friendly

~ alpha software primarily intended for use with sciop ~

See also

These are also good projects, and probably more battle tested (but we don't know them well and can't vouch for their use):

Specifically

  • torf has some notable performance problems, and doesn't support v2
  • torrentfile is focused on the cli and doesn't appear to be able to validate torrent files, and there is no dedicated method for parsing them, e.g. editing directly manipulates the bencoded dict and rebuilding requires the files to be present
  • dottorrent can only write, not parse torrent files.
  • torrenttool doesn't validate torrents
  • PyBitTorrent doesn't validate torrents
  • torrent_parser doesn't validate torrents and doesn't have a torrent file class

Metadata

Release files for torrent-models 0.4.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 torrent-models 0.4.0
File Size Uploaded Provenance Actions
torrent_models-0.4.0.tar.gz 110.4 kB Without provenance Details for torrent_models-0.4.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for torrent-models 0.4.0
File Interpreter ABI Platform Actions
torrent_models-0.4.0-py3-none-any.whl Python 3 none any Details for torrent_models-0.4.0-py3-none-any.whl

Total release size: 162.5 kB

Release files / torrent_models-0.4.0.tar.gz

Download URL torrent_models-0.4.0.tar.gz
Size 110.4 kB
Tags Source
SHA-256 checksum
How to use checksums
ce5d17c6ed12af8aa9cc21c58196dafbc364ca3e275ebfb96bec98fcee810160
BLAKE2b-256 checksum
How to use checksums
af1ab8479afbba2d042bdfca2c7b17b1fe0e31b1bc91e49075cbd6e78b6c6893
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via pdm/2.29.5 CPython/3.13.15 Darwin/25.6.0

Release files / torrent_models-0.4.0-py3-none-any.whl

Download URL torrent_models-0.4.0-py3-none-any.whl
Size 52.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
6aa16e8bb57dce7ba1ac7b3a3f7d6968b898e88c4dba034739d4380b87bb88a1
BLAKE2b-256 checksum
How to use checksums
806551888718c9a956a74d23596385622e1bde8c7d1d9b77e03740547f405295
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via pdm/2.29.5 CPython/3.13.15 Darwin/25.6.0

Security for torrent-models 0.4.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