Spond is a team/group-oriented events system.
The unofficial Python spond library package (GitHub,
PyPI) returns data from the Spond API.
This unofficial Python spond-classes library package
(GitHub,
PyPI) parses that data using
Pydantic to create class instances.
Partial, read-only implementation.
Install from PyPI, e.g:
pip install spond-classesNote that spond is required for practical use, but
is not a technical dependency, so needs to be installed separately.
Adapting the example code in Spond README:
import asyncio
from spond.spond import Spond
from spond_classes import Group
# fake credentials and ids
USERNAME = 'my@mail.invalid'
PASSWORD = 'Pa55worD'
SUBGROUP_ID = 'SG1'
async def main():
s = Spond(username=USERNAME, password=PASSWORD)
groups_data = await s.get_groups()
await s.clientsession.close()
# Now we can create class instances from the data...
groups = Group.list_from_data(groups_data)
# ... use class attributes instead of dict keys ...
my_group = groups[0]
print(my_group.uid)
# ... access subordinate instances and their attributes ...
for member in my_group.members:
print(f"{member.full_name} is in the {my_group.name} group")
# ... and use some helper methods
subgroup = my_group.subgroup_by_uid(SUBGROUP_ID)
for member in my_group.members_by_subgroup(subgroup):
print(f"{member.full_name} is in the {subgroup.name} subgroup")
asyncio.run(main())Full API documentation is published at https://elliot-100.github.io/Spond-classes/ and
is also included as HTML in the package source docs folder.
Build documentation:
uv run pdoc src/spond_classes -d numpy -t docs_templates -o docs