aws-secretsmanager-caching
Client-side AWS Secrets Manager caching library
What it is and what it does
This package provides a client-side caching layer for AWS Secrets Manager that stores retrieved secrets in memory, reducing repeated API calls to AWS. It wraps botocore to handle secret retrieval and caching logic, allowing applications to configure cache size, refresh intervals, and retry behavior for failed requests.
The library is designed for Python applications that need to access secrets frequently without incurring the latency and cost of repeated AWS API calls. It includes decorators to inject secrets directly into function arguments and supports both simple string secrets and JSON-based secret objects. Configuration options control cache size, refresh timing, and exception retry strategies.
Use it for:
- Reduce API call volume in applications that access the same secrets multiple times during request handling.
- Inject database credentials or API keys into function parameters using decorators without explicit secret retrieval code.
- Configure automatic secret refresh intervals to balance freshness with API call reduction.
- Handle transient AWS API failures with exponential backoff retry logic before surfacing errors to the application.
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
Caches AWS Secrets Manager secrets in-process to reduce API calls and improve application performance when retrieving secrets repeatedly.
Yes. The package is actively maintained, has no known vulnerabilities, minimal dependencies, and solves a real problem for AWS-based Python applications. The permissive Apache 2.0 license and stable production status make it a low-risk addition. Install if your application retrieves secrets from AWS Secrets Manager more than occasionally.
Install
aws-secretsmanager-caching on PyPI
pip
pip install aws-secretsmanager-cachinguv
uv add aws-secretsmanager-cachingpoetry
poetry add aws-secretsmanager-cachingInstalling aws-secretsmanager-caching
Before you install
Low install friction with a single runtime dependency (botocore). Actively maintained with recent commits and stable production status.
License in practice
Licensed under Apache 2.0, a permissive license allowing commercial and private use with minimal restrictions.
Quickstart
pip install aws-secretsmanager-caching
import botocore.session
from aws_secretsmanager_caching import SecretCache, SecretCacheConfig
client = botocore.session.get_session().create_client('secretsmanager')
cache = SecretCache(config=SecretCacheConfig(), client=client)
secret = cache.get_secret_string('mysecret')
Requires Python 3.7 or newer and an AWS account with access to AWS Secrets Manager.
Verify before relying
- Whether the cache TTL and refresh interval defaults (3600 seconds) are suitable for typical secret rotation workflows.
- Performance impact of the configurable max_cache_size (default 1024) on memory usage in high-secret scenarios.
Package facts
| License | not declared (permissive) |
| Python support | supports the current Python release (>3.5) |
| Install friction | low — pure-Python wheel |
| Runtime dependencies | 1 — botocore |
| Maintenance | actively maintained — 785 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 2,928,556/month — #2,820 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: aws_secretsmanager_caching-1.1.3-py3-none-any.whl
Keywords: secretsmanager, secrets, manager, development, cache, caching, client
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
aws-cdk.aws-secretsmanagerAWS CDK construct library for provisioning and…
permissive · top 15,000 on PyPI
ibm-secrets-manager-sdkA Python client library for programmatically…
permissive · top 15,000 on PyPI
keeper-secrets-manager-corePython SDK for Keeper Secrets Manager that…
permissive · top 15,000 on PyPI
cerberus-python-clientA Python client library for reading and writing…
permissive · top 5,000 on PyPI
credstashCredStash stores and retrieves secrets using…
permissive · top 15,000 on PyPI
infisicalsdkFetch and manage secrets from Infisical, an…
unclear · top 5,000 on PyPI
azure-keyvault-secretsSecurely store, retrieve, and manage secrets…
permissive · top 1,000 on PyPI
mypy-boto3-secretsmanagerProvides type annotations and IDE autocomplete…
permissive · top 5,000 on PyPI
ssm-parameter-storeWrapper for AWS Systems Manager Parameter Store…
permissive · top 15,000 on PyPI
cachierCachier is a decorator that adds persistent,…
permissive · top 15,000 on PyPI