aiologto
Unofficial Asyncronous Python Client for Logto
Features
- Unified Asyncronous and Syncronous Python Client for Logto
- Supports Python 3.6+
- Strongly Typed with Pydantic
- Includes Function Wrappers to quickly add to existing projects
- Utilizes Environment Variables for Configuration
Installation
# Install from PyPI
pip install aiologto
# Install from source
pip install git+https://github.com/GrowthEngineAI/aiologto.git
Usage
WIP - Simple Usage Example
import asyncio
from aiologto import Logto, UserListResponse
from aiologto.utils import logger
"""
Environment Vars that map to Logto.configure:
all vars are prefixed with LOGTO_
LOGTO_URL (url): str takes precedence over LOGTO_SCHEME | LOGTO_HOST | LOGTO_PORT
LOGTO_SCHEME (scheme): str - defaults to 'http://'
LOGTO_HOST (host): str - defaults to None
LOGTO_PORT (port): int - defaults to 3000
LOGTO_APP_ID (app_id): str
LOGTO_APP_SECRET (app_secret): str
LOGTO_RESOURCE (resource): str - defaults to "https://api.logto.io"
LOGTO_OIDC_GRANT_TYPE (oidc_grant_Type): str - defaults to "client_credentials"
## these variables are dynamically generated from the oidc
LOGTO_ACCESS_TOKEN (access_token): str - defaults to None
LOGTO_TOKEN_TYPE (token_type): str - defaults to None
LOGTO_JWT_ALGORITHMS (jwt_algorithms): str - defaults to None
LOGTO_JWT_OPTIONS (jwt_options): dict - defaults to {"verify_at_hash": False}
LOGTO_JWT_ISSUER (jwt_issuer): str - defaults to generated value
LOGTO_TIMEOUT (timeout): int - defaults to 10
LOGTO_IGNORE_ERRORS (ignore_errors): bool = defaults to False
"""
Logto.configure(
url = '...',
app_id = "...",
app_secret = "...",
debug_enabled = True,
)
async def fetch_users():
# Fetch all the users
users: UserListResponse = await Logto.users.async_list()
logger.info(f"Users: {users}")
# Update a specific user
user = users[0]
user.custom_data["email"] = "gexai@example.com"
user = await Logto.users.async_update(user)
logger.info(f"User Updated: {user.dict()}")
asyncio.run(fetch_users())
Metadata
Release files for aiologto 0.0.6
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 | |
|---|---|---|---|---|
| aiologto-0.0.6.tar.gz | 16.5 kB | Without provenance | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| aiologto-0.0.6-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 36.1 kB
Release files / aiologto-0.0.6.tar.gz
| Download URL | aiologto-0.0.6.tar.gz |
|---|---|
| Size | 16.5 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
2dfa57c0d22ea186a1e7a8678ba71b4ab2e106f2d0ec10ea4e89a436e4c54113
|
|
BLAKE2b-256 checksum How to use checksums |
9eb8a68bf3366886bf947d8ca7dbc78fd117613c9b206a5eaca52cb04c723cf5
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.2 CPython/3.9.16
|
Release files / aiologto-0.0.6-py3-none-any.whl
| Download URL | aiologto-0.0.6-py3-none-any.whl |
|---|---|
| Size | 19.6 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
7138487ba373c0dc7cbcb6f7ffdd7b145ac46d5c00e736cf7ef85da895c4d64b
|
|
BLAKE2b-256 checksum How to use checksums |
598e87fb0fdc847b3f7b55307ff4d53470e6808fc1842d15b3d099c256c29bea
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.2 CPython/3.9.16
|
Security for aiologto 0.0.6
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.