spond

Unofficial Python SDK for the Spond API.

The main entry point is spond.spond.Spond for general account/event/group/ messaging access, and spond.club.SpondClub for the Spond Club finance API.

 1"""Unofficial Python SDK for the Spond API.
 2
 3The main entry point is `spond.spond.Spond` for general account/event/group/
 4messaging access, and `spond.club.SpondClub` for the Spond Club finance API.
 5"""
 6
 7from typing import Any, TypeAlias
 8
 9JSONDict: TypeAlias = dict[str, Any]
10"""Simple alias for type hinting `dict`s that can be passed to/from JSON-handling functions."""
11
12
13class AuthenticationError(Exception):
14    """Raised when login to the Spond API fails.
15
16    Typical causes:
17
18    - Incorrect username/password.
19    - 2FA enabled on the account (the library does not currently support
20      Spond's TOTP flow).
21    - The account has hit Spond's login rate limit (`outOfLoginAttempts`).
22    - The Spond login API has changed shape and the response no longer
23      contains an `accessToken`.
24
25    The exception message includes any of the response's whitelisted
26    diagnostic fields (`error`, `errorKey`, `errorCode`, `message`) so
27    most error cases are self-explanatory. Other response fields — such
28    as 2FA challenge tokens and (masked) `phoneNumber` — are intentionally
29    dropped from the message to avoid leaking them into application logs.
30    """
31
32    pass
JSONDict: TypeAlias = dict[str, typing.Any]

Simple alias for type hinting dicts that can be passed to/from JSON-handling functions.

class AuthenticationError(builtins.Exception):
14class AuthenticationError(Exception):
15    """Raised when login to the Spond API fails.
16
17    Typical causes:
18
19    - Incorrect username/password.
20    - 2FA enabled on the account (the library does not currently support
21      Spond's TOTP flow).
22    - The account has hit Spond's login rate limit (`outOfLoginAttempts`).
23    - The Spond login API has changed shape and the response no longer
24      contains an `accessToken`.
25
26    The exception message includes any of the response's whitelisted
27    diagnostic fields (`error`, `errorKey`, `errorCode`, `message`) so
28    most error cases are self-explanatory. Other response fields — such
29    as 2FA challenge tokens and (masked) `phoneNumber` — are intentionally
30    dropped from the message to avoid leaking them into application logs.
31    """
32
33    pass

Raised when login to the Spond API fails.

Typical causes:

  • Incorrect username/password.
  • 2FA enabled on the account (the library does not currently support Spond's TOTP flow).
  • The account has hit Spond's login rate limit (outOfLoginAttempts).
  • The Spond login API has changed shape and the response no longer contains an accessToken.

The exception message includes any of the response's whitelisted diagnostic fields (error, errorKey, errorCode, message) so most error cases are self-explanatory. Other response fields — such as 2FA challenge tokens and (masked) phoneNumber — are intentionally dropped from the message to avoid leaking them into application logs.