stups-tokens
Python library to manage OAuth access tokens
What it is and what it does
stups-tokens is a Python library for managing OAuth 2.0 access tokens, keeping them in memory and automatically refreshing them when they expire. It abstracts away token lifecycle management—you configure it with an OAuth endpoint and token scopes, then call tokens.get() to retrieve a valid token. The library handles expiration transparently, fetching a new token on the next call after expiry.
It supports three modes: fetching tokens from an OAuth 2.0 endpoint (the default), reading pre-generated tokens from files on disk, or injecting tokens via environment variables for local testing. This makes it useful for applications that need to authenticate with multiple OAuth-protected services without manually managing token refresh logic.
Use it for:
- Manage multiple service tokens with different scopes in a single application.
- Local development and testing by injecting fixed tokens via environment variables.
- Read pre-generated credentials from disk for applications running in restricted environments.
- Automate token refresh for long-running processes that interact with OAuth 2.0-protected services.
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
Manages OAuth 2.0 access tokens in memory, automatically refreshing expired tokens and optionally reading them from files or environment variables.
No, unless maintaining legacy Python 2.7 or 3.4–3.5 code. The package is abandoned (last release 2017-01-04, last commit 2019-03-19) and targets end-of-life Python versions. For new projects, use a modern OAuth library or your framework's built-in token handling. For existing deployments, evaluate whether migration is feasible.
Install
stups-tokens on PyPI
pip
pip install stups-tokensuv
uv add stups-tokenspoetry
poetry add stups-tokensInstalling stups-tokens
Before you install
Low install friction with no runtime dependencies. However, the package is abandoned—last release was 2017-01-04 and last commit 2019-03-19. It targets Python 2.7, 3.4, and 3.5, which are all end-of-life. Use only if maintaining legacy code.
License in practice
Licensed under Apache License Version 2.0 (permissive), allowing commercial and private use with minimal restrictions.
Quickstart
import tokens
tokens.configure(url='https://example.com/access_tokens')
tokens.manage('example', ['read', 'write'])
tokens.start()
token = tokens.get('example')
Requires OAUTH2_ACCESS_TOKEN_URL environment variable or explicit url parameter; CREDENTIALS_DIR may be needed depending on configuration mode.
Verify before relying
- Compatibility with modern Python versions beyond the declared 2.7, 3.4, and 3.5 support.
- Whether the package works with current OAuth 2.0 provider implementations and token endpoint changes since 2017.
- Active maintenance or security updates for production use.
Package facts
| License | Apache License Version 2.0 (permissive) |
| Python support | not specified |
| Install friction | low — pure-Python wheel |
| Runtime dependencies | none |
| Maintenance | abandoned — 3,509 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 144,229/month — #11,158 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: stups_tokens-1.1.19-py3-none-any.whl
Tags
More Security packages
Provides Python bindings to the FreeDesktop.org…
permissive · top 1,000 on PyPI
msalMSAL for Python handles OAuth2 and OpenID…
permissive · top 1,000 on PyPI
joserfcjoserfc implements JOSE standards (JWS, JWE,…
permissive · top 1,000 on PyPI
AuthlibAuthlib provides a complete implementation of…
permissive · top 1,000 on PyPI
argon2-cffi-bindingsProvides low-level CFFI bindings to the…
permissive · top 1,000 on PyPI
adalADAL for Python authenticates applications with…
permissive · top 1,000 on PyPI
stups-cli-supportProvides shared command-line interface…
permissive · top 15,000 on PyPI
stups-zignZign is a command-line utility for OAuth2 token…
permissive · top 15,000 on PyPI
requests-oauth2clientAn OAuth 2.x client for Python that obtains,…
permissive · top 5,000 on PyPI
oauth2-clientHandles OAuth2 authentication flows…
unclear · top 15,000 on PyPI
requests-oauthlibAdds OAuth 1 and OAuth 2 authentication support…
permissive · top 1,000 on PyPI
requests-authAdds OAuth2, API key, Basic, and NTLM…
permissive · top 15,000 on PyPI
django-oauth-toolkitAdds OAuth2 authorization server capabilities…
permissive · top 5,000 on PyPI
google-oauthImplements Google OAuth2 authentication for…
permissive · top 15,000 on PyPI
requests-kerberosAdds Kerberos/GSSAPI authentication support to…
permissive · top 5,000 on PyPI
Flask-OAuthlibFlask-OAuthlib adds OAuth 1.0a and OAuth 2.0…
permissive · top 15,000 on PyPI