Skip to content

Home

pysportbot logo

No queues. Just gains.

Documentation · PyPI · Releases

Release Build status codecov Activity License Documentation Contributor Covenant Downloads

pysportbot books fitness classes at sports centres that use the Resasports booking software. You can use it from the command line or from Python, or let it book your weekly classes as soon as bookings open, e.g. from a scheduled GitHub Actions workflow. It can also send you the result on your phone.

Installation

pip install pysportbot

pysportbot needs Python 3.11 or newer. With uv, uvx pysportbot runs the command without installing anything.

Quick start

Command line

# Find the slug of your centre (no login needed)
pysportbot centres --search madrid

# Tell pysportbot who you are; you are prompted for your password unless SPORTBOT_PASSWORD is set
export SPORTBOT_EMAIL="you@example.com"
export SPORTBOT_CENTRE="your-centre-slug"

# See what's on, then book
pysportbot activities
pysportbot slots Yoga monday
pysportbot book Yoga "2026-01-12 18:00"

Python

from pysportbot import SportBot

bot = SportBot()
bot.login("you@example.com", "your-password", "your-centre-slug")

for slot in bot.daily_slots("Yoga", "2026-01-12"):
    print(slot.start, f"{slot.inscribed}/{slot.capacity}")

bot.book("Yoga", "2026-01-12 18:00")

Book every week, automatically

Describe your classes in a config.json:

{
    "booking_execution": "Friday 07:30",
    "classes": [
        {"activity": "Yoga", "class_day": "Monday", "class_time": "18:00"}
    ]
}

Then start the booking service, e.g. every Friday from GitHub Actions:

pysportbot run --config config.json

It waits until Friday 07:30 and then books Yoga on the following Monday at 18:00. If the booking window has not opened yet, it keeps trying for up to a minute. It exits with code 1 if a class could not be booked.

Documentation

The full documentation is at jbeirer.github.io/resasports-bot:

Contributing

Contributions are welcome. See CONTRIBUTING.rst to set up a development environment.

License

pysportbot is open source and published under the MIT License.