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 (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

Install from PyPI, e.g:

pip install spond-classes

Note that spond is required for practical use, but is 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'
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())

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.

Development

Build documentation:

uv run pdoc src/spond_classes -d numpy -t docs_templates -o docs

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.19.0.tar.gz (19.0 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.19.0-py3-none-any.whl (22.5 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: spond_classes-0.19.0.tar.gz
  • Upload date:
  • Size: 19.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.11.15 {"installer":{"name":"uv","version":"0.11.15","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for spond_classes-0.19.0.tar.gz
Algorithm Hash digest
SHA256 0af0cc718afeedffc7fd47becd5369f2ebe41edcd45699f8d96bb8683551b5fe
MD5 7c8905e4693f1383d8140dd5f99eaf99
BLAKE2b-256 354604caeae8a8e5f5eccd2f78fbd2d352049adf2d3fe361755728a7e883c98a

See more details on using hashes here.

File details

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

File metadata

  • Download URL: spond_classes-0.19.0-py3-none-any.whl
  • Upload date:
  • Size: 22.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.11.15 {"installer":{"name":"uv","version":"0.11.15","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for spond_classes-0.19.0-py3-none-any.whl
Algorithm Hash digest
SHA256 85d956187e58ad2919b2c8a144517ad897fd38711f3225b25e89f933afd91685
MD5 91f111fafef5c38edf59e927c34e3027
BLAKE2b-256 56ad81ac8e7a9b0bc2ebfe2a0b0b64cd3a868ef20e27e7662b72d32f64993f2b

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