Skip to content

Authentication

JWT auth: acquire and persist scoped access tokens via get_token().

get_token(email, password, scopes=('user',), *, base_url=None, api_path=None, config_file=None, save_token=True)

Obtain a JWT access token via email/password credentials.

Configuration is resolved from three sources in priority order (highest to lowest): code-level arguments → ineepy.toml in the current directory → INEEPY_* environment variables.

Parameters:

Name Type Description Default
email str

User email address.

required
password str

User password.

required
scopes str | Iterable[str]

Scope name, or an iterable of scope names, to request. Defaults to ('user',).

('user',)
base_url str | None

API base URL. Defaults to config/env INEEPY_BASE_URL (default https://ineep-lakehouse-prod.exe.xyz).

None
api_path str | None

API path prefix. Defaults to config/env INEEPY_API_PATH (default /api/v0).

None
config_file str | Path | None

Path to the TOML config file (str or Path). Defaults to ineepy.toml in the current working directory.

None
save_token bool

When True (default), also writes base_url, api_path, and the token to ineepy.toml so a bare Ineepy()/AsyncIneepy() can be constructed later with no arguments.

True

Returns:

Type Description
str

The access token string. When save_token=True it is also

str

written to ineepy.toml.

Raises:

Type Description
ValidationError

The server rejected the credentials, or the response did not contain an access token.

ForbiddenError

The requested scopes exceed what the account is allowed.

Example::

token = get_token('me@example.com', 'password', save_token=False)

async_get_token(email, password, scopes=('user',), *, base_url=None, api_path=None, config_file=None, save_token=True) async

Async version of :func:get_token.