{ "info": { "author": "Emma Lefavor", "author_email": "emma.lefavor@gmail.com", "bugtrack_url": null, "classifiers": [ "License :: OSI Approved :: MIT License", "Programming Language :: Python", "Programming Language :: Python :: 3", "Programming Language :: Python :: 3.7", "Programming Language :: Python :: Implementation :: CPython", "Programming Language :: Python :: Implementation :: PyPy", "Topic :: Software Development :: Libraries" ], "description": "\n# declare_config\n\nThis Python module allows a declarative syntax for defining the contents of a\nconfiguration file. It also enables easy support for features such as default\nconfiguration values, nested configuration settings (and nested defaults), and\nvarious other useful automatic sugars.\n\n## Example:\n\n```\nfrom pathlib import Path\n\nfrom declare_config import Configuration,\n Setting, \\\n configuration_source, \\\n enable_nested_settings\n\n@configuration_provider(\"$MYAPP_CONFIG\")\n@configuration_provider(\"./myapp.yaml\")\n@configuration_provider(\"~/init/myapp.yaml\")\n@configuration_provider(\"~/.myapp.yaml\")\n@enable_nested_settings\n@enable_expanduser\nclass MyAppSettings(declare_config.Configuration):\n '''Settings for myapp.'''\n homepage = Setting('urls.root')\n api_root = Setting('urls.api_root', '${homepage}/api')\n timeout_ms = Setting('timeout_ms', 5000, int)\n log_file = Setting(\"log_location\", ~/logs/myapp.log\", Path)\n\nsettings = MyAppSettings.load()\n\n```\n\nThe above code defines a configuration file for a sample application. It\ndefines four locations that will be searched for the configuration file when\n`MyAppSettings.load()` is called: first it will check the value of\nthe environment variable `$MYAPP_CONFIG` for a file location, and then if no\nsuch environment variable is defined it will check the other three file\nlocations in order for a configuration file. Whenever it finds a valid file\nlocation, it will load the settings from that file.\n\nBecause of the `@enable_nested_settings` decorator, settings are allowed to\nreference one another (and default definitions are allowed to reference other\nsettings as well) through the `${setting_name}` syntax. All settings have type\ninformation,and the `@enable_expanduser` decorator ensures that for any\nsetting declared to be a filesystem path, the `~/` directory will be expanded\nto the user's home directory.\n\nCurrently only yaml configuration files are supported, though there are plans\nto add support for JSON and INI syntaxes.\n\n## Development\n\nDependencies are managed with `pipenv`. To install dependencies for\ndevelopment, run `pipenv install --dev` from the project root.\n\nTo run tests once with coverage, use `pipenv run pytest` from the project\nroot. To run tests continuously during development, run `pipenv run ptw`\ninstead.\n\nTo upload to PyPi, update setup.py with the version and any new dependencies\nand run `pipenv run python setup.py upload`.\n\n\n", "description_content_type": "text/markdown", "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/HardlyKnowEm/declare_config", "keywords": "", "license": "MIT", "maintainer": "", "maintainer_email": "", "name": "declare-config", "package_url": "https://pypi.org/project/declare-config/", "platform": "", "project_url": "https://pypi.org/project/declare-config/", "project_urls": { "Homepage": "https://github.com/HardlyKnowEm/declare_config" }, "release_url": "https://pypi.org/project/declare-config/1.0.1/", "requires_dist": [ "pyyaml" ], "requires_python": ">=3.7.0", "summary": "Declarative configuration settings for Python.", "version": "1.0.1" }, "last_serial": 5022552, "releases": { "1.0": [ { "comment_text": "", "digests": { "md5": "c2bafe21146139b453ccf0db08d10279", "sha256": "7ef63d0c301eaf1c3a2444f10936891bed6e9f921f2a14730b8d1f1e56dc55c8" }, "downloads": -1, "filename": "declare_config-1.0-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "c2bafe21146139b453ccf0db08d10279", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": ">=3.7.0", "size": 5436, "upload_time": "2019-03-31T19:02:54", "url": "https://files.pythonhosted.org/packages/e9/e6/9075bde8dbd611985f18207a92307425688f4891491c6998d45435d22d22/declare_config-1.0-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "2152f3c957403fadcb22c69dd885da72", "sha256": "93daf2b387810099248714b3a469dcbe799a7025d0a1270e88d263430aab6465" }, "downloads": -1, "filename": "declare-config-1.0.tar.gz", "has_sig": false, "md5_digest": "2152f3c957403fadcb22c69dd885da72", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3.7.0", "size": 5565, "upload_time": "2019-03-31T19:02:56", "url": "https://files.pythonhosted.org/packages/e3/05/8019f899326cbc5141b2dc37098b002ff99beb95dd7fde285eb897e0c467/declare-config-1.0.tar.gz" } ], "1.0.1": [ { "comment_text": "", "digests": { "md5": "e46b9508a92db467e6756f4efef0c30e", "sha256": "ac6cb32f3fb599fca4b88a89ae74959e8049cbcf3f7fd4fefb53f952d72559e7" }, "downloads": -1, "filename": "declare_config-1.0.1-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "e46b9508a92db467e6756f4efef0c30e", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": ">=3.7.0", "size": 5489, "upload_time": "2019-04-01T14:48:05", "url": "https://files.pythonhosted.org/packages/82/63/90a38bf98ef72e6849a1972cc425fb1463d12a5b7628c6c9f01ced890064/declare_config-1.0.1-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "bb5e717f2bb44b8164497a404f757c01", "sha256": "5c02a51bbf8a3e83b8eed98aac3a8daa602a9b7077801d00884a2ab470446639" }, "downloads": -1, "filename": "declare-config-1.0.1.tar.gz", "has_sig": false, "md5_digest": "bb5e717f2bb44b8164497a404f757c01", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3.7.0", "size": 5596, "upload_time": "2019-04-01T14:48:06", "url": "https://files.pythonhosted.org/packages/2d/98/a81ba3345fa57234f6e07ba822067c36f3db402c3e0af909d2232cf084d9/declare-config-1.0.1.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "e46b9508a92db467e6756f4efef0c30e", "sha256": "ac6cb32f3fb599fca4b88a89ae74959e8049cbcf3f7fd4fefb53f952d72559e7" }, "downloads": -1, "filename": "declare_config-1.0.1-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "e46b9508a92db467e6756f4efef0c30e", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": ">=3.7.0", "size": 5489, "upload_time": "2019-04-01T14:48:05", "url": "https://files.pythonhosted.org/packages/82/63/90a38bf98ef72e6849a1972cc425fb1463d12a5b7628c6c9f01ced890064/declare_config-1.0.1-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "bb5e717f2bb44b8164497a404f757c01", "sha256": "5c02a51bbf8a3e83b8eed98aac3a8daa602a9b7077801d00884a2ab470446639" }, "downloads": -1, "filename": "declare-config-1.0.1.tar.gz", "has_sig": false, "md5_digest": "bb5e717f2bb44b8164497a404f757c01", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3.7.0", "size": 5596, "upload_time": "2019-04-01T14:48:06", "url": "https://files.pythonhosted.org/packages/2d/98/a81ba3345fa57234f6e07ba822067c36f3db402c3e0af909d2232cf084d9/declare-config-1.0.1.tar.gz" } ] }