Python 3 library providing foundations for Annotell Authentication
on top of the
pip install annotell-auth[requests] or
pip install annotell-auth[httpx]
Builds on the standard OAuth 2.0 Client Credentials flow. There are a few ways to provide auth credentials to our api
clients. Annotell Python clients such as in
annotell-input-api accept an
auth parameter that
can be set explicitly or you can omit it and use environment variables.
There are a few ways to set your credentials in
- Set the environment variable
ANNOTELL_CREDENTIALSto point to your Annotell Credentials file. The credentials will contain the Client Id and Client Secret.
- Set to the credentials file path like
- Set environment variables
- Set to credentials tuple
API clients such as the
InputApiClient accept this
Under the hood, they commonly use the AuthSession class which is implements a
requests session with automatic token
httpx implementation is also available.
from annotell.auth.requests.auth_session import RequestsAuthSession sess = RequestsAuthSession() # make call to some Annotell service with your token. Use default requests sess.get("https://api.annotell.com")
Refactor for backend separation, with optional dependencies for either
- Initial support for httpx (BETA). Solves refresh token expiry by reset without the
- The library will be refactored by a breaking 2.0 release, and make the same changes to the requests version.
authsessionmodule backed by
requestsis untouched for now.
- Fix compatibility issue with authlib >= 1.0.0. Resetting the auth session failed, when the refresh token had expired.
- Expose underlying
- Fix some thread locks
FaultTolerantAuthRequestSessionthat handles token refresh on long running sessions.
- Add support for
authparameter, with path to credentials file or
- Drop support for legacy API token
Release history Release notifications | RSS feed
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Hashes for annotell_auth-2.0.1-py2.py3-none-any.whl