Simple, unofficial library with some example scripts to access data from the Spond API.
Project description
Spond
Simple, unofficial library with some example scripts to access data from the Spond API.
[!WARNING] Notice breaking changes from versions =< 0.99 to versions >= 1.0
Install
pip install spond
Usage
You need a username and password from Spond
Example code
import asyncio
from spond import spond
username = 'my@mail.invalid'
password = 'Pa55worD'
group_id = 'C9DC791FFE63D7914D6952BE10D97B46' # fake
async def main():
s = spond.Spond(username=username, password=password)
group = await s.get_group(group_id)
print(group['name'])
await s.clientsession.close()
asyncio.run(main())
Key methods
get_groups()
Get details of all your group memberships and all members of those groups.
get_events([group_id, subgroup_id, include_scheduled, max_end, min_end, max_start, min_start, max_events])
Get details of events, limited to 100 by default. Optional parameters allow filtering by start and end datetimes, group and subgroup; more events to be returned; inclusion of 'scheduled' events.
get_person()
Get a member's details.
get_messages(max_chats=100)
Get chats, limited to 100 by default. Optional parameter allows more events to be returned.
send_message(text, user=None, group_uid=None, chat_id=None)
Send a message with content text.
Either specify an existing chat_id, or both user and group_uid for a new chat.
get_event_attendance_xlsx()
Get Excel attendance report for a single event, available via the web client.
change_response()
Change a member's response for an event (e.g. accept/decline)
Example scripts
The following scripts are included as examples. Some of the scripts might require additional packages to be installed (csv, ical etc).
Rename the file config.py.sample to config.py and add your username and password to the file before running the samples.
ical.py
Generates an ics-file of upcoming events.
groups.py
Generates a json-file for each group you are a member of.
attendance.py <-f from_date> <-t to_date> [-a]
Generates a csv-file for each event between from_date and to_date with attendance status of all organizers. The optional parameter -a also includes all members that has been invited.
transactions.py
Generates a csv-file for transactions / payments appeared in Spond Club > Finance > Payments.
AsyncIO
Asyncio might seem intimidating in the beginning, but for basic stuff, it is quite easy to follow the examples above, and just remeber to prefix functions that use the API with async def ... and to await all API-calls and all calls to said functions.
This article will give a nice introduction to both why, when and how to use asyncio in projects.
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
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file spond-1.1.1.tar.gz.
File metadata
- Download URL: spond-1.1.1.tar.gz
- Upload date:
- Size: 19.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
a0c729b328f1586027da760466d60561953ffddabf1d34162d55c1c1c7d0a057
|
|
| MD5 |
506150c2ffd6d3f077196425857e56d9
|
|
| BLAKE2b-256 |
9869274aa0e5dca692a0ed34b1cfb0a0df2b0a7232b579476c957556cfe2b545
|
Provenance
The following attestation bundles were made for spond-1.1.1.tar.gz:
Publisher:
release.yml on Olen/Spond
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
spond-1.1.1.tar.gz -
Subject digest:
a0c729b328f1586027da760466d60561953ffddabf1d34162d55c1c1c7d0a057 - Sigstore transparency entry: 173578769
- Sigstore integration time:
-
Permalink:
Olen/Spond@80ee4dd659c9f84eb280bbdbcca4691e5ea3566c -
Branch / Tag:
refs/heads/main - Owner: https://github.com/Olen
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@80ee4dd659c9f84eb280bbdbcca4691e5ea3566c -
Trigger Event:
push
-
Statement type:
File details
Details for the file spond-1.1.1-py3-none-any.whl.
File metadata
- Download URL: spond-1.1.1-py3-none-any.whl
- Upload date:
- Size: 20.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
9848f4af16249a8cfa9ad2ef1e5e4460f5b9b8f1a4c9d4c1e86387b824b81c70
|
|
| MD5 |
54edd8536f93b708b1f83c4507dbcddc
|
|
| BLAKE2b-256 |
2a88af4fb4584d15764e60d6078bdc04e94a81c494c9c39bd77b91c4b3151fa1
|
Provenance
The following attestation bundles were made for spond-1.1.1-py3-none-any.whl:
Publisher:
release.yml on Olen/Spond
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
spond-1.1.1-py3-none-any.whl -
Subject digest:
9848f4af16249a8cfa9ad2ef1e5e4460f5b9b8f1a4c9d4c1e86387b824b81c70 - Sigstore transparency entry: 173578770
- Sigstore integration time:
-
Permalink:
Olen/Spond@80ee4dd659c9f84eb280bbdbcca4691e5ea3566c -
Branch / Tag:
refs/heads/main - Owner: https://github.com/Olen
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@80ee4dd659c9f84eb280bbdbcca4691e5ea3566c -
Trigger Event:
push
-
Statement type: