Module: types

class omemo.types.AsyncFramework(*values)[source]

Bases: Enum

Frameworks for asynchronous code supported by python-omemo.

ASYNCIO = 'ASYNCIO'
TWISTED = 'TWISTED'
class omemo.types.DeviceInformation(namespaces, active, bare_jid, device_id, identity_key, trust_level_name, label)[source]

Bases: NamedTuple

Structure containing information about a single OMEMO device.

Parameters:
namespaces: FrozenSet[str]

Alias for field number 0

active: FrozenSet[Tuple[str, bool]]

Alias for field number 1

bare_jid: str

Alias for field number 2

device_id: int

Alias for field number 3

identity_key: bytes

Alias for field number 4

trust_level_name: str

Alias for field number 5

label: str | None

Alias for field number 6

exception omemo.types.OMEMOException[source]

Bases: Exception

Parent type for all custom exceptions in this library.

class omemo.types.SignedLabel(label, signature)[source]

Bases: NamedTuple

Structure containing a device label and the corresponding signature.

Parameters:
label: str

Alias for field number 0

signature: bytes

Alias for field number 1

class omemo.types.TrustLevel(*values)[source]

Bases: Enum

The three core trust levels.

TRUSTED = 'TRUSTED'
DISTRUSTED = 'DISTRUSTED'
UNDECIDED = 'UNDECIDED'

Type Aliases

omemo.types.DeviceList

alias of Dict[int, SignedLabel | None]

omemo.types.JSONType

alias of Mapping[str, JSONType] | List[JSONType] | str | int | float | bool | None