Skip to content

Commit

Permalink
Revised README
Browse files Browse the repository at this point in the history
  • Loading branch information
elliot-100 committed Jul 15, 2024
1 parent 2b7c7e3 commit 59f6a43
Showing 1 changed file with 29 additions and 41 deletions.
70 changes: 29 additions & 41 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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.


0 comments on commit 59f6a43

Please sign in to comment.