Skip to content

Client

A connection to a specific ODK Central server. Manages authentication and provides access to Central functionality through methods organized by the Central resource they are most related to.

Parameters:

Name Type Description Default
config_path str | None

Where to read the pyodk_config.toml. Defaults to the path in PYODK_CONFIG_FILE, then the user home directory.

None
cache_path str | None

Where to read/write pyodk_cache.toml. Defaults to the path in PYODK_CACHE_FILE, then the user home directory.

None
project_id int | None

The project ID to use for all client calls. Defaults to the "default_project_id" in pyodk_config.toml, or can be specified per call.

None
session Session | None

A prepared pyodk.session.Session class instance, or an instance of a customised subclass.

None
api_version str | None

The ODK Central API version, which is used in the URL path e.g. 'v1' in 'https://www.example.com/v1/projects'.

'v1'

close(*args)

Close the session.

open()

Enter the session, and authenticate.