Python client library for ExtraSuite's v2 session-token authentication flow.
pip install extrasuiteUse one of these:
EXTRASUITE_SERVER_URL=https://your-server.example.com~/.config/extrasuite/gateway.jsoncontaining{"EXTRASUITE_SERVER_URL": "https://your-server.example.com"}CredentialsManager(server_url="https://your-server.example.com")CredentialsManager(service_account_path="/path/to/service-account.json")
from extrasuite.client import CredentialsManager
manager = CredentialsManager(server_url="https://your-server.example.com")
credential = manager.get_credential(
command={"type": "sheet.pull", "file_url": "https://docs.google.com/..."},
reason="User asked to inspect the spreadsheet",
)
print(credential.kind)
print(credential.service_account_email)
print(credential.expires_in_seconds())CredentialsManageropensGET /api/token/auth?port=<port>in the browser when no valid session exists- The browser is redirected to localhost with a short-lived auth code
- The client exchanges that code at
POST /api/auth/session/exchange - The returned session token is stored in
~/.config/extrasuite/session.json - Each command exchanges the session token at
POST /api/auth/token
Credential cache files are stored under ~/.config/extrasuite/credentials/.
For non-interactive environments:
from extrasuite.client import CredentialsManager
manager = CredentialsManager(service_account_path="/path/to/service-account.json")This mode requires:
pip install google-auth