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.6.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.6.0
File Size Uploaded Provenance Actions
torrent_models-0.6.0.tar.gz 157.0 kB With provenance Details for torrent_models-0.6.0.tar.gz

Built distribution (wheel)

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

Total release size: 212.1 kB

Release files / torrent_models-0.6.0.tar.gz

Download URL torrent_models-0.6.0.tar.gz
Size 157.0 kB
Tags Source
SHA-256 checksum
How to use checksums
f96b74e35f38ae52ebc373ca666ceaf3b965c3e7b9bda5e8d1d08e60363b91fe
BLAKE2b-256 checksum
How to use checksums
28ea56cbf1892e2999a208dc971b0425702efd7ffab62ff03e3941b385145dc2
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 14, 2026.

Transparency log

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

Download URL torrent_models-0.6.0-py3-none-any.whl
Size 55.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
9453b3a9e218f9ca723efe8d63d6fd4b22dcc17cf9ba36c5258ba409dd897de1
BLAKE2b-256 checksum
How to use checksums
27c803d27e5124fbf87fe02258c08dcd5be05ac191d3adb58df7d519ea86b03e
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 14, 2026.

Transparency log

Security for torrent-models 0.6.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.6.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 14, 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