Models¶
SportBot returns centres, activities and slots as frozen dataclasses. All three can be imported from pysportbot.
Centre
dataclass
¶
A sports centre that uses Resasports.
Attributes:
| Name | Type | Description |
|---|---|---|
slug |
str
|
The identifier to pass to |
name |
str
|
The display name. |
town |
str | None
|
The town, if listed. |
country |
str | None
|
The country, if listed. |
address |
str | None
|
The street address, if listed. |
Activity
dataclass
¶
An activity offered by the centre, such as a class.
Attributes:
| Name | Type | Description |
|---|---|---|
id |
int
|
The activity ID. |
name |
str
|
The name to pass to |
category_id |
int
|
The ID of the activity's category. |
Slot
dataclass
¶
One scheduled session of an activity.
Attributes:
| Name | Type | Description |
|---|---|---|
id |
int
|
The slot ID, which booking and cancelling send to the API. |
activity_id |
int
|
The ID of the activity. |
activity_name |
str
|
The name of the activity. |
category_id |
int
|
The ID of the activity's category. |
start |
datetime
|
The start time, time zone aware, in the bot's time zone. The API sends local times without a UTC offset, so a time in the hour skipped or repeated by a DST change gets the offset in effect before it. |
end |
datetime
|
The end time, time zone aware, in the bot's time zone. |
capacity |
int
|
The total number of places. |
inscribed |
int
|
The number of places already taken. |
waiting_list |
int
|
The number of people on the waiting list. |
cancelled |
bool
|
Whether the session is cancelled. |
trainer |
str | None
|
The trainer's name, if listed. |