# -*- coding: utf-8 -*-
from setuptools import setup

packages = \
['onacol']

package_data = \
{'': ['*']}

install_requires = \
['Cerberus>=1.3.4,<2.0.0',
 'cascadict>=0.8.4,<0.9.0',
 'ruamel.yaml>=0.17.10,<0.18.0']

setup_kwargs = {
    'name': 'onacol',
    'version': '0.2.3',
    'description': 'Oh No! Another Configuration Library',
    'long_description': '=============================================\nONACOL (Oh No! Another COnfiguration Library)\n=============================================\n\n.. image:: https://badge.fury.io/py/onacol.svg\n        :target: https://badge.fury.io/py/onacol\n\n.. image:: https://github.com/calcite/onacol/actions/workflows/test.yaml/badge.svg?branch=main\n        :target: https://github.com/calcite/onacol/actions/workflows/test.yaml\n\n.. image:: https://readthedocs.org/projects/onacol/badge/?version=latest\n        :target: https://onacol.readthedocs.io/en/latest/?version=latest\n        :alt: Documentation Status\n\n.. image:: https://coveralls.io/repos/github/calcite/onacol/badge.svg?branch=main\n        :target: https://coveralls.io/github/calcite/onacol?branch=main\n        :alt: Test coverage Status\n\n.. image:: https://img.shields.io/pypi/pyversions/onacol\n        :alt: PyPI - Python Version\n\nOnacol is a low-opinionated configuration management library with following\nfeatures:\n\n* YAML (=structured and hierarchical) configuration file support\n* Environment variables support\n* CLI arguments support\n* Configuration merging/overwriting/layering\n* Parameter validation (via Cerberus_)\n* Configuration schema, documentation and default values are defined in\n  single YAML -> No code schema.\n* Minimal dependencies\n\nComparison with other Python configuration libraries/frameworks\n---------------------------------------------------------------\n\nAs the library name suggests, author is painfully aware this is not a unique\nsolution to the problem of application configuration. However, in the plethora\nof existing solutions, none was completely fulfilling the features/requirements\nmentioned above. So, with great reluctance,\n`I had to make my own <https://xkcd.com/927/>`_.\n\nFollowing table lists known/popular configuration frameworks and their\nfeatures relative to Onacol, but not comparing other features that some of those\nlibraries have and Onacol doesn\'t, so check them out - you may find it suits\nyour need better.\n\n\n.. list-table:: Popular configuration framework comparison\n    :widths: 30 10 10 10 10 10 10\n    :header-rows: 1\n\n    * - Framework\n      - YAML\n      - ENV vars\n      - CLI args\n      - Merging\n      - Validation\n      - No code schema\n    * - Hydra_\n      - ✔️\n      - ✔️\n      - ❓\n      - ✔️\n      - ✔️\n      - ✖️\n    * - Pydantic_\n      - ❓\n      - ❓\n      - ✔️\n      - ✔️\n      - ✔️\n      - ✖️\n    * - Dynaconf_\n      - ✔️\n      - ❓\n      - ✔️\n      - ✔️\n      - ✔️\n      - ✖️\n    * - python-dotenv_\n      - ✖️\n      - ✔️\n      - ✖️\n      - ✖️\n      - ✖️\n      - ✖️\n    * - `Gin Config`_\n      - ❓\n      - ❓\n      - ❓\n      - ❓\n      - ✔️\n      - ✖️\n    * - OmegaConf_\n      - ✔️\n      - ✔️\n      - ✔️\n      - ✔️\n      - ✔️\n      - ✖️\n    * - Confuse_\n      - ✔️\n      - ✔️\n      - ❓\n      - ✔️\n      - ✔️\n      - ✖️\n    * - `Python Decouple`_\n      - ✖️\n      - ✖️\n      - ✔️\n      - ✔️\n      - ✖️\n      - ✖️\n    * - parse_it_\n      - ✔️\n      - ✔️\n      - ✔️\n      - ✔️\n      - ❓\n      - ✖️\n    * - Grift_\n      - ✖️\n      - ✖️\n      - ✖️\n      - ❓\n      - ✔️\n      - ✖️\n    * - profig_\n      - ✖️\n      - ✔️\n      - ✖️\n      - ❓\n      - ✔️\n      - ✖️\n    * - tweak_\n      - ✔️\n      - ✖️\n      - ✖️\n      - ✔️\n      - ✖️\n      - ✖️\n    * - Bison_\n      - ✔️\n      - ❓\n      - ✔️\n      - ✔️\n      - ✔️\n      - ✖️\n    * - Config-Man_\n      - ✖️\n      - ✔️\n      - ✔️\n      - ❓\n      - ✔️\n      - ✖️\n    * - figga_\n      - ✔️\n      - ✖️\n      - ✔️\n      - ❓\n      - ✖️\n      - ✖️\n    * - **Onacol**\n      - ✔️\n      - ✔️\n      - ✔️\n      - ✔️\n      - ✔️\n      - ✔️\n\nInstallation\n------------\n\nAs usually with pip::\n\n    $ pip install onacol\n\nUsage\n-----\n\nDefault configuration file & schema\n+++++++++++++++++++++++++++++++++++\n\nThe whole point of this library is the definition of both default configuration\nand configuration schema in one YAML file (i.e. single source of configuration\ntruth).\n\nLet\'s start with a simple `default_config.yaml` file that is part of an\napplication\'s package. This file contains default values for the configuration.\n\n.. code-block:: yaml\n\n    general:\n        # Logging level for this application.\n        log_level: INFO\n\n    ui:\n        # Address and port of the UI webserver\n        addr: 0.0.0.0\n        port: 8888\n\n    sensors:\n        sensor_reset_interval: 30.0  # Sensor reset interval in seconds\n        connected_units:\n            - id: 0                     # Sensor ID <0, 16>\n              name: "Basic sensor"\n              min_trigger_limit: 30     # Minimal triggering limit [cm]\n              max_trigger_limit: 120    # Maximal triggering limit [cm]\n            - id: 1\n              name: "Additional sensor"\n              min_trigger_limit: 40\n              max_trigger_limit: 100\n\nThis file can be used as it is. However, we can add a schema definition to the\nstructure, that will allow parameter validation and automatic type conversion.\n\nThis is done by adding metadata to the YAML structure. Following metadata are\nrecognized by Onacol:\n\n* `oc_schema`: Cerberus_ validator/schema definitions.\n* `oc_default`: Default value (if metadata are attached to the YAML element, it\n  can no longer bear the value directly.\n* `oc_schema_id`: Definition of a schema reference (see TODO)\n\nSchema metadata are NOT MANDATORY. We can only provide them to parameters for\nwhich we think validation (or type conversion) may be useful.\n\n.. code-block:: yaml\n\n    general:\n        # Logging level for this application.\n        log_level: INFO\n\n    ui:\n        # Address and port of the UI webserver\n        addr:\n            oc_default: 0.0.0.0\n            oc_schema:\n                type: string\n                regex: "^(?:[0-9]{1,3}\\.){3}[0-9]{1,3}$"\n\n        port:\n            oc_default: 8888\n            oc_schema:\n                type: integer\n\n    sensors:\n        sensor_reset_interval:          # Sensor reset interval in seconds\n            oc_default: 30.0\n            oc_schema:\n                type: float\n                min: 0.0\n                max: 100.0\n        connected_units:\n            - id:                       # Sensor ID <0, 16>\n                oc_default: 0\n                oc_schema:\n                    type: integer\n                    min: 0\n                    max: 16\n              name: "Basic sensor"\n              min_trigger_limit:        # Minimal triggering limit [cm]\n                oc_default: 30\n                oc_schema:\n                    type: integer\n                    min: 0\n                    max: 200\n              max_trigger_limit:        # Maximal triggering limit [cm]\n                oc_default: 120\n                oc_schema:\n                    type: integer\n                    min: 0\n                    max: 200\n            - id: 1\n              name: "Additional sensor"\n              min_trigger_limit: 40\n              max_trigger_limit: 100\n\nNote that for list definitions, schema is added only to the first element of the\nlist. Other elements will be validated based on the first element\'s schema.\n\n\nLoading and validating configuration in an application\n++++++++++++++++++++++++++++++++++++++++++++++++++++++\n\nOnacol is used by the application via the `ConfigManager` instance.\n`ConfigManager` can load configurations from multiple sources (files,\ncommand line optional arguments, environment variables), but does not do it\nautomatically - the sources and order is up to the app implementation.\n\nExample (using Click_ as a CLI framework):\nTODO\n\n\n* Free software: MIT license\n* Documentation: https://onacol.readthedocs.io.\n\n\nFeatures\n--------\n\n* TODO\n\nCredits\n-------\n\nThis package was created with Cookiecutter_ and the `audreyr/cookiecutter-pypackage`_ project template.\n\n\nLimitations\n-----------\n\nVariable-count structures must be contained in lists.\nComments following oc_* tags are not kept.\n\n.. _Cookiecutter: https://github.com/audreyr/cookiecutter\n.. _`audreyr/cookiecutter-pypackage`: https://github.com/audreyr/cookiecutter-pypackage\n.. _Cerberus: https://docs.python-cerberus.org/en/stable/\n.. _Hydra: https://hydra.cc/\n.. _Config-Man: https://github.com/mmohaveri/config-man\n.. _Dynaconf: https://github.com/rochacbruno/dynaconf\n.. _Pydantic: https://pydantic-docs.helpmanual.io/\n.. _python-dotenv: https://github.com/theskumar/python-dotenv\n.. _`Gin Config`: https://github.com/google/gin-config\n.. _OmegaConf: https://github.com/omry/omegaconf\n.. _Confuse: https://github.com/beetbox/confuse\n.. _`Python Decouple`: https://github.com/henriquebastos/python-decouple\n.. _parse_it: https://github.com/naorlivne/parse_it\n.. _grift: https://github.com/kensho-technologies/grift\n.. _profig: https://github.com/dhagrow/profig\n.. _tweak: https://github.com/kislyuk/tweak\n.. _Bison: https://github.com/edaniszewski/bison\n.. _figga: https://github.com/berislavlopac/figga\n.. _Click: https://click.palletsprojects.com\n',
    'author': 'Josef Nevrly',
    'author_email': None,
    'maintainer': None,
    'maintainer_email': None,
    'url': None,
    'packages': packages,
    'package_data': package_data,
    'install_requires': install_requires,
    'python_requires': '>=3.6,<4.0',
}


setup(**setup_kwargs)
