Allegro OAuth2 Authenticator
A lightweight Python package for handling OAuth2 authentication with the Allegro API.
Features
- Gets authorization code from Allegro
- Exchanges code for access and refresh tokens
- Automatically refreshes expired access tokens
- Validates tokens with Pydantic
- Stores tokens in
tokens.json
Requirements
- Python 3.9+
- Allegro developer account
Installation
pip install allegro_auth
Example Usage
from allegro_auth import AllegroAuth
allegro = AllegroAuth(
client_id="your_client_id",
client_secret="your_client_secret",
redirect_uri="your_redirect_uri"
)
token = allegro.authenticate()
On first run, you'll be prompted to open a URL and paste the authorization code.
Token Storage
Tokens are stored in a local tokens.json file and automatically refreshed when expired.
Location follows OS conventions via platformdirs:
License
This project is licensed under the MIT License.
Links
Release files for allegro-auth 2.2.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| allegro_auth-2.2.0.tar.gz | 4.7 kB | Details |
Release files / allegro_auth-2.2.0.tar.gz
| Download URL | allegro_auth-2.2.0.tar.gz |
|---|---|
| Size | 4.7 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
4064407300a8653318ce51826cb5d0dda9c9efefbc97501df9ea0d25e5b673f0
|
|
BLAKE2b-256 checksum How to use checksums |
9f67abfb379a635bfb9ced592073dc62736ea9255172f7271ee138e7e641f4f7
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.11.1
|