Client library for ExtraSuite - secure OAuth token exchange for CLI tools
Project description
extrasuite
Python client library for ExtraSuite - secure OAuth token exchange for AI agents and CLI tools.
Installation
pip install extrasuite
Quick Start
CLI Authentication
# Login (opens browser for OAuth)
python -m extrasuite.client login
# Or using the console script
extrasuite login
# Logout (clears cached credentials)
python -m extrasuite.client logout
Programmatic Usage
from extrasuite.client import authenticate
# Get a token - opens browser for authentication if needed
token = authenticate()
# Use the token with Google APIs
import gspread
from google.oauth2.credentials import Credentials
creds = Credentials(token.access_token)
gc = gspread.authorize(creds)
sheet = gc.open("My Spreadsheet").sheet1
Configuration
Authentication can be configured via:
- Constructor parameters (highest priority)
- Environment variables
- Gateway config file
~/.config/extrasuite/gateway.json(created by skill installation)
Environment Variables
| Variable | Description |
|---|---|
EXTRASUITE_AUTH_URL |
URL to start authentication flow |
EXTRASUITE_EXCHANGE_URL |
URL to exchange auth code for token |
SERVICE_ACCOUNT_PATH |
Path to service account JSON file (alternative auth) |
Using CredentialsManager
For more control, use the CredentialsManager class directly:
from extrasuite.client import CredentialsManager
manager = CredentialsManager(
auth_url="https://your-server.example.com/api/token/auth",
exchange_url="https://your-server.example.com/api/token/exchange",
)
token = manager.get_token()
print(f"Service account: {token.service_account_email}")
print(f"Expires in: {token.expires_in_seconds()} seconds")
Service Account Mode
For non-interactive environments, you can use a service account file:
from extrasuite.client import CredentialsManager
manager = CredentialsManager(service_account_path="/path/to/service-account.json")
token = manager.get_token()
Note: Service account mode requires the google-auth package:
pip install google-auth
Token Storage
Tokens are securely stored in the OS keyring:
- macOS: Keychain
- Windows: Credential Locker
- Linux: Secret Service (via libsecret)
How It Works
- When you call
authenticate()orget_token(), the client checks the OS keyring for a cached token - If no valid cached token exists, it starts a local HTTP server and opens your browser
- After authentication with the ExtraSuite server, the browser redirects back with an auth code
- The client exchanges the auth code for a short-lived access token
- The token is cached in the OS keyring for subsequent calls
Tokens are short-lived (1 hour) and automatically refreshed when expired.
API Reference
authenticate()
Convenience function to get a token with minimal code.
from extrasuite.client import authenticate
token = authenticate(
auth_url=None, # Optional: override auth URL
exchange_url=None, # Optional: override exchange URL
service_account_path=None, # Optional: use service account instead
force_refresh=False, # Force re-authentication
)
Token
The token object returned by authentication.
token.access_token # The OAuth2 access token string
token.service_account_email # Email of the service account
token.expires_at # Unix timestamp when token expires
token.is_valid() # Check if token is still valid
token.expires_in_seconds() # Seconds until expiration
Requirements
- Python 3.10+
- Dependencies:
keyring,certifi
For Google Sheets/Docs/Slides integration:
pip install gspread google-auth
License
MIT - Copyright (c) 2026 Think41 Technologies Pvt. Ltd.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file extrasuite-0.5.3.tar.gz.
File metadata
- Download URL: extrasuite-0.5.3.tar.gz
- Upload date:
- Size: 16.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
885def4d653974ae565266f265d99e7d824448dd8be5f9a5dcdf16664c73aae8
|
|
| MD5 |
20f46cc17efef74fff6935348adc4c2d
|
|
| BLAKE2b-256 |
76871110deb442fa4ecb105e817c35c4cd510910986aff4f167fb8ba6d41e52e
|
Provenance
The following attestation bundles were made for extrasuite-0.5.3.tar.gz:
Publisher:
publish-extrasuite.yml on think41/extrasuite
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
extrasuite-0.5.3.tar.gz -
Subject digest:
885def4d653974ae565266f265d99e7d824448dd8be5f9a5dcdf16664c73aae8 - Sigstore transparency entry: 943947002
- Sigstore integration time:
-
Permalink:
think41/extrasuite@050ebf4c6f00c5029546755b725901fd97d56779 -
Branch / Tag:
refs/tags/extrasuite-v0.5.3 - Owner: https://github.com/think41
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish-extrasuite.yml@050ebf4c6f00c5029546755b725901fd97d56779 -
Trigger Event:
push
-
Statement type:
File details
Details for the file extrasuite-0.5.3-py3-none-any.whl.
File metadata
- Download URL: extrasuite-0.5.3-py3-none-any.whl
- Upload date:
- Size: 18.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
42978ab32d429ce9e59e87ec4ede0d8b3763d367538b9c9b0a377396e929a8ab
|
|
| MD5 |
c72e05ee84590fe6708ab559ae5c6a4b
|
|
| BLAKE2b-256 |
fb528da97c74ba135d0ea1dbf782bf74ed5045ee5c5d2b2b92874face3d44bec
|
Provenance
The following attestation bundles were made for extrasuite-0.5.3-py3-none-any.whl:
Publisher:
publish-extrasuite.yml on think41/extrasuite
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
extrasuite-0.5.3-py3-none-any.whl -
Subject digest:
42978ab32d429ce9e59e87ec4ede0d8b3763d367538b9c9b0a377396e929a8ab - Sigstore transparency entry: 943947019
- Sigstore integration time:
-
Permalink:
think41/extrasuite@050ebf4c6f00c5029546755b725901fd97d56779 -
Branch / Tag:
refs/tags/extrasuite-v0.5.3 - Owner: https://github.com/think41
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish-extrasuite.yml@050ebf4c6f00c5029546755b725901fd97d56779 -
Trigger Event:
push
-
Statement type: