Skip to main content
Help us improve Python packaging – donate today!

Simple asyncio-based UDP BitTorrent tracker, with a simple client.

Project Description

pybtracker is a UDP BitTorrent tracker written in Python 3.5 using co-routines and the asyncio module. You can use the tracker in a script like this:

from pybtracker import TrackerServer

loop = asyncio.get_event_loop()
tracker = TrackerServer(local_addr=('', 8000), loop=loop)
except KeyboardInterrupt:

It also includes a UDP tracker client:

from pybtracker import TrackerClient

async def announce():
    client = TrackerServer(local_addr='udp://', loop=loop)
    await client.start()
    peers = await client.announce(
        b'01234567890123456789',  # infohash
        10000,                    # downloaded
        40000,                    # left
        5000,                     # uploaded
        0,                        # event (0=none)
        120                       # number of peers wanted

loop = asyncio.get_event_loop()

You can run the server independently by running:

$ python -m pybtracker.server -b -O

The client can also be run independently and it provides you with a shell to interact with the server:

$ python -m pybtracker.client udp://
BitTorrent tracker client. Type help or ? to list commands.

(btrc) help
Documented commands (type help <topic>):
EOF  announce  connect  help  quit

(btrc) quit

If you have installed pybtracker using pip or, you can also run pybtracker and pybtracker-client instead of using python -m.

Release history Release notifications

This version
History Node


History Node


History Node


History Node


History Node


History Node


History Node


Download files

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

Filename, size & hash SHA256 hash help File type Python version Upload date
pybtracker-0.2.2.tar.gz (8.5 kB) Copy SHA256 hash SHA256 Source None Jan 9, 2017

Supported by

Elastic Elastic Search Pingdom Pingdom Monitoring Google Google BigQuery Sentry Sentry Error logging CloudAMQP CloudAMQP RabbitMQ AWS AWS Cloud computing Fastly Fastly CDN DigiCert DigiCert EV certificate StatusPage StatusPage Status page