Skip to main content

A python-based bot for automatic resasports slot booking

Project description

No queues. Just gains.

Logo

Release Build status codecov Commit activity License

Welcome to pysportbot!

Download pysportbot

pip install pysportbot

Quick Start

from pysportbot import SportBot

# Create bot instance, will list available centres if requested
bot = SportBot(log_level='INFO', print_centres=False, time_zone = 'Europe/Madrid')

# Connect to service with email and password as well as the name of the centre
bot.login('email', 'password', 'centre')

# List available activites
bot.activities(limit = 10)

# List bookable slots for an activity on a specific day
bot.daily_slots(activity='YourFavouriteGymClass', day = '2025-01-03', limit = 10)

# Book an activity slot on a specific day and time
bot.book(activity='YourFavouriteGymClass', start_time = '2024-12-30 07:00:00')

# Cancel an activity slot on a specific day and time
bot.cancel(activity='YourFavouriteGymClass', start_time = '2024-12-30 07:00:00')

Advanced usage as service

You can easily run pysportbot as a service to manage your bookings automatically with

python -m pysportbot.service --config config.json

The service requires a json configuration file that specifies your user data and how you would like to book your classes. Currently, three types of configuration are supported:

1. Book an upcoming class now

Let's say you would like to book Yoga next Monday at 18:00:00, then your config.json would look like:

{
    "email": "your-email",
    "password": "your-password",
    "center": "your-gym-name",
    "classes": [
        {
            "activity": "Yoga",
            "class_day": "Monday",
            "class_time": "18:00:00",
            "booking_execution": "now",
            "weekly": false
        }
    ]
}
2. Book an upcoming class on a specific day and time

Let's say you would like to book Yoga next Monday at 18:00:00, but the execution of the booking should only happen on Friday at 07:30:00 then your config.json would look like:

{
    "email": "your-email",
    "password": "your-password",
    "center": "your-gym-name",
    "classes": [
        {
            "activity": "Yoga",
            "class_day": "Monday",
            "class_time": "18:00:00",
            "booking_execution": "Friday 07:30:00",
            "weekly": false
        }
    ]
}
3. Schedule weekly booking at specific execution day and time

Let's say you would like to book Yoga every Monday at 18:00:00 and the booking execution should be every Friday at 07:30:00 then your config.json would look like:

{
    "email": "your-email",
    "password": "your-password",
    "center": "your-gym-name",
    "classes": [
        {
            "activity": "Yoga",
            "class_day": "Monday",
            "class_time": "18:00:00",
            "booking_execution": "Friday 07:30:00",
            "weekly": true
        }
    ]
}

The service also provides various other options that can be inspected with

python -m pysportbot.service --help

Currently supported options include

  1. --retry-attempts sets the number of retries attempted in case a booking attempt fails
  2. --retry-delay-minutes sets the delay in minutes between retries for weekly bookings
  3. --time-zone sets the time zone for the service (e.g. Europe/Madrid)
  4. --log-level sets the log-level of the service (e.g. DEBUG, INFO, WARNING, ERROR)

LICENSE

pysportbot is free of use and open-source. All versions are published under the MIT License.

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

pysportbot-0.0.3.tar.gz (16.4 kB view details)

Uploaded Source

Built Distribution

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

pysportbot-0.0.3-py3-none-any.whl (20.6 kB view details)

Uploaded Python 3

File details

Details for the file pysportbot-0.0.3.tar.gz.

File metadata

  • Download URL: pysportbot-0.0.3.tar.gz
  • Upload date:
  • Size: 16.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.8.5 CPython/3.12.8 Linux/6.8.0-1017-azure

File hashes

Hashes for pysportbot-0.0.3.tar.gz
Algorithm Hash digest
SHA256 d0cd0e50775340025fd95eabbd48b7adfce68f4ef22e982b3d5a25f34e866886
MD5 012688622c7ec34538640b67bc0a7361
BLAKE2b-256 e8d2551b3694607cb89353420da52fc5f541054b581eb5e3715916c2e3079934

See more details on using hashes here.

File details

Details for the file pysportbot-0.0.3-py3-none-any.whl.

File metadata

  • Download URL: pysportbot-0.0.3-py3-none-any.whl
  • Upload date:
  • Size: 20.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.8.5 CPython/3.12.8 Linux/6.8.0-1017-azure

File hashes

Hashes for pysportbot-0.0.3-py3-none-any.whl
Algorithm Hash digest
SHA256 5be77cb3e89f87375139dfa5d6a711608785643a032a068aec09e98b92155cf3
MD5 606a6e75185eadbb4018eadde8f012c3
BLAKE2b-256 cf66539eea132422d5a1546275b8a8f92f93b479c6ef0788d4d56dd7cfa9356c

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