Authdog Python SDK
Python SDK for Authdog authentication and user management.
Installation
pip install authdog
Usage
Basic Usage
from authdog import AuthdogClient
# Initialize the client
client = AuthdogClient(
base_url="https://api.authdog.com",
api_key="your-api-key" # Optional
)
# Get user information
try:
user_info = client.get_userinfo("your-access-token")
print(f"User: {user_info.user.display_name}")
print(f"Email: {user_info.user.emails[0].value}")
except AuthenticationError as e:
print(f"Authentication failed: {e}")
except APIError as e:
print(f"API error: {e}")
# Always close the client when done
client.close()
Using Context Manager
from authdog import AuthdogClient
with AuthdogClient("https://api.authdog.com") as client:
user_info = client.get_userinfo("your-access-token")
print(f"User: {user_info.user.display_name}")
API Reference
AuthdogClient
__init__(base_url: str, api_key: Optional[str] = None, timeout: float = 10.0)
Initialize the Authdog client.
base_url: The base URL of the Authdog APIapi_key: Optional management Bearer credential (userinfo still uses the access token)timeout: Request timeout in seconds (default 10)
health() -> Probe
GET /v1/health. Public; works without an API key.
Management namespaces
organizations, tenants, projects, environments, users,
groups, rbac, audit, events, webhooks,
notification_channels, service_accounts,
personal_access_tokens, and api_secrets wrap Waves 1–2 of the
public API. Example:
with AuthdogClient("https://api.authdog.com", api_key="ad_...") as client:
orgs = client.organizations.list()
users = client.users.list("ten_123", "env_456")
See specs/004-api-parity/ for the full catalog.
get_userinfo(access_token: str) -> UserInfoResponse
Get user information using an access token.
access_token: The access token for authentication- Returns:
UserInfoResponse(meta,session,user) with snake_case attributes (user.display_name,user.emails[0].value,session.remaining_seconds)
Exceptions
AuthdogError: Base exception for all Authdog SDK errorsAuthenticationError: Raised when authentication fails (401 responses)APIError: Raised when API requests fail
Development
# Install development dependencies
uv sync
# Run tests
uv run pytest
# Format code
uv run black authdog/
uv run isort authdog/
# Type checking
uv run mypy authdog/
Metadata
Release files for authdog 0.1.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| authdog-0.1.1.tar.gz | 15.5 kB | Without provenance | Details for authdog-0.1.1.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| authdog-0.1.1-py3-none-any.whl | Python 3 | none | any | Details for authdog-0.1.1-py3-none-any.whl |
Total release size: 25.6 kB
Release files / authdog-0.1.1.tar.gz
| Download URL | authdog-0.1.1.tar.gz |
|---|---|
| Size | 15.5 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
7c7283886421b3e45d86228bd18f965063ea93aee0d1e5f51d1f44a1be5d8638
|
|
BLAKE2b-256 checksum How to use checksums |
69ca75e922b43bec42fd87a4106529247e35feaeec8c19e91328cb82ecd57d40
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Release files / authdog-0.1.1-py3-none-any.whl
| Download URL | authdog-0.1.1-py3-none-any.whl |
|---|---|
| Size | 10.1 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
7dd94e15fa81ab43462fff4bc2882f3d5c69c363d26f53fbab903cbea08e6923
|
|
BLAKE2b-256 checksum How to use checksums |
3a027bb631e3c8055c28261ad00b19c2211f1029a7209c648bf6c2d0a1801502
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Security for authdog 0.1.1
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.