Skip to main content

.torrent file parsing and creation with pydantic

Project description

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

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

torrent_models-0.3.3.tar.gz (3.1 MB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

torrent_models-0.3.3-py3-none-any.whl (49.9 kB view details)

Uploaded Python 3

File details

Details for the file torrent_models-0.3.3.tar.gz.

File metadata

  • Download URL: torrent_models-0.3.3.tar.gz
  • Upload date:
  • Size: 3.1 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: pdm/2.25.6 CPython/3.13.1 Darwin/23.3.0

File hashes

Hashes for torrent_models-0.3.3.tar.gz
Algorithm Hash digest
SHA256 6a73fa9d7144992c934cfd1b1f4445a2002d954d02d4d8017ff5c1a5e958b73f
MD5 22e3810ba6793688619a37e7b976574e
BLAKE2b-256 7b96295338e86209413a935469d68333b0967a66b5946ee595693de53863cb81

See more details on using hashes here.

File details

Details for the file torrent_models-0.3.3-py3-none-any.whl.

File metadata

  • Download URL: torrent_models-0.3.3-py3-none-any.whl
  • Upload date:
  • Size: 49.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: pdm/2.25.6 CPython/3.13.1 Darwin/23.3.0

File hashes

Hashes for torrent_models-0.3.3-py3-none-any.whl
Algorithm Hash digest
SHA256 79e99f8b4dec63fad96de8526d3dc9ede8cb1e1d311836d1dc73056bf6353c2d
MD5 98bcb446c0e0a1f978fe3f9d71e315b1
BLAKE2b-256 0a1d3a67420f5120cba5b94f1ef216de7d0348584b84b7e00916cccde433cd42

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page