calendaring_jmap: Package entry points#
get_jmap_client, get_async_jmap_client, and get_connection_params are the functions most code imports directly from calendaring_jmap.
- calendaring_jmap.get_jmap_client(**kwargs) JMAPClient | None[source]#
Create a
JMAPClientfrom configuration.Configuration is read in priority order:
Explicit keyword arguments (
url,username,password, …)Environment variables (
JMAP_URL,JMAP_USERNAME, …)A YAML config file (
~/.config/calendaring-jmap/calendar.yamlor equivalent)
Returns
Noneif no configuration is found, rather than raising.Example:
client = get_jmap_client(url="https://jmap.example.com/.well-known/jmap", username="alice", password="secret")
- calendaring_jmap.get_async_jmap_client(**kwargs) AsyncJMAPClient | None[source]#
Create an
AsyncJMAPClientfrom configuration.Accepts the same arguments and reads configuration from the same sources as
get_jmap_client(). ReturnsNoneif no configuration is found.Example:
async with get_async_jmap_client( url="https://jmap.example.com/.well-known/jmap", username="alice", password="secret" ) as client: calendars = await client.get_calendars()
- calendaring_jmap.get_connection_params(config_file: str | Path | None = None, **explicit_params: Any) dict[str, Any] | None[source]#
Resolve JMAP connection parameters from kwargs, env vars, or a config file.
- Parameters:
config_file – Explicit path to a YAML config file. Defaults to the
JMAP_CONFIG_FILEenvironment variable, then~/.config/calendaring-jmap/calendar.yaml.**explicit_params –
url,username,password,auth,auth_type,timeout. A value ofNoneis treated as “not supplied”, not “unset”: this lets a thin CLI wrapper pass every option through unconditionally without wiping out env vars for the ones the user left off.
- Returns:
A dict of connection parameters, or
Noneif no source yields a URL.
Everything else exported from calendaring_jmap (JMAPClient, AsyncJMAPClient, the calendar objects, and the error hierarchy) has its own page, listed below.