Skip to main content

Unofficial class abstraction layer for the `spond` library package.

Project description

Spond-classes

About

Spond is a team/group-oriented events system.

The unofficial Python spond library package gets data from the Spond API and returns dict objects.

This unofficial Python spond-classes library package parses those dict objects to create Pydantic class instances.

Partial, read-only implementation.

Install

Install from PyPI, e.g:

pip install spond-classes

Or if you're using Poetry:

poetry add spond-classes

Note that spond is required for practical use, but not a technical dependency, so needs to be installed separately.

Example code

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'
GROUP_ID = 'G1'
SUBGROUP_ID = 'SG1'

async def main():
    s = Spond(username=USERNAME, password=PASSWORD)
    group_data = await s.get_group(GROUP_ID)
    await s.clientsession.close()

    # Now we can create a class instance ...
    group = Group.from_dict(group_data)

    # ... use class attributes instead of dict keys ...
    print(group.name)

    # ... access subordinate instances and their attributes ...
    for member in group.members:
        print(f"{member.full_name} is in the {group.name} group")

    # ... and use some helper methods
    subgroup = group.subgroup_by_id(SUBGROUP_ID)
    for member in group.members_by_subgroup(subgroup):
        print(f"{member.full_name} is in the {subgroup.name} subgroup")

asyncio.run(main())

Documentation

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.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

spond_classes-0.15.0.tar.gz (19.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

spond_classes-0.15.0-py3-none-any.whl (20.7 kB view details)

Uploaded Python 3

File details

Details for the file spond_classes-0.15.0.tar.gz.

File metadata

  • Download URL: spond_classes-0.15.0.tar.gz
  • Upload date:
  • Size: 19.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/2.0.1 CPython/3.13.2 Windows/11

File hashes

Hashes for spond_classes-0.15.0.tar.gz
Algorithm Hash digest
SHA256 dd0e5f0fe30372d45aedcd56a7b55181e976fd085241adf765e9f1a0f757771a
MD5 5f84f758e42122cd447572a2afbb3410
BLAKE2b-256 8be522865490b7611db658e72e42f4c78d8965fd05f6a5955588406453a0e10e

See more details on using hashes here.

File details

Details for the file spond_classes-0.15.0-py3-none-any.whl.

File metadata

  • Download URL: spond_classes-0.15.0-py3-none-any.whl
  • Upload date:
  • Size: 20.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/2.0.1 CPython/3.13.2 Windows/11

File hashes

Hashes for spond_classes-0.15.0-py3-none-any.whl
Algorithm Hash digest
SHA256 a7abffc5dda8bec53af2bb89f1a47832caec90c023ca46bc45a4d6d39389339b
MD5 bc58b60cb66a0542146171d709c08752
BLAKE2b-256 6bf53b8569572fa39decc6d0521f48b67ca67614259eb2064af022b4e9c02fa4

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page