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
- Credentials for a club using the Club Management Tool
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:
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:
playwright install-deps chromium
See also https://playwright.dev/python/docs/browsers#install-system-dependencies
Usage
def get_private_member_counts(
club_id: str,
username: str,
password: str,
manager_page_load_delay: int = 5,
) -> dict[str, int]:
Get numbers of active, pending, expired members from the club manager page.
Specifically, returns the counts from these tabs:
- Active Club Members
- New [i.e. pending] Club Subscriptions
- Expired Club Members
This takes about 10s.
get_public_club_info(club_id: str) -> dict[str, int | str]
Return information from the club's public profile page; doesn't require login.
Specifically, returns these values:
- Club name
- Total club members (note that this isn't always a live value even if the club uses the Club Management Tool to manage members)
Example scripts
You'll need to copy config_dist.ini
, rename to config.ini
and populate it with club
ID and (optionally) credentials.
example_private_member_counts.py
loads club ID and credentials from config.ini
.
It then retrieves and prints the number of active, expired and new/pending club member
counts from the club's Club Manager pages.
example_public_club_info.py
loads club ID from config.ini
. It then retrieves and
prints the club name and 'total member count' from the club's public profile page.
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
Hashes for britishcycling_clubs-0.5.0.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 7f4de9d2417771553ebd0169b60d3f18cc5810f056c552c1de4fce2eb78cccd5 |
|
MD5 | 4951ec1eac00d95ef4a01848c3d844f5 |
|
BLAKE2b-256 | 5d697239de31537331f6871f2caac14bd6bca8926b2ca90bd2c487c0c6c2bd2e |
Hashes for britishcycling_clubs-0.5.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | ffa7b1d7079d3a0a4ee8a8133a596660096b2bbe9a7958d8e273bb075b03959b |
|
MD5 | 07f46831cc1564cca422b735863d51c1 |
|
BLAKE2b-256 | c95db6228b3c81d008200ae41773a82bd3796563cad397fd67b12ee69d56a5c1 |