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.7.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.7.0
File Size Uploaded Provenance Actions
torrent_models-0.7.0.tar.gz 161.3 kB With provenance Details for torrent_models-0.7.0.tar.gz

Built distribution (wheel)

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

Total release size: 219.4 kB

Release files / torrent_models-0.7.0.tar.gz

Download URL torrent_models-0.7.0.tar.gz
Size 161.3 kB
Tags Source
SHA-256 checksum
How to use checksums
38eb2b39cf12148e1602f4e52f30e283b61a31d1fd9d691e11fe4bbf47457f4e
BLAKE2b-256 checksum
How to use checksums
be85770bf01c96bba74767df8be932ff71fe68fdb3d566a085b726ec22bd8851
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 17, 2026.

Transparency log

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

Download URL torrent_models-0.7.0-py3-none-any.whl
Size 58.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
feabd0687b76f515ba6a57809f5e4a6c86cb738fb63c45cf6257ada8c282f565
BLAKE2b-256 checksum
How to use checksums
7b6d83e0d9045dec82c5b327a3db13e156fb4237ca16c813cff1f76c58658cfd
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 17, 2026.

Transparency log

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

Full provenance

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for torrent_models-0.7.0.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 17, 2026.

Transparency log

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