From 59f6a43e086d08617313e12bacbcb20d78f086ed Mon Sep 17 00:00:00 2001 From: Elliot <3186037+elliot-100@users.noreply.github.com> Date: Mon, 15 Jul 2024 13:12:39 +0100 Subject: [PATCH] Revised README --- README.md | 70 +++++++++++++++++++++++-------------------------------- 1 file changed, 29 insertions(+), 41 deletions(-) diff --git a/README.md b/README.md index 838332a..66a059b 100644 --- a/README.md +++ b/README.md @@ -15,7 +15,8 @@ administrators. ## Prerequisites -- Credentials for a club using the Club Management Tool +- ID for a club +- for Club Management Tool functions, valid user credentials ## Installation @@ -39,66 +40,53 @@ See also https://playwright.dev/python/docs/browsers#install-system-dependencies ## Usage -### Club profile URL - -``` -britishcycling_clubs.club_profile_url( - club_id: str -) -> str -``` - ### Get info from a club's profile +```python +britishcycling_clubs.get_profile_info(club_id="123") ``` -britishcycling_clubs.get_profile_info( - club_id: str -) -> dict[str, int | str] -``` -Return information from the club's public profile page; doesn't require login. - -Specifically, return a dict with these keys and corresponding values: +Returns a dict with these keys and values: -- `"club_name"`: Club name -- `"total_members"`: Total club members +- `"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. -### Club manager URL (via login) - -``` -britishcycling_clubs.club_manager_url_via_login( - club_id: str -) -> str +### Construct club's profile URL +```python +britishcycling_clubs.club_profile_url(club_id="123") ``` -URL which redirects to Club Manager URL, via login if needed. - ### Get member counts from Club Manager - -``` +```python britishcycling_clubs.get_manager_member_counts( - club_id: str, - username: str, - password: str, - manager_page_load_delay: int = 5, -) -> dict[str, int]: + club_id="123", + username="USERNAME", + password="PASSWORD", + manager_page_load_delay=7, +) ``` -Get numbers of active, new, expired members from the club manager page. - -Specifically, return a dict with these keys, and values from badges on corresponding -tabs: +Returns a dict with these keys and values: -- `"active"`: Active Club Members -- `"expired"`: Expired Club Members -- `"new"`: New Club Subscriptions +- `"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 10s. +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) +```python +britishcycling_clubs.club_manager_url_via_login(club_id=123) +``` +Returns URL which redirects to Club Manager URL, via login if needed. + +