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
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 allegro_auth-2.1.0.tar.gz.
File metadata
- Download URL: allegro_auth-2.1.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 |
0a6396bdfd13e4eab7f9d3b899c9f4ff55e663e51fcdfc63a1f0907790e9f477
|
|
| MD5 |
374eb1b0a9f70683c5fd451f65b55167
|
|
| BLAKE2b-256 |
3b0c0156a4a55592d1e0aefcd633f3f718cf7c1090a3fd79cf6e66b29428941d
|
File details
Details for the file allegro_auth-2.1.0-py3-none-any.whl.
File metadata
- Download URL: allegro_auth-2.1.0-py3-none-any.whl
- Upload date:
- Size: 5.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.11.1
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
d774231b088424501efe5614538526aa7cc1b34ea64d84ea044740dcc82e24e7
|
|
| MD5 |
4d62b62c8c348279f82e7ec2edd78649
|
|
| BLAKE2b-256 |
0c577e59967242aaee3fa2e776b2560f587008ad31d189a766562669d1ae3b64
|