Skip to main content

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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

britishcycling_clubs-0.10.0.post1.tar.gz (19.4 kB view details)

Uploaded Source

Built Distribution

File details

Details for the file britishcycling_clubs-0.10.0.post1.tar.gz.

File metadata

File hashes

Hashes for britishcycling_clubs-0.10.0.post1.tar.gz
Algorithm Hash digest
SHA256 3e6b694d2c3a7b9ceec276976b6499dc277c327801dd42b122ee364140f9069f
MD5 71d485b96e035e471984d6946215f4f1
BLAKE2b-256 9adedbdd02a71bcd0e76ad62622820b64bad9e9e0efd674849b9a1a79635279d

See more details on using hashes here.

File details

Details for the file britishcycling_clubs-0.10.0.post1-py3-none-any.whl.

File metadata

File hashes

Hashes for britishcycling_clubs-0.10.0.post1-py3-none-any.whl
Algorithm Hash digest
SHA256 51f90e98b9e351f1b5d153ef0aa6cc05a1a4ce6df321e2b0c47ee2c3484e8978
MD5 351e87564d88c7585a9433571c9aa5b8
BLAKE2b-256 2ac7407cd8c1a55baa2393929594168c68a034da27c7d9a6f7e36f0bf1bd45b5

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page