Configuration Management for Python ⚙

Overview

Dynaconf

dynaconf - Configuration Management for Python.

MIT License PyPI PyPI PyPI - Downloads Build Status Azure DevOps builds (branch) Azure DevOps builds (branch) codecov Codacy Badge GitHub issues GitHub stars GitHub Release Date GitHub commits since latest release GitHub last commit Code Style Black Telegram

Foo

Features

  • Inspired by the 12-factor application guide
  • Settings management (default values, validation, parsing, templating)
  • Protection of sensitive information (passwords/tokens)
  • Multiple file formats toml|yaml|json|ini|py and also customizable loaders.
  • Full support for environment variables to override existing settings (dotenv support included).
  • Optional layered system for multi environments [default, development, testing, production]
  • Built-in support for Hashicorp Vault and Redis as settings and secrets storage.
  • Built-in extensions for Django and Flask web frameworks.
  • CLI for common operations such as init, list, write, validate, export.
  • full docs on https://dynaconf.com

Quick start

Install

$ pip install dynaconf

Initialize Dynaconf on project root directory

$ cd path/to/your/project/

$ dynaconf init -f toml

⚙️  Configuring your Dynaconf environment
------------------------------------------
🐍 The file `config.py` was generated.

🎛️  settings.toml created to hold your settings.

🔑 .secrets.toml created to hold your secrets.

🙈 the .secrets.* is also included in `.gitignore`
  beware to not push your secrets to a public repo.

🎉 Dynaconf is configured! read more on https://dynaconf.com

TIP: You can select toml|yaml|json|ini|py on dynaconf init -f <fileformat> toml is the default and also the most recommended format for configuration.

Dynaconf init creates the following files

.
├── config.py       # This is from where you import your settings object (required)
├── .secrets.toml   # This is to hold sensitive data like passwords and tokens (optional)
└── settings.toml   # This is to hold your application setttings (optional)

On the file config.py Dynaconf init generates the following boilerpate

from dynaconf import Dynaconf

settings = Dynaconf(
    envvar_prefix="DYNACONF",  # export envvars with `export DYNACONF_FOO=bar`.
    settings_files=['settings.yaml', '.secrets.yaml'],  # Load files in the given order.
)

TIP: You can create the files yourself instead of using the init command as shown above and you can give any name you want instead of the default config.py (the file must be in your importable python path) - See more options that you can pass to Dynaconf class initializer on https://dynaconf.com

Using Dynaconf

Put your settings on settings.{toml|yaml|ini|json|py}

username = "admin"
port = 5555
database = {name='mydb', schema='main'}

Put sensitive information on .secrets.{toml|yaml|ini|json|py}

password = "secret123"

IMPORTANT: dynaconf init command puts the .secrets.* in your .gitignore to avoid it to be exposed on public repos but it is your responsibility to keep it safe in your local environment, also the recommendation for production environments is to use the built-in support for Hashicorp Vault service for password and tokens.

Optionally you can now use environment variables to override values per execution or per environment.

# override `port` from settings.toml file and automatically casts as `int` value.
export DYNACONF_PORT=9900

On your code import the settings object

from path.to.project.config import settings

# Reading the settings

settings.username == "admin"  # dot notation with multi nesting support
settings.PORT == 9900  # case insensitive
settings['password'] == "secret123"  # dict like access
settings.get("nonexisting", "default value")  # Default values just like a dict
settings.databases.name == "mydb"  # Nested key traversing
settings['databases.schema'] == "main"  # Nested key traversing

More

  • Settings Schema Validation
  • Custom Settings Loaders
  • Vault Services
  • Template substitutions
  • etc...

There is a lot more you can do, read the docs: http://dynaconf.com

Contribute

Main discussions happens on t.me/dynaconf learn more about how to get involved on CONTRIBUTING.md guide

Top Contributors

