Skip to main content
Join the official 2019 Python Developers SurveyStart the survey!

AWS Extensions for Python Decouple

Project description

Latest PyPI version

Python Decouple AWS helps you to organize and access sensitive information on AWS Secrets Manager.

It also makes it easy for you to:

  1. Not repeat the boto3 boilerplate code;
  2. Define default values;
  3. Use os.environ as fall back;

Supports Python 3.4+

Why

  • Single place to save all secrets (AWS Secrets Manager)
  • Keep sensitive information away from code and environments
  • Simpler API to access AWS Secrets Manager (rather than boto3)

Installation

pip install python-decouple-aws

Usage example 1

#  settings.py
from decouple_aws import get_config

# The package provides a wrapper function that will
# fallback to environment variables and fail gracefully
# if AWS Secrets Manager is not accessible for whatever
# reason.
config = get_config('your-project/secret/name', 'ap-southeast-2')

# Use decouple config like normal
MY_EMAIL_USER = config('MY_EMAIL_USER', 'default-user')
MY_EMAIL_PASS = config('MY_EMAIL_PASS')

Usage example 2

# settings.py
from decouple import Config
from decouple_aws import RepositoryAwsSecretManager

# if you would like it to fail if secrets
# manager is inaccessible, you can build it manually.
# initialise the config with the AWS repository
# Pass the repo your secret name and the region
repo = RepositoryAwsSecretManager('your-project/secret/name', 'ap-southeast-2')
config = Config(repo)

# Use decouple config like normal
MY_SUPER_SECRET_SETTING = config('MY_SUPER_SECRET_SETTING')

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Files for python-decouple-aws, version 0.3.2
Filename, size File type Python version Upload date Hashes
Filename, size python_decouple_aws-0.3.2-py3-none-any.whl (5.4 kB) File type Wheel Python version py3 Upload date Hashes View hashes
Filename, size python-decouple-aws-0.3.2.tar.gz (3.5 kB) File type Source Python version None Upload date Hashes View hashes

Supported by

Elastic Elastic Search Pingdom Pingdom Monitoring Google Google BigQuery Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN SignalFx SignalFx Supporter DigiCert DigiCert EV certificate StatusPage StatusPage Status page