swpt_uris module

This module implements functions for creating and parsing URI with the swpt:// schema.

swpt_pythonlib.swpt_uris.make_account_uri(debtor_id: int, account_id: str) str

Return a valid SWPT account URI.

Raises ValueError if the passed debtor_id or account_id is invalid.

swpt_pythonlib.swpt_uris.make_debtor_uri(debtor_id: int) str

Return a valid SWPT debtor URI.

Raises ValueError if the passed debtor_id is invalid.

swpt_pythonlib.swpt_uris.parse_account_uri(uri: str) Tuple[int, str]

Return a (debtor ID, account ID) tuple.

Raises ValueError if the passed URI does not represent a valid SWPT account.

swpt_pythonlib.swpt_uris.parse_debtor_uri(uri: str) int

Return a debtor ID.

Raises ValueError if the passed URI does not represent a valid SWPT debtor.