Skip to main content

Load configuration from the environment for your python app.

Project description

PyPI version Build Status codecov

DEPRECATED

This package is deprecated. pydantic provides the same featureset and much more.

Python set-ings

Load configuration from the environment for your python app. Supports typecasting and default values. Settings are made available in a way which plays nicely with IDEs and is easy to read.

Installation

  • pipenv install python-set-ings or pip install python-set-ings

Usage

# my_app/settings.py

from set_ings import Property
from set_ings import Settings as SettingsBase


Settings(SettingsBase):
    _PREFIX = 'YOUR_PREFIX'

    FOO = Property(10, cast=int)
    BAR = Property()


settings = Settings()

Then make sure you set the environment variables defined in your settings. For the example above you would have to set YOUR_PREFIX_BAR and optionally YOUR_PREFIX_FOO.

To use the settings anywhere in your app:

from my_app.settings import settings

print(settings.FOO + 2)

Contributing

Installation

  • git clone git@github.com:evocount/python-set-ings.git
  • cd python-set-ings
  • pipenv install --dev

Running tests

  • pipenv run pytest --cov

License

This project is licensed under 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

python-set-ings-0.2.2.tar.gz (4.5 kB view details)

Uploaded Source

Built Distribution

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

python_set_ings-0.2.2-py2.py3-none-any.whl (4.3 kB view details)

Uploaded Python 2Python 3

File details

Details for the file python-set-ings-0.2.2.tar.gz.

File metadata

  • Download URL: python-set-ings-0.2.2.tar.gz
  • Upload date:
  • Size: 4.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.0.1 requests-toolbelt/0.9.1 tqdm/4.28.1 CPython/3.7.3

File hashes

Hashes for python-set-ings-0.2.2.tar.gz
Algorithm Hash digest
SHA256 7a6f697b1a882311d4db94820304ecbe9681f85a89cefec830087276a0c833c0
MD5 c35d05153813467791d1e0051ab2d3a5
BLAKE2b-256 b428e48ea296bd424f3f58b7179d15bc70cda992e1e7c6eb07485b3b859a8f3d

See more details on using hashes here.

File details

Details for the file python_set_ings-0.2.2-py2.py3-none-any.whl.

File metadata

  • Download URL: python_set_ings-0.2.2-py2.py3-none-any.whl
  • Upload date:
  • Size: 4.3 kB
  • Tags: Python 2, Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.0.1 requests-toolbelt/0.9.1 tqdm/4.28.1 CPython/3.7.3

File hashes

Hashes for python_set_ings-0.2.2-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 eb8a0c1d5e3b57456cfd0f1255556cf392f5dc3376fe4fba8e7ea97c7b47f58d
MD5 72609b0a2b24dbbfb6ed7146db8f9eff
BLAKE2b-256 3942160fcd04534f26e55c9ab032cf566e85b215d831c42860b1399d4d0436b1

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