polars_cloud.authenticate#

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

Authenticate with Polars Cloud.

This will attempt to authenticate with Polars Cloud 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

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