--- id: stups-tokens version: "1.1.19" license: Apache License Version 2.0 license_treatment: permissive maintenance: abandoned --- # stups-tokens — Python library to manage OAuth access tokens License: permissive · Maintenance: abandoned · Downloads: 144.2K/mo ## 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 above — 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 pip install stups-tokens uv add stups-tokens poetry add stups-tokens ## Installing 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: unspecified - Install friction: low - Maintenance: abandoned - Downloads: 144.2K/month (top 15,000 on PyPI) - Known vulnerabilities: none known ## Tags oauth token management, access token refresh, oauth2 token caching, bearer token handler, credential management python, oauth2, token-management, legacy [View on SkillFed](https://skillfed.io/packages/stups-tokens) · [View on PyPI](https://pypi.org/project/stups-tokens/)