Simple library with some example scripts to access data from Spond.
pip install spond
You need a username and password from Spond
import asyncio
from spond import spond
username = 'my@mail.invalid'
password = 'Pa55worD'
async def main():
s = spond.Spond(username=username, password=password)
groups = await s.getGroups()
for group in groups:
print(group['name'])
await s.clientsession.close()
loop = asyncio.get_event_loop()
loop.run_until_complete(main())
Gets all your group memberships and all members of those groups
Gets up to 100 events.
Optional from_date
parameter determines the earliest date from which events are returned.
Pass a datetime
to get earlier events, e.g.:
events = await spond_session.getEvents(datetime.now() - timedelta(days=365))
If omitted, returns events from today - 14 days.
Gets up to 100 events.
Required from_date
and to_date
parameters determines the earliest and latest date from which events are returned.
Both expect a datetime
object, e.g.:
from_date = datetime.now() - timedelta(days=30)
to_date = datetime.now() + timedelta(days=30)
events = await spond_session.getEventsBetween(from_date, to_date)
Will return up to 100 events starting from 30 days in the past until 30 days in the future.
Get information about a member
Get all your messages
Send a message to recipient
with the content text
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.
Generates an ics-file of upcoming events.
Generates a json-file for each group you are a member of.
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.