Comments
  • [bug] Testing and mocking docs are wrong

    [bug] Testing and mocking docs are wrong

    Describe the bug The docs in https://dynaconf.readthedocs.io/en/latest/guides/testing.html explain how to test with dynaconf. The point is that if you follow the explanation, you will see AttributeError: 'DynaconfDict' object has no attribute 'current_env'

    To Reproduce

    Just try to follow the steps in https://dynaconf.readthedocs.io/en/latest/guides/testing.html

    Expected behavior The code don't fail and the mock can be used.

    Debug output

    Debug Output
    Traceback (most recent call last):
      File "lalala.py", line 5, in <module>
        toml_loader.load(mocked_settings, filename="test_conf.toml", env="testing")
      File "/home/angel/.virtualenvs/navi-Pag0EvBg/lib/python3.6/site-packages/dynaconf/loaders/toml_loader.py", line 38, in load
        loader.load(filename=filename, key=key, silent=silent)
      File "/home/angel/.virtualenvs/navi-Pag0EvBg/lib/python3.6/site-packages/dynaconf/loaders/base.py", line 69, in load
        env_list = build_env_list(self.obj, self.env)
      File "/home/angel/.virtualenvs/navi-Pag0EvBg/lib/python3.6/site-packages/dynaconf/utils/__init__.py", line 220, in build_env_list
        if obj.current_env and obj.current_env not in env_list:
    AttributeError: 'DynaconfDict' object has no attribute 'current_env'
    

    Environment (please complete the following information):

    • OS: Ubuntu 18.04
    • Dynaconf Version 2.2
    wontfix hacktoberfest Docs HIGH 
    opened by anxodio 15
  • ARE YOU USING DYNACONF?

    ARE YOU USING DYNACONF?

    Hi,

    As you are on Dynaconf Issues page I assume you are using Dynaconf, or are interested in using it?

    This issue is a placeholder to get feedback from users, can you share your experience?

    Or if you are not a user, can you share what are you looking for in a config management library?

    Questions

    For those using Dynaconf

    • Are you using Dynaconf (yes/no)
    • Can you share some details? (company, project, stack)
    • When did you start using Dynaconf?
    • What features you use?
    • What features you miss?

    For those not using

    • If you have tried Dynaconf but decided not to use, can you share why?
    • If you are still reading and have not tried yet can you share what you are looking for?

    Feel free to share any comment, suggestion you have

    Thanks

    meta 
    opened by rochacbruno 15
  • Community Meeting Meta Issue [BREAKING CHANGES]

    Community Meeting Meta Issue [BREAKING CHANGES]

    Let's discuss the breaking changes coming on Dynaconf 3.0.0 https://doodle.com/poll/ke2g4kc6mzwgtavh

    There are some issues still opened for 3.0 https://github.com/rochacbruno/dynaconf/milestone/9

    The highlights to be discussed are:

    • Global settings object is going to be deprecated Users must create their own instance of dynaconf Deprecate

      from dynaconf import settings
      

      New recommended way

       # yourprogram/config.py
       settings = Dynaconf(**options)`
      

      reason Most users are confused about importing direct from dynaconf a singleton config object and when customizations via **options are needed they have to change the whole codebase.

    • No more default file paths Right now Dynaconf loads all files named settings.* idea is making it explicit only via option settings_files=[list of paths or globs] e.g:

      from dynaconf import Dynaconf
      settings = Dynaconf(settings_files=["main.toml", "other.toml", "path/*.toml"])
      

      reason Debugging file loading is hard, permissions and other I/O problems may happen idea is to make explicit and raise earlier for errors.

    • Envless mode will be default

      Now dynaconf has an envless_mode, which means it can load all variables direct from the main level of a file.

      server = 'bar.com'
      port = 5050
      

      This will be the default and if needed users will provide the list of environments.

      settings = Dynaconf(envs=["development", "production"])
      

      then

      [default]
      server = 'bar.com'
      port = 5050
      [development]
      server = 'dev.com'
      [production]
      server = 'prod.com'
      port = 80
      
    • Allow parser to be changed or disabled Right now toml is the only parser for every variable, idea is to make it configurable (and allow users to opt-out) reason Some users reported that wanted raw values instead of parsed by toml.

    • dotenv will be disabled by default No more loading of .env unless users explicitly enables it. reason In some environments dotenv is already loaded by the shell tool

    • Validators will fire by default if passed to the settings object No need to explicity call settings.validators.validate() if Dynaconf(validators=[...]) is passed it will be called right after the initialization.

    • Remove logging completely reason It is easier to debug using pdb/ipdb, logging right now is useless.

    • Allow Pydantic BaseModels as validators

    Pending Release 
    opened by rochacbruno 14
  • DATABASES setting for Django not being set

    DATABASES setting for Django not being set

    dynaconf is properly showing the settings I put into /etc/pulp/settings.py

    (pulp) [vagrant@pulp3 pulp]$ dynaconf list -k DATABASES
    Django app detected
    Working in development environment 
    DATABASES: {'default': {'CONN_MAX_AGE': 0,
                 'ENGINE': 'django.db.backends.dummy',
                 'HOST': 'postgres',
                 'NAME': 'pulp',
                 'PORT': '5432',
                 'USER': 'pulp'}}
    

    However, django is not using the setting. It seems like Django is loading the settings for the database before dynaconf is loaded.

    enhancement Pending Release 
    opened by dkliban 13
  • 3.18 - It looks like this has broken integration with environment variables.

    3.18 - It looks like this has broken integration with environment variables.

    @rochacbruno @jyejare It looks like this has broken integration with environment variables.

    If I have dynaconf 3.1.8 installed, and the combination of:

    1. settings.yaml field key (nested one level from top map) is present, value is empty
    2. validator with default=None for given field key
    3. envvar set for nested field key (DYNACONF_something__field_key)
    4. settings object configuration that looks like: https://github.com/SatelliteQE/robottelo/blob/master/robottelo/config/init.py#L18

    My envvar value is no longer set in the resulting box instance, it takes the validator default of None.

    I confirmed its this line in particular by modifying the file in site-packages with 3.1.8 installed.

    Originally posted by @mshriver in https://github.com/rochacbruno/dynaconf/pull/729#discussion_r853220515

    bug HIGH 
    opened by rochacbruno 12
  • [RFC] Keep @reset mark

    [RFC] Keep @reset mark

    I can still have:

    Dynaconf(merge_enabled=True)

    to have everything merged by default. In fact this my main scenarios, because I do not want to add @merge mark with each setting.

    But in some cases. Especially with lists I'd like default value to be replaced with a new list. Please, keep @reset mark for such cases. Another option is not to merge lists by default or have two options merge_dict_enabled=True and merge_list_enabled=False (this how I would set them).

    Not a Bug RFC 
    opened by dmugtasimov 12
  • Vendoring dependencies?

    Vendoring dependencies?

    Recently python-box broke and also we had to pin python-dotenv, so given the way dynaconf is embedded on libraries and applications looks like a good idea to vendor 3 libs.

    • toml
    • python-box
    • python-dotenv
    • click
    question HIGH redhat 
    opened by rochacbruno 12
  • What to do with declarations like

    What to do with declarations like "!!python/object/new:box.BoxList" ?

    We use dynaconf to template out a default configuration file in YAML and we've started seeing declarations like these:

    default:
      ALLOWED_HOSTS: !!python/object/new:box.BoxList
        listitems:
        - ::1
        - 127.0.0.1
        - localhost
        state:
          box_class: &id001 !!python/name:box.Box ''
          box_options: {}
          box_org_ref: 140462933942512
    

    I realize these are coming from python-box but they weren't present until recently. They don't look mandatory ? A settings file without these seem to work as well.

    It unfortunately makes the templated file less readable and definitely not human writable.

    enhancement question 
    opened by dmsimard 12
  • Document the use of pytest with dynaconf

    Document the use of pytest with dynaconf

    For testing in my project i want to add in my conftest.py something like that:

    import pytest
    import os
    
    @pytest.fixture(scope='session', autouse=True)
    def settings():
        os.environ['ENV_FOR_DYNACONF'] = 'testing'
    
    

    But this is not work ;-(. What can you advise me ? I dont want start my test like that : ENV_FOR_DYNACONF=testing pytest because somebody can miss that command prefix and mess up some dev data.

    enhancement question Docs good first issue 
    opened by dyens 12
  • Add the ability to load only a specified list of keys from envvars

    Add the ability to load only a specified list of keys from envvars

    Describe the bug Migrating from other configuration systems I'd need to configure envvar_prefix to empty string ("") so I can load any environment variable I used before. But it doesn't seem to work with dynaconf.

    To Reproduce Steps to reproduce the behavior:

    1. Create a basic dynaconf configuration

    In config.py:

    from dynaconf import Dynaconf
    
    settings = Dynaconf(
        # This is the important line.
        envvar_prefix="",
    )
    
    print(settings.FOO)
    
    1. Now create some settings file.

    In settings.py:

    FOO = 'bar'
    
    1. Finally try running.
    export SETTINGS_FILE_FOR_DYNACONF=settings
    FOO='ham' python config.py
    

    You will get:

    bar
    

    Expected behavior

    The print output states:

    ham
    

    This means the value from environment variable has overridden the default value from settings.py module

    Environment (please complete the following information):

    • OS: Ubuntu Linux 20.04
    • Python version: 3.8.5
    • Dynaconf version: 3.1.2
    • Frameworks in use: none.

    Additional context Interestingly running in a "hacky" way changes the variable value:

    _FOO='ham' python config.py
    

    This is not what I'd expect though. The point is to modify the bare FOO variable.

    enhancement help wanted question RFC Docs good first issue HIGH 
    opened by odiroot 11
  • Document  the usage with `python -m`

    Document the usage with `python -m`

    My project structure:

    gfa/ ├── config │   └── settings.yaml ├── init.py ├── main.py ├── resources │   ├── exon_body.bed │   ├── exon_end.bed │   ├── exon_start.bed ├── src │   ├── annotators │   │   ├── get_annots.py │   │   └── init.py │   ├── gfa.py │   ├── preprocess └── tests ├── fixtures │   └── test_bkpt.tsv ├── init.py └── test_get_annots.py

    I have a settings.yaml in the config folder with the content below

    ---
    exon_region_dict
      start : '../resources/exon_start.bed'
      stop : '../resources/exon_stop.bed'
      body : '../resources/exon_body.bed'
    

    I call settings.EXON_REGION_DICT in get_annots.py but I get this error line 113, in getattr return getattr(self._wrapped, name) AttributeError: 'Settings' object has no attribute 'EXON_REGION_DICT'

    wontfix hacktoberfest Docs 
    opened by gopi1616 11
  • [bug] dynaconf is not installable in venvs without setuptools

    [bug] dynaconf is not installable in venvs without setuptools

    Bug description

    dynaconf doesn't define any dependencies (due to vendoring), but that's not really true, because there is one runtime dependency - pkg_resources distributed with setuptools: https://github.com/dynaconf/dynaconf/blob/0439bf836f1a22e96e4c71d388c2e68fd9b70425/dynaconf/contrib/flask_dynaconf.py#L17

    How is it possible that it actually works? Only thanks to a "de facto" standard of pre-installing setuptools a) together with Python interpreter b) when creating virtual environments:

    venv is available by default in Python 3.3 and later, and installs pip and setuptools into created virtual environments in Python 3.4 and later.

    virtualenv needs to be installed separately, but supports Python 2.7+ and Python 3.3+, and pip, setuptools and wheel are always installed into created virtual environments by default (regardless of Python version).

    It means setuptools was not explicitly declared, but it was assumed it would be there anyway. But as I mentioned - it never was a real standard and it caused serious issues in the Python build system as precisely described in PEP 518:

    But when a project chooses to use setuptools, the use of an executable file like setup.py becomes an issue. You can’t execute a setup.py file without knowing its dependencies, but currently there is no standard way to know what those dependencies are in an automated fashion without executing the setup.py file where that information is stored. It’s a catch-22 of a file not being runnable without knowing its own contents which can’t be known programmatically unless you run the file.

    And that's why PEP 518 introduced the build-system table defined in pyproject.toml:

    [build-system]
    # Minimum requirements for the build system to execute.
    requires = ["setuptools", "wheel"]  # PEP 508 specifications.
    

    Thanks to that and PEP 517 - package managers know what are the actual build dependencies and how they should be handled. What does it imply? No need to blindly install setuptools anymore.

    Based on that poetry introduced a flag virtualenvs.options.no-setuptools, which is currently disabled by default, but generally recommended: image

    What's the implication of the above? Well, I guess you already know:

    ❯ poetry config --local virtualenvs.options.no-setuptools true
    ❯ poetry add dynaconf
    ❯ poetry run python -c "from dynaconf.contrib.flask_dynaconf import DynaconfConfig"
    Traceback (most recent call last):
      File "<string>", line 1, in <module>
      File "/Users/lanskij/Repositories/dyna/.venv/lib/python3.10/site-packages/dynaconf/__init__.py", line 5, in <module>
        from dynaconf.contrib import DjangoDynaconf  # noqa
      File "/Users/lanskij/Repositories/dyna/.venv/lib/python3.10/site-packages/dynaconf/contrib/__init__.py", line 4, in <module>
        from dynaconf.contrib.flask_dynaconf import DynaconfConfig  # noqa
      File "/Users/lanskij/Repositories/dyna/.venv/lib/python3.10/site-packages/dynaconf/contrib/flask_dynaconf.py", line 17, in <module>
        import pkg_resources
    ModuleNotFoundError: No module named 'pkg_resources'
    

    Required fixes

    • package building

      As showed above - we can't assume anymore setuptools would be for sure pre-installed in given environment. That's why a proper definition of build dependency should be added to pyproject.toml:

      [build-system]
      requires = ["setuptools"]
      build-backend = "setuptools.build_meta"
      

      PS The current usage of setup_requires in setup.py is redundant, it's even mentioned directly in PEP 518:

      Setuptools tried to solve this with a setup_requires argument to its setup() function [3]. This solution has a number of issues, such as:

      • This cannot include setuptools itself nor can it include a replacement to setuptools, which means that projects such as numpy.distutils are largely incapable of utilizing it and projects cannot take advantage of newer setuptools features until their users naturally upgrade the version of setuptools to a newer one.
    • package runtime

      Here we have 3 solutions:

      • specify setuptools as a package dependency
      • vendor setuptools
      • get rid of setuptools- and pkg_resources-related runtime logic at all

      Personally - I would vote for the last one. Looking quickly - there's exactly one such line, which is: https://github.com/dynaconf/dynaconf/blob/0439bf836f1a22e96e4c71d388c2e68fd9b70425/dynaconf/contrib/flask_dynaconf.py#L226 That was probably copy-pasted from the flask codebase. But flask maintainers already fixed that on their side in https://github.com/pallets/flask/issues/4419 and switched to the built-in importlib.metadata, so when aligned - there would be also no need for dynaconf to depend on setuptools in runtime anymore.

    bug HIGH 
    opened by jaklan 1
  • [bug] reload() function does not clear old hooks

    [bug] reload() function does not clear old hooks

    Describe the bug the reload() function of the LazySettings class does not clear the _loaded_hooks attribute. Because of that, when trying to reload and rerun the loaders, the hook won't run again.

    To Reproduce Steps to reproduce the behavior:

    Configure a post hook just like in the docs. Create a DynaConf object and then run reload() on the object.

    Expected behavior The post hook should run after every reload.

    Additional context I'll be glad to make a PR for this myself.

    bug 
    opened by iTaybb 0
  • [RFC] Ability to add custom error message for Validator

    [RFC] Ability to add custom error message for Validator

    Is your feature request related to a problem? Please describe. Currently, when using a Validator with a custom condition, the error message is not indicative enough.

    For example: Validator("ipify_api_list", condition=lambda x: len(x) > 5) would result in: dynaconf.validator.ValidationError: ipify_api_list invalid for <lambda>(['api.ipify.com']) in env main

    Describe the solution you'd like Add a new, "error_msg" option for Validator that will be shown as the error message

    Additional context I'll be glad to make a PR for this myself.

    Not a Bug RFC Docs 
    opened by iTaybb 2
  • Support parameter abbreviation on Flask and Django plugins

    Support parameter abbreviation on Flask and Django plugins

    Discussed in https://github.com/dynaconf/dynaconf/discussions/847

    Originally posted by kssflow December 27, 2022

    Hello everyone! (happy new year in advance 🎉) First of all, really appreciate for maintaining this invaluable, literally amazing open source project. 👏😸

    I consult to Flask documentating saying "dynaconf" is one of (recommended) solutions for configuration management. So I have given a shot to this library with carefully reading the docs and typing code. But the more I do my best to handle(solve) the problem the more I totally lost in frustration.

    For example, the doc says envvar_prefix makes the prefix of environment variable.

    
    from flask import Flask
    from dynaconf import FlaskDynaconf
    
    app = Flask(__name__)
    FlaskDynaconf(app, envvar_prefix="PEANUT")
    
    

    It doesn't work... but if I change the envvar_prefix to envvar_prefix_for_dynaconf, it works finally.

    Does doc is wrong? (I hope that it's not doc but me makes problem) If docs are wrong, there seems to be INCONSISTENCY related to Flask Integration part...

    python code

    
    # main.py
    # working code
    
    from flask import Flask, render_template, current_app
    from dynaconf import FlaskDynaconf
    
    app = Flask(__name__, template_foler=templates")
    FlaskDynaconf(app, 
       load_dotenv=True, 
       envvar_prefix_for_dynaconf="DAMNIT"  # 🔴 doc say "envvar_prefix" but that doesn't work 
    )
    
    @app.route("/", methods=["GET"])
    def index():
        settings = current_app.config
       return render_template("index.html.jinja", settings=settings")
    
    

    jinja(html) code

    
    <!DOCTYPE html>
    <html lang="en">
    
    <head>
        <meta charset="UTF-8">
        <meta http-equiv="X-UA-Compatible" content="IE=edge">
        <meta name="viewport" content="width=device-width, initial-scale=1.0">
        <title>Document</title>
    </head>
    
    <body>
        <h1>HELP ME!!</h1>
        <div style="border: 1px solid red; width: 100px; height: 100px;">
            {{ settings.APPNAME }}
        </div>
        <div>
            {% if settings %}
                <dl>
                {% for key, value in settings.items() %}
                    <dt>{{ key }}</dt>
                    <dd>{{ value }}</dd>
                {% endfor %}
                </dl>
            {% endif %}
        </div>
    </body>
    
    </html>
    
    

    .env

    
    FLASK_APPNAME=APP NAME FROM FLASK_APPNAME
    DAMNIT_APPNAME=APP NAME FROM DAMNIT_APPNAME
    
    

    🟢 results with envvar_prefix_for_dynaconf=DMANIT

    🔴 results with envvar_prefix=DMANIT

    Thanks in advance. Again, really thanks for maintaining and evolving this wonderful project!

    Best regards.

    bug 
    opened by rochacbruno 0
  • [RFC] Allow different mount points or path to read from vault

    [RFC] Allow different mount points or path to read from vault

    Is your feature request related to a problem? Please describe. Dynaconf offers only one mount point, default is secret. Many enterprises have multiple mount points for departments and different teams and different subpaths for different apps.

    Describe the solution you'd like Vault approle itself offers different mount points and allows to read only specific path. Please expose those features of allowing us to specify the mount point and path to CRUD.

    Describe alternatives you've considered Skip dynaconf and use vault approles directly

    Additional context None

    Not a Bug RFC 
    opened by MrAmbiG 0
  • [RFC] Vault Approle authentication with SSH/https/tls disabled

    [RFC] Vault Approle authentication with SSH/https/tls disabled

    Is your feature request related to a problem? Please describe. vault authentication via approle does not offer skipping of ssl.

    Describe the solution you'd like vault_loader.py file, line33 had to be modified by adding verify=False, to skip https verification.

    Describe alternatives you've considered None

    Additional context Our vault sits in other network with https. Our services however reside adjacent to the vault in the same kubernetes environment. We do not need or want to use https address since it will cause hairpinning of the traffic (traffic goes to nginx ingress, dns, then nginx ingress and then the client of the vault) We directly access vault using the service name of the vault in k8s and even if it is not the case, providing an option to skip https is great. could not find the same in your documentation. https://www.dynaconf.com/secrets/?h=vault#using-vault-server

    Not a Bug RFC 
    opened by MrAmbiG 0
Releases(3.1.11)
  • 3.1.11(Sep 22, 2022)

    Dynaconf 3.1.11

    Amadou Crookes (1):
          envars.md typo fix (#786)
    
    Bruno Rocha (19):
          Release version 3.1.9
          Bump dev version to 3.1.10
          Update badges
          demo repo will be replaced by a video tutorial soon
          Fix CI
          New data key casing must adapt to existing key casing (#795)
          Add test and docs about includes (#796)
          Removed vendor_src folder (#798)
          Replacing rochacbruno/ with dynaconf/ (#800)
          Fix codecov (#801)
          Parse negative numbers from envvar Fix #799 and Fix #585 (#802)
          Fix get command with Django (#804)
          Add a functional test runner (#805)
          Test runner docs and styling (#806)
          Allow merge_unique on lists when merge_enabled=True (#810)
          Rebind current env when forced for Pytest Fix #728 (#809)
          AUTO_CAST can be enabled on instance (#811)
          Ensure pyminify is on release script
          Add missing tomllib to monify script
    
    Gaurav Talreja (1):
          Fix #807 Use client.auth.approle.login instead of client.auth_approle (#808)
    
    Jitendra Yejare (1):
          Fix #768 of kv property depreciation from client object (#769)
    
    Joren Retel (2):
          Feature/detect casting comb token from converters (#784)
          Adding documentation and example to makefile. (#791)
    
    João Gustavo A. Amorim (1):
          Add pyupgrade hook (#759)
    
    Kian-Meng Ang (1):
          Fix typos (#788)
    
    Lucas Limeira (1):
          Using filter_strategy in env_loader to fix #760 (#767)
    
    Nicholas Nadeau, Ph.D., P.Eng (1):
          fix: typo (#766)
    
    Oleksii Baranov (2):
          Bump codecov action version (#775)
          Fix cli init command for flask (#705) (#774)
    
    Pedro de Medeiros (1):
          documentation fixes (#771)
    
    The Gitter Badger (1):
          Add a Gitter chat badge to README.md (#776)
    
    Théo Melo (1):
          Fixing a typo on the readme file (#763)
    
    Vicente Marçal (1):
          docs(pt-br): Docs Translation to brazilian portugues. (#787)
    

    What's Changed

    • Add pyupgrade hook by @johnnv1 in https://github.com/dynaconf/dynaconf/pull/759
    • Fixing a typo on the readme file by @TheoVinicius in https://github.com/dynaconf/dynaconf/pull/763
    • Using filter_strategy in env_loader to fix #760 by @limeiralucas in https://github.com/dynaconf/dynaconf/pull/767
    • Fix #768 of kv property depreciation from client object by @jyejare in https://github.com/dynaconf/dynaconf/pull/769
    • Bump codecov action version by @obaranov in https://github.com/dynaconf/dynaconf/pull/775
    • Fix cli init command for flask (#705) by @obaranov in https://github.com/dynaconf/dynaconf/pull/774
    • Add a Gitter chat badge to README.md by @gitter-badger in https://github.com/dynaconf/dynaconf/pull/776
    • documentation fixes by @pvmm in https://github.com/dynaconf/dynaconf/pull/771
    • fix: typo by @engnadeau in https://github.com/dynaconf/dynaconf/pull/766
    • envars.md typo fix by @ascrookes in https://github.com/dynaconf/dynaconf/pull/786
    • Feature/detect casting comb token from converters by @jorenretel in https://github.com/dynaconf/dynaconf/pull/784
    • Adding documentation and example to makefile. by @jorenretel in https://github.com/dynaconf/dynaconf/pull/791
    • docs(pt-br): Docs Translation to brazilian portugues. by @Riverfount in https://github.com/dynaconf/dynaconf/pull/787
    • New data key casing must adapt to existing key casing by @rochacbruno in https://github.com/dynaconf/dynaconf/pull/795
    • Add test and docs about includes by @rochacbruno in https://github.com/dynaconf/dynaconf/pull/796
    • Removed vendor_src folder by @rochacbruno in https://github.com/dynaconf/dynaconf/pull/798
    • Replacing rochacbruno/ with dynaconf/ by @rochacbruno in https://github.com/dynaconf/dynaconf/pull/800
    • Fix codecov by @rochacbruno in https://github.com/dynaconf/dynaconf/pull/801
    • Parse negative numbers from envvar Fix #799 and Fix #585 by @rochacbruno in https://github.com/dynaconf/dynaconf/pull/802
    • Fix get command with Django by @rochacbruno in https://github.com/dynaconf/dynaconf/pull/804
    • Add a functional test runner by @rochacbruno in https://github.com/dynaconf/dynaconf/pull/805
    • Test runner docs and styling by @rochacbruno in https://github.com/dynaconf/dynaconf/pull/806
    • Fix typos by @kianmeng in https://github.com/dynaconf/dynaconf/pull/788
    • Fix #807 Use client.auth.approle.login instead of client.auth_approle by @Gauravtalreja1 in https://github.com/dynaconf/dynaconf/pull/808
    • Allow merge_unique on lists when merge_enabled=True by @rochacbruno in https://github.com/dynaconf/dynaconf/pull/810
    • Rebind current env when forced for Pytest Fix #728 by @rochacbruno in https://github.com/dynaconf/dynaconf/pull/809
    • AUTO_CAST can be enabled on instance by @rochacbruno in https://github.com/dynaconf/dynaconf/pull/811

    New Contributors

    • @TheoVinicius made their first contribution in https://github.com/dynaconf/dynaconf/pull/763
    • @limeiralucas made their first contribution in https://github.com/dynaconf/dynaconf/pull/767
    • @obaranov made their first contribution in https://github.com/dynaconf/dynaconf/pull/775
    • @gitter-badger made their first contribution in https://github.com/dynaconf/dynaconf/pull/776
    • @pvmm made their first contribution in https://github.com/dynaconf/dynaconf/pull/771
    • @ascrookes made their first contribution in https://github.com/dynaconf/dynaconf/pull/786
    • @jorenretel made their first contribution in https://github.com/dynaconf/dynaconf/pull/784
    • @kianmeng made their first contribution in https://github.com/dynaconf/dynaconf/pull/788
    • @Gauravtalreja1 made their first contribution in https://github.com/dynaconf/dynaconf/pull/808

    Full Changelog: https://github.com/dynaconf/dynaconf/compare/3.1.9...3.1.11

    Source code(tar.gz)
    Source code(zip)
  • 3.1.10(Sep 22, 2022)

  • 3.1.9(Jun 6, 2022)

    What's Changed

    • Bump django from 2.2.27 to 2.2.28 in /example/django_pytest_pure by @dependabot in https://github.com/rochacbruno/dynaconf/pull/743
    • Multiple fixes for 3.19 by @rochacbruno in https://github.com/rochacbruno/dynaconf/pull/756
    • Organize pre-commit setup by @johnnv1 in https://github.com/rochacbruno/dynaconf/pull/757
    • update docs site by @rochacbruno in https://github.com/rochacbruno/dynaconf/pull/758

    New Contributors

    • @johnnv1 made their first contribution in https://github.com/rochacbruno/dynaconf/pull/757

    Full Changelog: https://github.com/rochacbruno/dynaconf/compare/3.1.8...3.1.9

    Dynaconf 3.1.9

    List of issues fixed on this release: https://github.com/rochacbruno/dynaconf/issues?q=is%3Aissue+sort%3Aupdated-desc+milestone%3A3.1.9+is%3Aclosed

    Source code(tar.gz)
    Source code(zip)
  • 3.1.3rc1(Mar 1, 2021)

  • 3.1.1(Sep 21, 2020)

    Andreas Poehlmann (1):
          Allow importing SEARCHTREE before settings are configured (#383)
    
    Bruno Rocha (38):
          Hot fix removing unused imports
          Merge branch 'master' of github.com:rochacbruno/dynaconf
          Removing invalid links, adding allert on old docs  fix #369 and fix #371 (#372)
          Fix #359 lazy template substitution on nested keys (#375)
          Flask fizes and other issues included. (#376)
          Fix #379 dict like iteration (#385)
          Fix #377 allow computed values (#386)
          Fix #388 URL reference for custom loaders (#389)
          Fix #382 add is_overriden method (#390)
          Release version 3.1.0
          Create FUNDING.yml
          Fix #391 make box_settings optional, change vendoring strategy (#398)
          HOTFIX: Add missing vendor.txt
          Allow nested Lazy Values (#405)
          Makes   PEP8 more strictly and remove unused variables (#408)
          Merge branch 'master' into vault
          boto is optional
          Merge branch 'vault' into master
          Included example of custom SOPS loader to the docs
          Release version 3.1.1rc1
          HOTFIX: Logging instance has a `formatter` attribute (#410)
          Release version 3.1.1rc2
          Fix set attribute directly and fresh vars (#412)
          384 fix tail and dotted merge (#415)
          Fix #404 no more dup message on combined validators (#417)
          HOTFIX 414 update docs version on release
          Release version 3.1.1rc3
          HOTFIX: Add missing instruction to release.sh
          Added full Dynaconf Diagram and few fizes. (#418)
          Release version 3.1.1rc4
          Small fix on release script
          Minification of vendored modules (#419)
          Release version 3.1.1rc5
          Do not include vendor_src on wheel target (#420)
          Release version 3.1.1rc6
          HOTFIX: Cli now accepts dotter keys
          Release version 3.1.1
    
    Christoph Schmatzler (1):
          Fix typo in Validation docs (#394)
    
    Gabriel Simonetto (1):
          Fix #399 - Update documentation link (#401)
    
    Jiranun Jiratrakanvong (1):
          Add auth username and password for redis settings (#378)
    
    John Vandenberg (1):
          Allow testing against local redis server (#387)
    
    Martijn Pieters (1):
          Correct typos in documentation and README (#400)
    
    Max Winterstein (1):
          Fix typo in release notes (#411)
    
    Mirek Długosz (2):
          Test all names in Validator("foo", "bar", must_exist=False) (#406)
          Fix #407 - add proper equality test for CombinedValidator (#413)
    
    Nikolai Bessonov (1):
          fix a typo (#393)
    
    Peng Yin (5):
          Read all secrets under a vault path
          Add option to auth vault with iam role
          Fix format
          Fix test for versioned kv engine in latest vault
          Merge branch 'master' into vault
    
    Piotr Baniukiewicz (1):
          Fix validation of optional fields (#370)
    
    whg517 (1):
          docs: Fixed filename error in the case of the index page (#396)
    
    Source code(tar.gz)
    Source code(zip)
  • 3.1.1rc6(Sep 21, 2020)

  • 3.1.1rc5(Sep 21, 2020)

  • 3.1.1rc4(Sep 19, 2020)

  • 3.1.1rc3(Sep 17, 2020)

  • 3.1.1rc2(Sep 14, 2020)

  • 3.1.1rc1(Sep 12, 2020)

  • 3.0.0rc2(Jun 22, 2020)

  • 3.0.0rc1(Mar 10, 2020)

  • 2.1.0(Sep 5, 2019)

    Highlights:

    🐲Nested envvars w/ DUNDER__KEYS (useful for #django)

    Lets say you have a configuration like this:

    settings.py

    DATABASES = {
        'default': {
            'NAME': 'db',
            'ENGINE': 'module.foo.engine',
            'ARGS': {'timeout': 30}
        }
    }
    

    And now you want to change the values of ENGINE to other.module, via environment variables you can use the format ${ENVVAR_PREFIX}_${VARIABLE}__${NESTED_ITEM}__${NESTED_ITEM}

    Each __ (dunder, a.k.a double underline) denotes access to nested elements in a dictionary.

    So

    DATABASES['default']['ENGINE'] = 'other.module'
    

    Can be expressed as environment variables as:

    export DYNACONF_DATABASES__default__ENGINE=other.module
    

    NOTE: if you are using Django extension then the prefix will be DJANGO_ instead of DYNACONF_ and the same if you are using FLASK_ or a custom prefix if you have customized the ENVVAR_PREFIX.

    This will result in

    DATABASES = {
        'default': {
            'NAME': 'db',
            'ENGINE': 'other.module',
            'ARGS': {'timeout': 30}
        }
    }
    

    Read more on: https://dynaconf.readthedocs.io/en/latest/guides/environment_variables.html#nested-keys-in-dictionaries-via-environment-variables

    🔃.from_env easy access to different envs

    Return a new isolated settings object pointing to specified env.

    Example of settings.toml::

    [development]
    message = 'This is in dev'
    foo = 1
    [other]
    message = 'this is in other env'
    bar = 2
    

    Then you can use from_env:

    >>> print(settings.from_env('other').MESSAGE)
    'This is in other env'
    >>> print(settings.from_env('other').BAR)
    2
    >>> print(settings.from_env('other').FOO)
    AttributeError: settings object has no attribute 'FOO'
    

    The existing settings object remains the same.

    >>> print(settings.MESSAGE)
    'This is in dev'
    

    Read more on: https://dynaconf.readthedocs.io/en/latest/guides/advanced_usage.html#from-env

    📋$dynaconf list -o export your settings as a file

    dynaconf list -o path/to/file.yaml
    

    The above command will export all the items showed by dynaconf list to the desired format which is inferred by the -o file extension, supported formats yaml, toml, ini, json, py

    When using py you may want a flat output (without being nested inside the env key)

    dynaconf list -o path/to/file.py --output-flat
    

    Read more on: https://dynaconf.readthedocs.io/en/latest/guides/cli.html#exporting-current-environment-as-a-file

    🔐@HashiCorp #Vault & @RedisLabs supports multiple envs

    If you want to write to specific env pass the -e option.

    $ dynaconf write redis -v name=Bruno -v database=localhost -v port=1234 -e production
    

    The above data will be recorded in redis as a hash:

    DYNACONF_PRODUCTION {
        NAME='Bruno'
        DATABASE='localhost'
        PORT='@int 1234'
    }
    

    Then to access that values you can set export ENV_FOR_DYNACONF=production or directly via settings.from_env('production').NAME

    Read more on: https://dynaconf.readthedocs.io/en/latest/guides/external_storages.html

    Dynaconf 2.1.0

    Bruno Rocha (8):
          Release version 2.0.4
          Merge branch 'dgarcia360-master'
          Fix #197 add support for DOTTED__ENV__VARS (#215)
          Add support to export merged env to filesystem via cli. (#217)
          Adds `from_env` method and change `_store` to be a `DynaBox` (#219)
          hotfix: next release will be 2.1.0 because new features added. (#220)
          Fix `make test_examples` to use better assertions, redis and vault loader now respects `envs` (#222)
          fix #221 removed JSON,YAML,INI,TOML cosntants from default_settings (#223)
    
    Kedar Kulkarni (1):
          Add `list_envs` function to vault loader and now envs can have `_` on its name.
    
    Pavel Alimpiev (1):
          Fix typo in documentation for a Validator class (#213)
    
    dgarcia360 (3):
          Updated configuration options table to csv table
          Added responsive table fix
          Fix format
    
    Source code(tar.gz)
    Source code(zip)
Owner
Bruno Rocha
Programmer at @RedHatOfficial. #Python #Rust . Working on: @ansible @python #dynaconf @codeshow
Bruno Rocha
Simple dataclasses configuration management for Python with hocon/json/yaml/properties/env-vars/dict support.

Simple dataclasses configuration management for Python with hocon/json/yaml/properties/env-vars/dict support, based on awesome and lightweight pyhocon parsing library.

Teo Stocco 62 Dec 23, 2022
Pydantic-ish YAML configuration management.

Pydantic-ish YAML configuration management.

Dribia Data Research 18 Oct 27, 2022
filetailor is a peer-based configuration management utility for plain-text files such as dotfiles.

filetailor filetailor is a peer-based configuration management utility for plain-text files (and directories) such as dotfiles. Files are backed up to

null 5 Dec 23, 2022
Flexible Python configuration system. The last one you will ever need.

OmegaConf Description Project Code quality Docs and support OmegaConf is a hierarchical configuration system, with support for merging configurations

Omry Yadan 1.4k Jan 2, 2023
Python Marlin Configurator to make valid configuration files to be used to compile Marlin with.

marlin-configurator Concept originally imagined by The-EG using PowerShell Build Script for Marlin Configurations The purpose of this project is to pa

DevPeeps 2 Oct 9, 2021
A Python library to parse PARI/GP configuration and header files

pari-utils A Python library to parse PARI/GP configuration and header files. This is mainly used in the code generation of https://github.com/sagemath

Sage Mathematical Software System 3 Sep 18, 2022
Configuration Extractor for EXE4J PE files

EXE4J Configuration Extractor This script helps reverse engineering Portable Executable files created with EXE4J by extracting their configuration dat

Karsten Hahn 6 Jun 29, 2022
Sync any your configuration file to remote. Currently only support gist.

Sync your configuration to remote, such as vimrc. You can use EscSync to manage your configure of editor, shell, etc.

Me1onRind 0 Nov 21, 2022
Tools to assist with the configuration and maintenance of fapolicyd.

Tools to assist with the configuration and maintenance of fapolicyd.

Concurrent Technologies Corporation (CTC) 7 Dec 27, 2022
A tool to manage configuration files, build scripts etc. across multiple projects.

A tool to manage configuration files, build scripts etc. across multiple projects.

null 8 Dec 14, 2022
An application pulls configuration information from JSON files generated

AP Provisioning Automation An application pulls configuration information from JSON files generated by Ekahau and then uses Netmiko to configure the l

Cisco GVE DevNet Team 1 Dec 17, 2021
KConfig Browser is a graphical application which allows you to modify KDE configuration files found in ~/.config

kconfig_browser KConfig Browser is a graphical application which allows you to modify KDE configuration files found in ~/.config Screenshot Why I crea

null 11 Sep 15, 2022
Secsie is a configuration language made for speed, beauty, and ease of use.

secsie-conf pip3 install secsie-conf Secsie is a configuration language parser for Python, made for speed and beauty. Instead of writing config files

Noah Broyles 3 Feb 19, 2022
A slightly opinionated template for iPython configuration for interactive development

A slightly opinionated template for iPython configuration for interactive development. Auto-reload and no imports for packages and modules in the project.

Seva Zhidkov 24 Feb 16, 2022
Python 3+ compatible port of the configobj library

configobj Python 3+ compatible port of the configobj library. Documentation You can find a full manual on how to use ConfigObj at readthedocs. If you

Differently Sized Kittens 288 Dec 14, 2022
🤫 Easily manage configs and secrets in your Python projects (with CLI support)

Installation pip install confidential How does it work? Confidential manages secrets for your project, using AWS Secrets Manager. First, store a secr

Candid™️ 63 Oct 30, 2022
A modern simfile parsing & editing library for Python 3

A modern simfile parsing & editing library for Python 3

ash garcia 38 Nov 1, 2022
Scooch Configures Object Oriented Class Hierarchies for python

Scooch Scooch Configures Object Oriented Class Hierarchies for python. A good place to start with Scooch is at the documentation found here. Scooch is

Pandora Media, Inc. 6 Dec 20, 2022
A set of Python scripts and notebooks to help administer and configure Workforce projects.

Workforce Scripts A set of Python scripts and notebooks to help administer and configure Workforce projects. Notebooks Several example Jupyter noteboo

Esri 75 Sep 9, 2022