Unofficial library to automate aspects of British/Scottish/Welsh Cycling's club Membership Manager system
Project description
britishcycling-clubs
About
Unofficial, not affiliated or endorsed by British/Scottish/Welsh Cycling.
Library to automate aspects of British Cycling's Club Management Tool, in order to simplify administration for clubs using it. It probably works for Scottish/Welsh Cycling clubs too, but this hasn't been tested.
Priority is to read data in order to create reports/notifications to club administrators.
Prerequisites
- ID for a club
- for Club Management Tool functions, valid user credentials
Installation
Install from PyPI, e.g:
pip install britishcycling-clubs
Some functions use Playwright to automate a headless Chromium browser. This needs to be installed separately before first use, and after most Playwright updates, e.g.:
playwright install chromium
If you're installing in e.g. a bare-bones server/CI environment, you'll probably be prompted to install system dependencies, which you can do with e.g.:
playwright install-deps chromium
See also https://playwright.dev/python/docs/browsers#install-system-dependencies
Usage
Get info from a club's profile
from britishcycling_clubs import get_profile_info
get_profile_info(club_id="123")
Returns an instance of ProfileInfo
, a NamedTuple
with attributes:
club_name
: Club name [str]total_members
: Total club members [int]
Example script example_profile_info.py
loads club ID from config.ini
(you'll
need to copy config_dist.ini
, populate club ID only and rename).
It then retrieves and prints the club name and total member count.
Construct club's profile URL
from britishcycling_clubs import profile_url
profile_url(club_id="123")
Get member counts from Club Manager
from britishcycling_clubs import get_manager_member_counts
get_manager_member_counts(
club_id="123",
username="USERNAME",
password="PASSWORD",
manager_page_load_delay=7,
)
Returns an instance of ManagerMemberCounts
, a NamedTuple
with attributes:
active
: count of 'Active Club Members' [int]expired
: count of 'Expired Club Members' [int]new
: count of 'New Club Subscriptions' i.e. pending members [int]
This takes about 10 s.
Example script example_manager_member_counts.py
loads club ID and credentials from
config.ini
(you'll need to copy config_dist.ini
, populate and rename to
config.ini
).
It then retrieves and prints the number of active, expired and new
club member counts from the club's Club Manager pages.
Construct club's Club Manager URL (via login)
from britishcycling_clubs import manager_url_via_login
manager_url_via_login(club_id="123")
Returns URL which redirects to Club Manager URL, via login if needed.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file britishcycling_clubs-0.11.0.tar.gz
.
File metadata
- Download URL: britishcycling_clubs-0.11.0.tar.gz
- Upload date:
- Size: 19.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.8.4 CPython/3.13.0 Windows/11
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 05f674448e189c3821ef6e6702405ca4a5c8e32424caac1e542dee4e3dea4f29 |
|
MD5 | 32d8257e7ef713e8a20a3e57e9b06b2a |
|
BLAKE2b-256 | 2c472a48e280aadfe00ddf55fa9c9c1488b8a52833672d2969d1f4d5cf7b7172 |
File details
Details for the file britishcycling_clubs-0.11.0-py3-none-any.whl
.
File metadata
- Download URL: britishcycling_clubs-0.11.0-py3-none-any.whl
- Upload date:
- Size: 20.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.8.4 CPython/3.13.0 Windows/11
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 0b1ffc0876e0186b0fc4de1998b1573967728539865e16728008a62574a153d5 |
|
MD5 | 908398f28acb0d3cdccd3f24b0849c84 |
|
BLAKE2b-256 | a95b157ca25eb874b73ed4d2afef98fdad9948ef92bf979e19941609d7ba6e8d |