Skip to main content

PyPI version Python version License Tests

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)

Source distribution for allegro-auth 2.2.0
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

Release history Release notifications | RSS feed

This release

2.2.0 This release

1 release file

2.1.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page