Home
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¶
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:
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:
- Command line: all commands, exit codes and env vars
- Python library: booking from your own code, error handling and logging
- Booking service: the config file and how bookings are retried
- Notifications: booking results on your phone with ntfy
- GitHub Actions: weekly bookings without a server
- API reference
Contributing¶
Contributions are welcome. See CONTRIBUTING.rst to set up a development environment.
License¶
pysportbot is open source and published under the MIT License.