Skip to main content
Pre-release

This release is a pre-release and may not be stable for production use.

py3createtorrent

PyPI Python Versions Tests Test Coverage Dependency Security Audit Documentation Status uv Ruff License: LGPL v3

Create torrents via command line — classic v1, modern v2 or hybrid (BEP 52).

Features

  • BitTorrent v1, v2, and hybrid support: Generate classic v1, pure v2, or BEP 52 hybrid torrents.

  • Fast multithreaded hashing: Utilizes multiple worker threads by default (configurable via --threads) while reading file data in a single pass.

  • Flexible tracker & peer setup: Add multiple trackers, automatically fetch the best trackers from ngosang/trackerslist (bestN), add DHT bootstrap nodes, or create trackerless torrents.

  • Webseed support: Embed HTTP/FTP GetRight-style webseeds (url-list).

  • Private torrents & custom metadata: Set the private flag (disabling DHT/PEX), add comments, source tags (for cross-seeding), custom torrent names, or custom ISO 8601 creation dates.

  • Fine-grained file filtering: Exclude specific paths or match relative paths using case-sensitive or case-insensitive regular expressions.

  • Automatic or custom piece sizes: Automatically selects a sensible piece size or lets you specify an exact power-of-two size.

  • Lightweight & scriptable: Requires only Python 3.11+ and bencode.py; usable both as a CLI tool and via a clean Python API (TorrentSpec, create_torrent).

Basic usage

Creating a torrent is as simple as:

py3createtorrent -t udp://tracker.opentrackr.org:1337/announce file_or_folder

The shortcut bestN can be used for conveniently adding the best N trackers from ngosang/trackerslist. Example:

py3createtorrent -t best3 file_or_folder

Multiple trackers can also be specified manually by using -t multiple times, for example:

py3createtorrent -t udp://tracker.opentrackr.org:1337/announce -t udp://tracker.cyberia.is:6969/announce file_or_folder

Install py3createtorrent 2.0 (beta)

The 2.0 release is only available as a pre-release (beta).

Recommended (isolated CLI installation via uv or pipx):

Using uv:

uv tool install --prerelease=allow py3createtorrent
py3createtorrent --help

# or without installation
uvx --prerelease=allow py3createtorrent --help

Using pipx:

pipx install --pip-args="--pre" py3createtorrent
py3createtorrent --help

# or without installation
pipx run --pip-args="--pre" py3createtorrent --help

Via pip:

pip install --pre py3createtorrent
py3createtorrent --help

Install py3createtorrent 1.2 (stable)

py3createtorrent 1.2 requires Python 3.8 or later. Python 3.5 to Python 3.7 might be possible if you install the typing-extensions module.

Note: The stable 1.2 version comes without v2/hybrid torrent support.

Recommended (isolated CLI installation via uv or pipx):

Using uv:

uv tool install py3createtorrent
py3createtorrent --help

# or without installation
uvx py3createtorrent --help

Using pipx:

pipx install py3createtorrent
py3createtorrent --help

# or without installation
pipx run py3createtorrent --help

Via pip:

pip install py3createtorrent
py3createtorrent --help

Full documentation

For 2.x (beta):

https://py3createtorrent.readthedocs.io/en/latest/index.html

For 1.2 (stable):

https://py3createtorrent.readthedocs.io/en/v1.2.1/user.html

Performance

py3createtorrent v2.0 is one of the fastest torrent creation tools available.

Here are the benchmark results for creating a torrent for a folder containing 10.5 GB in 101 files:

Command

Mean Wall Time [s]

Change

Factor

py3createtorrent v2.0.0a2

7.516 ± 0.137

1

mkbrr 1.28.0

7.133 ± 0.063

-5.1%

0.95

torf-cli 5.2.1

9.618 ± 0.096

+28.0%

1.28

torrenttools v0.6.2

9.632 ± 0.051

+28.2%

1.28

Plot:

Plot of benchmark results

System specs:

  • AMD Ryzen 7 7735HS (3.2 GHz, 8 cores)

  • 16 GB DDR5 RAM

  • Micron 2400 SSD

The benchmarking code is in scripts/benchmark.ps1.

Metadata

Release files for py3createtorrent 2.0.0b2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for py3createtorrent 2.0.0b2
File Size Uploaded Provenance Actions
py3createtorrent-2.0.0b2.tar.gz 17.1 kB Without provenance Details for py3createtorrent-2.0.0b2.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for py3createtorrent 2.0.0b2
File Interpreter ABI Platform Actions
py3createtorrent-2.0.0b2-py3-none-any.whl Python 3 none any Details for py3createtorrent-2.0.0b2-py3-none-any.whl

Total release size: 38.0 kB

Release files / py3createtorrent-2.0.0b2.tar.gz

Download URL py3createtorrent-2.0.0b2.tar.gz
Size 17.1 kB
Tags Source
SHA-256 checksum
How to use checksums
c89b73871fb984798184b8566626bfc738c71b6195c6addf92184df49ea665d3
BLAKE2b-256 checksum
How to use checksums
385b023ee645b3dd9d17f81112c735b7cceaa5107cab978d10446e9d2f75673c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.13.10 {"installer":{"name":"uv","version":"0.13.10","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":null,"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

Release files / py3createtorrent-2.0.0b2-py3-none-any.whl

Download URL py3createtorrent-2.0.0b2-py3-none-any.whl
Size 20.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
f6b289360dda7203218bccfc17fcdef666b2f6cd5576e1d07fb6c5381ac86743
BLAKE2b-256 checksum
How to use checksums
a72c79cec10e17be01e4279f3666ffe7be67b391929448ecb7146f76468cc35c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.13.10 {"installer":{"name":"uv","version":"0.13.10","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":null,"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

Security for py3createtorrent 2.0.0b2

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