{ "info": { "author": "Maples7", "author_email": "maples7@163.com", "bugtrack_url": null, "classifiers": [ "Development Status :: 5 - Production/Stable", "Intended Audience :: Developers", "License :: OSI Approved :: MIT License", "Programming Language :: Python :: 2.6", "Programming Language :: Python :: 2.7", "Programming Language :: Python :: 3.3", "Programming Language :: Python :: 3.4", "Programming Language :: Python :: 3.5", "Programming Language :: Python :: 3.6", "Topic :: Software Development :: Libraries :: Python Modules" ], "description": "=========\npy-config\n=========\n\n.. image:: https://travis-ci.org/Maples7/py-config.svg?branch=master\n :target: https://travis-ci.org/Maples7/py-config\n\n.. image:: https://img.shields.io/pypi/v/py-app-config.svg\n :target: https://pypi.python.org/pypi/py-app-config\n\nPython Application Configuration. Py-config organizes hierarchical configurations for your app deployments.\n\n\nUsage\n=====\n\nInstallation\n------------\n\n.. code:: shell\n\n pip install py-app-config\n\n\nBest Practice\n-------------\n\nFirstly, you should have a ``config`` folder under the codebase of your application, like this:\n\n.. code:: shell\n\n .\n \u251c\u2500\u2500 config\n \u2502 \u251c\u2500\u2500 __init__.py\n \u2502 \u251c\u2500\u2500 default.json\n \u2502 \u251c\u2500\u2500 development.json\n \u2502 \u251c\u2500\u2500 production.json\n \u2502 \u2514\u2500\u2500 test.json\n .\n\n\nSecondly, set environment variable ``PY_ENV`` to one of the names of JOSN files in the ``config`` folder, and it defaults to be ``development``.\n\nIn your ``__init__.py`` under ``config`` folder, these codes can be used:\n\n.. code:: python\n\n import os\n from py_config import set_config_dir, get_config\n\n config_dir = os.path.abspath(os.path.dirname(__file__))\n set_config_dir(config_dir)\n config = get_config()\n\nThen, you can use ``from config import config`` to import your app config in any other places in you codebase.\n\nThe final ``config`` would **merge** ``default.json`` and ``.json``. See `dict-recursive-update `_ for the **recursive** update rules.\n\n\nAPIs\n----\n\n.. code:: python\n\n # Set the config directory path\n set_config_dir(\n config_dir=None # Directory path of `config` folder\n )\n\n # Get final config according to the `config_dir`. \n # It should be executed every time after a new `config_dir` is set.\n get_config()\n\n\nRelatives\n=========\n\n- `dict-recursive-update `_\n- `node-config `_\n\n\nLicense\n=======\n`MIT <./LICENSE.txt>`_\n\n\n\n", "description_content_type": "", "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/Maples7/py-config", "keywords": "application configuration recursive update read config", "license": "MIT", "maintainer": "", "maintainer_email": "", "name": "py-app-config", "package_url": "https://pypi.org/project/py-app-config/", "platform": "", "project_url": "https://pypi.org/project/py-app-config/", "project_urls": { "Homepage": "https://github.com/Maples7/py-config" }, "release_url": "https://pypi.org/project/py-app-config/1.0.0/", "requires_dist": [ "dict-recursive-update (==1.0.1)" ], "requires_python": "", "summary": "Python Application Configuration.", "version": "1.0.0" }, "last_serial": 3927632, "releases": { "1.0.0": [ { "comment_text": "", "digests": { "md5": "e663f2b687d049499e75bbaee2fd7312", "sha256": "21678da979ee5e42703f175b53df73b4f807a1923dfb2f1f692b653b79f2bd25" }, "downloads": -1, "filename": "py_app_config-1.0.0-py3-none-any.whl", "has_sig": false, "md5_digest": "e663f2b687d049499e75bbaee2fd7312", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 4852, "upload_time": "2018-06-04T10:56:23", "url": "https://files.pythonhosted.org/packages/1a/96/12d273ab1e62aae7ccc54a6d329188ced6dffac44bd9ca4dec1930219958/py_app_config-1.0.0-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "95ba3bd7bd3cf8057c1d84d8a61cc4b7", "sha256": "caf679cc3338a3c767925dcf15168b73e8a04f2407817904f2b4dd952f0a2df0" }, "downloads": -1, "filename": "py-app-config-1.0.0.tar.gz", "has_sig": false, "md5_digest": "95ba3bd7bd3cf8057c1d84d8a61cc4b7", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 2735, "upload_time": "2018-06-04T10:56:24", "url": "https://files.pythonhosted.org/packages/5a/14/0bee1d4aec62434064347fefa93e1c50cd98ec977e321aa71201f02a6643/py-app-config-1.0.0.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "e663f2b687d049499e75bbaee2fd7312", "sha256": "21678da979ee5e42703f175b53df73b4f807a1923dfb2f1f692b653b79f2bd25" }, "downloads": -1, "filename": "py_app_config-1.0.0-py3-none-any.whl", "has_sig": false, "md5_digest": "e663f2b687d049499e75bbaee2fd7312", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 4852, "upload_time": "2018-06-04T10:56:23", "url": "https://files.pythonhosted.org/packages/1a/96/12d273ab1e62aae7ccc54a6d329188ced6dffac44bd9ca4dec1930219958/py_app_config-1.0.0-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "95ba3bd7bd3cf8057c1d84d8a61cc4b7", "sha256": "caf679cc3338a3c767925dcf15168b73e8a04f2407817904f2b4dd952f0a2df0" }, "downloads": -1, "filename": "py-app-config-1.0.0.tar.gz", "has_sig": false, "md5_digest": "95ba3bd7bd3cf8057c1d84d8a61cc4b7", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 2735, "upload_time": "2018-06-04T10:56:24", "url": "https://files.pythonhosted.org/packages/5a/14/0bee1d4aec62434064347fefa93e1c50cd98ec977e321aa71201f02a6643/py-app-config-1.0.0.tar.gz" } ] }