معرفی شرکت ها


config-yourself-1.0.2


Card image cap
تبلیغات ما

مشتریان به طور فزاینده ای آنلاین هستند. تبلیغات می تواند به آنها کمک کند تا کسب و کار شما را پیدا کنند.

مشاهده بیشتر
Card image cap
تبلیغات ما

مشتریان به طور فزاینده ای آنلاین هستند. تبلیغات می تواند به آنها کمک کند تا کسب و کار شما را پیدا کنند.

مشاهده بیشتر
Card image cap
تبلیغات ما

مشتریان به طور فزاینده ای آنلاین هستند. تبلیغات می تواند به آنها کمک کند تا کسب و کار شما را پیدا کنند.

مشاهده بیشتر
Card image cap
تبلیغات ما

مشتریان به طور فزاینده ای آنلاین هستند. تبلیغات می تواند به آنها کمک کند تا کسب و کار شما را پیدا کنند.

مشاهده بیشتر
Card image cap
تبلیغات ما

مشتریان به طور فزاینده ای آنلاین هستند. تبلیغات می تواند به آنها کمک کند تا کسب و کار شما را پیدا کنند.

مشاهده بیشتر

توضیحات

A python library to decrypt config-yourself files
ویژگی مقدار
سیستم عامل -
نام فایل config-yourself-1.0.2
نام config-yourself
نسخه کتابخانه 1.0.2
نگهدارنده []
ایمیل نگهدارنده []
نویسنده Will Richard
ایمیل نویسنده william.richard@blinkhealth.com
آدرس صفحه اصلی https://github.com/blinkhealth/config-yourself-python
آدرس اینترنتی https://pypi.org/project/config-yourself/
مجوز Apache License 2.0
# config-yourself-python [![CircleCI](https://circleci.com/gh/blinkhealth/config-yourself-python.svg?style=svg)](https://circleci.com/gh/blinkhealth/config-yourself-python) [![Documentation Status](https://readthedocs.org/projects/config-yourself-python/badge/?version=latest)](https://config-yourself-python.readthedocs.io/en/latest/?badge=latest) `config-yourself` is a python 2.7+ package to help your application read [go-config-yourself files](https://github.com/blinkhealth/go-config-yourself#config-files). --- ## Installation ```sh # choose if you'd like to use `kms`, `gpg` or the `password` provider pip install 'config_yourself[kms]' # or go crazy with all of them pip install 'config_yourself[all]' # with pipenv pipenv install 'config_yourself[kms]' # with poetry poetry add config_yourself --extras kms ``` ## Usage Here's how to work with `config_yourself` in python: ## Basic usage ```py import config_yourself as cy # Load one config file encrypted_config = cy.load.file("config/test.yml") config = cy.Config(encrypted_config) # now use it like a dict, all secrets have been decrypted print(config["database"]) ``` ## Complete usage ```py # Let's get a little more creative # `config_yourself` can take a number of config files, merge, and decrypt them # we start with a defaults file, that defines the valid keys for all subsequent files # then, we take a file path provided from the environment files = ['config/defaults.yml', os.environ['CONFIG_FILE']] # During development, we might choose to have a SCM-ignored personal file, to apply overrides to our personal taste if os.path.exists(personal_config_path): files.append('config/personal.yml') # we take every file, deserialize it from YAML configs = [cy.load.file(path) for path in files] # we can also append regular dicts to this list configs.append({ 'MODE': os.environ.get('BACKEND_MODE', 'tripolar') }) # we can also decide to override values straight from the environment... if os.environ['SHOOT_MYSELF_IN_THE_FOOT']: # config_yourself will parse env values as JSON, so this will turn to False os.environ['CONFIG.someService.enabled'] = 'false' configs.append(cy.load.env('CONFIG')) # Take our list of configs, and pass secrets to the decryption provider config = cy.Config(*configs, secrets={'password': os.environ['SUPER_SECRET_PASSWORD']}) # The resulting merged config is finally decrypted print(config['someService']['endpoint']) # => "https://super-secure-service.example.com" print(config['someService']['enabled']) # => False ``` ### From a Django or Flask application When using in Flask or Django and you'd like to follow the same pattern above, use the :py:meth:`~config_yourself.AppConfig` method instead: ```py import config_yourself as cy # Use AppConfig config = cy.AppConfig() # functionally equal to: # Remember to set CONFIG_FILE=./config/production.yml cy.Config(**[ "./config/defaults.yml", "./config/production.yml", ]) # assuming CONFIG_FILE="" and an existing "personal.yml" file cy.Config(**[ "./config/defaults.yml", "./config/local.yml", "./config/personal.yml", ]) ```


نیازمندی

مقدار نام
<1.0.0,>=0.16.0 future
>=5.1.1 PyYAML
<3.0,>=2.8 cryptography
<1.0.0,>=0.4.3 pgpy
<2.0.0,>=1.4.4 boto3
<1.0.0,>=0.4.3 pgpy
<3.0,>=2.8 cryptography
<2.0.0,>=1.4.4 boto3
<3.0,>=2.8 cryptography


زبان مورد نیاز

مقدار نام
>=2.7.0 Python


نحوه نصب


نصب پکیج whl config-yourself-1.0.2:

    pip install config-yourself-1.0.2.whl


نصب پکیج tar.gz config-yourself-1.0.2:

    pip install config-yourself-1.0.2.tar.gz