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.0a0.tar.gz (18.8 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.0a0-py3-none-any.whl (22.0 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: spond_classes-0.18.0a0.tar.gz
  • Upload date:
  • Size: 18.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.11.1 {"installer":{"name":"uv","version":"0.11.1","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.0a0.tar.gz
Algorithm Hash digest
SHA256 5ca9130e14e2dd353cce2bdb615d817cbb889db7ef1337590bbde55c58cbabde
MD5 ff866ead810ad3dc73f34a54c410dde6
BLAKE2b-256 029ba08858a44523b5bc14c9d2852076fbd8ef478e1d839f9b22292d62ddba92

See more details on using hashes here.

File details

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

File metadata

  • Download URL: spond_classes-0.18.0a0-py3-none-any.whl
  • Upload date:
  • Size: 22.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.11.1 {"installer":{"name":"uv","version":"0.11.1","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.0a0-py3-none-any.whl
Algorithm Hash digest
SHA256 261f6585c5708149c13ced92c89c6612aa022341da15f1dfa00e48677a58a772
MD5 c36fe932c59504e861db7be95e463f1c
BLAKE2b-256 02bf6437992d5d261b1617baad5582678c947a03977dd54d70d4fa18f1d5d876

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