Registry / auth-security / decorative-secrets

decorative-secrets

JSON →
library0.12.14pypypiunverified

A library providing decorators for multi-source secret retrieval, allowing secrets to be fetched from environment variables, files, AWS Secrets Manager, and other backends. Current version is 0.12.14. Release cadence is irregular with frequent minor version bumps.

pip install decorative-secrets
INSTALL
IMPORT
SIG · DECORATIVE-SECRETS
D
decorative-secrets
auth-securitypythonv0.12.14
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

secret
✓ from decorative_secrets import secret
✗ from decorative_secrets import secret

Retrieve a secret from an environment variable using the @secret decorator.

import os os.environ['MY_SECRET_KEY'] = 'my-secret-value' from decorative_secrets import secret @secret('MY_SECRET_KEY') def get_secret(val): return val print(get_secret())
Debug
Known issues
gotchaThe 'secret' decorator returns the secret value as the first argument to the decorated function. If you don't expect an argument, your function will receive an extra argument.
fix
Define your function with a parameter to accept the secret, e.g., `def func(secret_value):`.
affects: >=0.10.0
deprecatedThe 'from_env' backend (used with `@secret('KEY', from_env=True)`) is deprecated in favor of the default behavior where environment variable keys are automatically detected.
fix
Remove the `from_env=True` argument; just pass the environment variable name directly.
affects: >=0.12.0
gotchaUsing a period (.) in the key name may be misinterpreted as nesting. For example, 'my.secret' might be parsed as a path instead of a literal key.
fix
Use underscores or other characters instead of periods, or wrap the key in quotes and use explicit backend configuration.
affects: >=0.10.0
Upgrade
Version history
0.12.14latest on PyPI · released Apr 23, 2026
Audit
Dependencies
boto3optionalRequired for AWS Secrets Manager backend
Agent activity
21 hits · last 30 days
node
20
OpenAI (training)
1
Resources
decorative-secrets — pip install decorative-secrets · libregistry