{ "info": { "author": "Vladislav Blinov", "author_email": "cunningplan@yandex.ru", "bugtrack_url": null, "classifiers": [ "License :: OSI Approved :: MIT License", "Programming Language :: Python", "Programming Language :: Python :: 2.7", "Programming Language :: Python :: 3", "Programming Language :: Python :: 3.4", "Programming Language :: Python :: 3.5", "Programming Language :: Python :: 3.6", "Programming Language :: Python :: Implementation :: CPython" ], "description": "\nGranula: Multi-file Configurations for Python Applications\n==========================================================\n\n.. image:: https://img.shields.io/pypi/v/granula.svg\n :target: https://pypi.python.org/pypi/granula\n :alt: Package version\n\n.. image:: https://img.shields.io/pypi/l/granula.svg\n :target: https://pypi.python.org/pypi/granula\n :alt: Package license\n\n.. image:: https://img.shields.io/pypi/pyversions/granula.svg\n :target: https://pypi.python.org/pypi/granula\n :alt: Python versions\n\n.. image:: https://travis-ci.org/chomechome/granula.svg?branch=master\n :target: https://travis-ci.org/chomechome/granula\n :alt: TravisCI status\n\n.. image:: https://codecov.io/github/chomechome/granula/coverage.svg?branch=master\n :target: https://codecov.io/github/chomechome/granula\n :alt: Code coverage\n\n---------------\n\n**Granula** is a tool that aims to help maintain multi-file configurations for\nPython applications (with environments and more).\n\nInstallation\n------------\n\n::\n\n $ pipenv install granula\n\nor just use pip (though you should definitely take a look at `pipenv `_)\n\n\ud83c\udf08\ud83c\udf08\ud83c\udf08\n\nFeatures\n----------\n\n- Gathers configurations from multiple files or directories.\n- Supports widely used file formats (YAML, JSON).\n- Offers a small DSL that allows to load environment variables into config files.\n- Manages different configuration environments (e.g. testing, production).\n\nUsage\n-------\n\nCreate a config object from a directory with multiple configuration files:\n\n.. code-block:: python\n\n >> import granula\n >> config = granula.Config.from_directory('examples/multi-file/settings')\n >> config\n Config({'name': 'Darth Vader', ...})\n >> config.name\n 'Darth Vader'\n >> config.family\n Config({'fiancee': 'Padme Amidala', 'children': ['Luke Skywalker', 'Leia Organa']})\n\nFiles are parsed in lexicographic order. The values specified in the preceding files can be overwritten in the succeeding files.\n\nDo the same in a recursive manner:\n\n.. code-block:: python\n\n >> config = granula.Config.from_directory(..., recursive=True)\n\nMatch YAML files using filename pattern:\n\n.. code-block:: python\n\n >> config = granula.Config.from_directory(..., pattern=granula.Extension('yaml'))\n\nDo the same with a shell-style wildcard pattern:\n\n.. code-block:: python\n\n >> config = granula.Config.from_directory(..., pattern=granula.Wildcard('*.yaml'))\n\nMatch configuration files for different environments:\n\n.. code-block:: python\n\n >> directory = 'examples/environments/settings'\n >> testing = granula.Config.from_directory(directory, pattern=granula.Environment('testing'))\n >> production = granula.Config.from_directory(directory, pattern=granula.Environment('production'))\n\nCombine patterns in arbitrary ways:\n\n.. code-block:: python\n\n >> pattern = granula.All(granula.Environment('testing'), granula.Extension('yaml'))\n >> config = granula.Config.from_directory(..., pattern=pattern)\n\nLoad environment variables into config files using a DSL, for example, in YAML:\n\n.. code-block::\n\n variable: ${env VARIABLE}\n\nDo the same with a default value:\n\n.. code-block::\n\n variable: ${env VARIABLE | val 10}\n\n\n", "description_content_type": null, "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/chomechome/granula", "keywords": "", "license": "MIT", "maintainer": "", "maintainer_email": "", "name": "granula", "package_url": "https://pypi.org/project/granula/", "platform": "", "project_url": "https://pypi.org/project/granula/", "project_urls": { "Homepage": "https://github.com/chomechome/granula" }, "release_url": "https://pypi.org/project/granula/2018.2.8/", "requires_dist": [ "attrdict", "pyyaml", "enum34; python_version < \"3.4\"" ], "requires_python": "", "summary": "Multi-file Configurations for Python Applications", "version": "2018.2.8" }, "last_serial": 3622823, "releases": { "2018.2.8": [ { "comment_text": "", "digests": { "md5": "5f430c3a1c32f3e33768f6eaf339506a", "sha256": "0414111c511ddb30fecb1cdc458862f73075dda3591821a32d62c5ae0c928ac4" }, "downloads": -1, "filename": "granula-2018.2.8-py3-none-any.whl", "has_sig": false, "md5_digest": "5f430c3a1c32f3e33768f6eaf339506a", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 26530, "upload_time": "2018-02-27T19:37:39", "url": "https://files.pythonhosted.org/packages/ed/b6/98a44a2c6bcde90d4255e2b7881b92b21c2a3adc2ee9902dc1d3bed33e44/granula-2018.2.8-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "bd8b9055dd9e5511a6d218fbfdea8dfd", "sha256": "195e49368934710b1ac9b62df0d72504d90ff0915eb32e35171e70ff67aeacc1" }, "downloads": -1, "filename": "granula-2018.2.8.tar.gz", "has_sig": false, "md5_digest": "bd8b9055dd9e5511a6d218fbfdea8dfd", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 16656, "upload_time": "2018-02-27T19:37:41", "url": "https://files.pythonhosted.org/packages/9f/11/2216c2e4062e907d009d5316a524d5a3d5f1c2ead2d490fb6e02d66a3ed9/granula-2018.2.8.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "5f430c3a1c32f3e33768f6eaf339506a", "sha256": "0414111c511ddb30fecb1cdc458862f73075dda3591821a32d62c5ae0c928ac4" }, "downloads": -1, "filename": "granula-2018.2.8-py3-none-any.whl", "has_sig": false, "md5_digest": "5f430c3a1c32f3e33768f6eaf339506a", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 26530, "upload_time": "2018-02-27T19:37:39", "url": "https://files.pythonhosted.org/packages/ed/b6/98a44a2c6bcde90d4255e2b7881b92b21c2a3adc2ee9902dc1d3bed33e44/granula-2018.2.8-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "bd8b9055dd9e5511a6d218fbfdea8dfd", "sha256": "195e49368934710b1ac9b62df0d72504d90ff0915eb32e35171e70ff67aeacc1" }, "downloads": -1, "filename": "granula-2018.2.8.tar.gz", "has_sig": false, "md5_digest": "bd8b9055dd9e5511a6d218fbfdea8dfd", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 16656, "upload_time": "2018-02-27T19:37:41", "url": "https://files.pythonhosted.org/packages/9f/11/2216c2e4062e907d009d5316a524d5a3d5f1c2ead2d490fb6e02d66a3ed9/granula-2018.2.8.tar.gz" } ] }