This Python package handles authentication with the Allegro API using OAuth2.
Project description
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
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
allegro_auth-2.2.0.tar.gz
(4.7 kB
view details)
File details
Details for the file allegro_auth-2.2.0.tar.gz.
File metadata
- Download URL: allegro_auth-2.2.0.tar.gz
- Upload date:
- Size: 4.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.11.1
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
4064407300a8653318ce51826cb5d0dda9c9efefbc97501df9ea0d25e5b673f0
|
|
| MD5 |
3d22026cc076c7640b1a44cf57ba0bbc
|
|
| BLAKE2b-256 |
9f67abfb379a635bfb9ced592073dc62736ea9255172f7271ee138e7e641f4f7
|