polars_nanook.authenticate#

polars_nanook.authenticate(
*,
client_id: str | None = None,
client_secret: str | None = None,
interactive: bool = True,
) → None#

Authenticate with Polars Nanook.

This will attempt to authenticate with Polars Nanook or redirect to login if no valid token is found. If the interactive flag is set to false the function will fail if no valid token was found without redirecting to login.

Parameters:
client_id

Optional client id for service account authentication

client_secret

Optional client secret for service account authentication

interactive

Fail in case no valid authentication method was found without redirecting to interactive login

See also

login

Login will force a new interactive login without using cached tokens

Examples

>>> pn.authenticate()  
>>> pn.authenticate(
...     client_id="CLIENT_ID", client_secret="CLIENT_SECRET"
... )