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.18.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.18.0-py3-none-any.whl (22.2 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: spond_classes-0.18.0.tar.gz
  • Upload date:
  • Size: 19.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.11.3 {"installer":{"name":"uv","version":"0.11.3","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Linux Mint","version":"22.3","id":"zena","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.18.0.tar.gz
Algorithm Hash digest
SHA256 b753b7f647822154ba02cba970c5a0e09ebf0fc7d46e6c60ac518a09b978f997
MD5 eebe52d8e2fa7ffcb226255a358418b9
BLAKE2b-256 06d1f427720f4cf8ccc685615b168b4e312b906aa41910796412244e84e8c81b

See more details on using hashes here.

File details

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

File metadata

  • Download URL: spond_classes-0.18.0-py3-none-any.whl
  • Upload date:
  • Size: 22.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.11.3 {"installer":{"name":"uv","version":"0.11.3","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Linux Mint","version":"22.3","id":"zena","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.18.0-py3-none-any.whl
Algorithm Hash digest
SHA256 77bb2e9f90da04a21dfcc9dd55ddad2a6ec7ec4f4d1cfc4315774dfdf845a177
MD5 a510dc5982f698b577ec63dcd9caa34a
BLAKE2b-256 516a2f1f32d2afd16713919683b675259bfe1c85deeafeb6125c0081b60fddd1

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