Skip to main content

Adapter based configuration handler (supports ENV and AWS SSM).

Project description

blinkist-config-python

The package simplifies accessing different configuration stores. The current supported stores are: ENV - read from the application's environment variable SSM - read from the AWS SSM Parameter Store

Usage

ENV

import blinkistconfig.Config

# Setup the Config to use the ENV as config store
config = blinkistconfig.Config(env="development", app_name="my_nice_app", adapter_type="ENV")

my_config_value = config.get("some/folder/config")

# This is being translated to ENV["SOME_FOLDER_CONFIG"]

SSM

For SSM this tool simulates namespace/directory functionality with each application having its own. By default requesting a parameter myparam1 within the application called my_nice_app will query the SSM parameter store for /application/my_nice_app/myparam1.

This harmonizes nicely with the ability of the SSM param store to do a prefix search. The /application/my_nice_app prefix is the default "private" scope.

import blinkistconfig.Config

# setup the Config to use the SSM as config store
config = blinkistconfig.Config(env="development", adapter_type="SSM", app_name="my_nice_app")

my_config_value = config.get("some/folder/config")

# This will try to get a parameter from SSM at "/application/my_nice_app/some/folder/config"

It is also possible to also have other scopes, possibly shared between the applications. For example

my_config_value = config.get("another/config", scope="global")

# This will replace `my_nice_app` with `global` and try to resolve "/application/global/another/config"

Development

To install development requirements

pip install -r requirements/dev.txt
pip install -e .

To run tests

AWS_DEFAULT_REGION="us-east-1" pytest --spec

Contributing

Bug reports and pull requests are welcome on GitHub at https://github.com/blinkist/blinkist-config-python.

License

The package is available as open source under the terms of the MIT License.

Project details


Download files

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

Source Distribution

blinkistconfig-0.0.4.tar.gz (3.6 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

blinkistconfig-0.0.4-py3-none-any.whl (5.7 kB view details)

Uploaded Python 3

File details

Details for the file blinkistconfig-0.0.4.tar.gz.

File metadata

  • Download URL: blinkistconfig-0.0.4.tar.gz
  • Upload date:
  • Size: 3.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.11.0 pkginfo/1.4.2 requests/2.19.1 setuptools/40.4.3 requests-toolbelt/0.8.0 tqdm/4.25.0 CPython/3.6.5

File hashes

Hashes for blinkistconfig-0.0.4.tar.gz
Algorithm Hash digest
SHA256 71ea542090f4ef8423320be9a5ef34dac94b7765aabb10804aac4fc447698d54
MD5 c5ca348830b8ef25dccba0a85a9c7aa7
BLAKE2b-256 0b9782ec35f18d4345ca6f22939918a35dc36fb981ab21112efa3f3c04b42cab

See more details on using hashes here.

File details

Details for the file blinkistconfig-0.0.4-py3-none-any.whl.

File metadata

  • Download URL: blinkistconfig-0.0.4-py3-none-any.whl
  • Upload date:
  • Size: 5.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.11.0 pkginfo/1.4.2 requests/2.19.1 setuptools/40.4.3 requests-toolbelt/0.8.0 tqdm/4.25.0 CPython/3.6.5

File hashes

Hashes for blinkistconfig-0.0.4-py3-none-any.whl
Algorithm Hash digest
SHA256 474ba59adb549e197da43b0db2eff66ca23da71888d14d62f5ca5da3eea2b31a
MD5 fd3863686b798eef9045d696ffcf7eeb
BLAKE2b-256 dc51dbd83720af8571c8ad10626185c0244722ffc86b5039a065cae752a22220

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page