{ "info": { "author": "Adam Meily", "author_email": "meily.adam@gmail.com", "bugtrack_url": null, "classifiers": [ "Development Status :: 4 - Beta", "Intended Audience :: Developers", "License :: OSI Approved :: ISC License (ISCL)", "Natural Language :: English", "Operating System :: OS Independent", "Programming Language :: Python", "Programming Language :: Python :: 3", "Topic :: Software Development :: Libraries :: Application Frameworks" ], "description": "# Cinco Config\n\n[![Build Status](https://travis-ci.org/ameily/cincoconfig.svg?branch=master)](https://travis-ci.org/ameily/cincoconfig)\n[![Coverage Status](https://coveralls.io/repos/github/ameily/cincoconfig/badge.svg?branch=master)](https://coveralls.io/github/ameily/cincoconfig?branch=master)\n\nNext generation universal configuration file parser. The config file structure is defined\nprogrammatically and expressively, no need to create classes and inheritance.\n\nLet's get right to it:\n\n```python\n# app_config.py\nimport getpass\nfrom cincoconfig import *\n\n# first, define the configuration's schema -- the fields available that\n# customize the application's or library's behavior\nschema = Schema()\nschema.mode = ApplicationModeField(default='production')\n\n# nested configurations are built on the fly\n# http is now a subconfig\nschema.http.port = PortField(default=8080, required=True)\n\n# each field has its own validation rules that are run anytime the config\n# value is loaded from disk or modified by the user.\n# here, this field only accepts IPv4 network addresses and the user is\n# required to define this field in the configuration file.\nschema.http.address = IPv4AddressField(default='127.0.0.1', required=True)\n\nschema.http.ssl.enabled = BoolField(default=False)\nschema.http.ssl.cafile = FilenameField()\nschema.http.ssl.keyfile = FilenameField()\nschema.http.ssl.certfile = FilenameField()\n\nschema.db.host = HostnameField(allow_ipv4=True, required=True, default='localhost')\nschema.db.port = PortField(default=27017, required=True)\nschema.db.name = StringField(default='my_app', required=True)\nschema.db.user = StringField(default='admin')\n\n# some configuration values are sensitive, such as credentials, so\n# cincoconfig provides config value encryption when the value is\n# saved to disk via the SecureField\nschema.db.password = SecureField()\n\n# once a schema is defined, build the actual configuration object\n# that can load config files from disk and interact with the values\nconfig = schema()\n\n# print the set http port\nprint(config.http.port) # >>> 8080\n\nconfig.db.password = getpass.getpass(\"Enter Password: \") # < 'password'\n\n# set a config value manually\nif config.mode == 'production':\n config.db.name = config.db.name + '_production'\n\nprint(config.dumps(format='json', pretty=True).decode())\n# {\n# \"mode\": \"production\",\n# \"http\": {\n# \"port\": 8080,\n# \"address\": \"127.0.0.1\"\n# \"ssl\": {\n# \"enabled\": false\n# }\n# },\n# \"db\": {\n# \"host\": \"localhost\",\n# \"port\": 27017,\n# \"name\": \"my_app_production\",\n# \"user\": \"admin\",\n# \"password\": {\n# \"method\": \"best\",\n# \"ciphertext\": \"\"\n# }\n# }\n# }\n```\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://cincoconfig.readthedocs.io/en/latest/", "keywords": "config,configuration", "license": "ISC", "maintainer": "", "maintainer_email": "", "name": "cincoconfig", "package_url": "https://pypi.org/project/cincoconfig/", "platform": "", "project_url": "https://pypi.org/project/cincoconfig/", "project_urls": { "Documentation": "https://cincoconfig.readthedocs.io/en/latest/", "Homepage": "https://cincoconfig.readthedocs.io/en/latest/", "Source": "https://github.com/ameily/cincoconfig/", "Travis CI": "https://travis-ci.org/ameily/cincoconfig" }, "release_url": "https://pypi.org/project/cincoconfig/0.2.1/", "requires_dist": [ "coverage ; extra == 'dev'", "mypy ; extra == 'dev'", "pycodestyle ; extra == 'dev'", "pylint ; extra == 'dev'", "pytest ; extra == 'dev'", "pytest-cov ; extra == 'dev'", "sphinx ; extra == 'dev'", "sphinx-autodoc-typehints ; extra == 'dev'", "sphinx-rtd-theme ; extra == 'dev'", "twine ; extra == 'dev'", "wheel ; extra == 'dev'", "bson ; extra == 'features'", "PyYAML ; extra == 'features'", "cryptography ; extra == 'features'" ], "requires_python": "", "summary": "Universal configuration file parser", "version": "0.2.1" }, "last_serial": 5720482, "releases": { "0.1.0": [ { "comment_text": "", "digests": { "md5": "cf37b6ab95e61a6b9f794d233ade42b9", "sha256": "63580b89c837055e8154121801a44b0200f2463d43455137c3bcc63b4c929642" }, "downloads": -1, "filename": "cincoconfig-0.1.0-py3-none-any.whl", "has_sig": false, "md5_digest": "cf37b6ab95e61a6b9f794d233ade42b9", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 30749, "upload_time": "2019-08-14T14:40:10", "url": "https://files.pythonhosted.org/packages/16/43/497c6a298ed98c3fd0400d844eb53e72febb3c020e793a85929b89b39d14/cincoconfig-0.1.0-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "dba8ba5b0e1bb0c0e36f75b1df27f817", "sha256": "c7b5a201c8920900b6ed05dd09244f7af0bdc5593a0337a4166862358476e6ed" }, "downloads": -1, "filename": "cincoconfig-0.1.0.tar.gz", "has_sig": false, "md5_digest": "dba8ba5b0e1bb0c0e36f75b1df27f817", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 31126, "upload_time": "2019-08-14T14:40:12", "url": "https://files.pythonhosted.org/packages/32/3a/d38910b9831b9bea6466d4435fd86a0eb4cbb16046844feca781c8e907c1/cincoconfig-0.1.0.tar.gz" } ], "0.2.0": [ { "comment_text": "", "digests": { "md5": "08c5df567696dc8aea56b8116f46d4fd", "sha256": "5f0d901fc1f14b25f151f0f7fe316dd2f8f8fb3b4b164a8e8ccbb8b6a5bdd150" }, "downloads": -1, "filename": "cincoconfig-0.2.0-py3-none-any.whl", "has_sig": false, "md5_digest": "08c5df567696dc8aea56b8116f46d4fd", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 32368, "upload_time": "2019-08-19T11:56:28", "url": "https://files.pythonhosted.org/packages/23/d9/0585229b5e3d838506375db267fa3445e151c1bbf30ea4c2593f877fcf05/cincoconfig-0.2.0-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "538961558995ab56088ae608d929391b", "sha256": "e4a6136b9b5fccb72d382860a00f30f54fa58b48c7d7f06e29ec889422c14410" }, "downloads": -1, "filename": "cincoconfig-0.2.0.tar.gz", "has_sig": false, "md5_digest": "538961558995ab56088ae608d929391b", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 32539, "upload_time": "2019-08-19T11:56:30", "url": "https://files.pythonhosted.org/packages/7c/b1/152746f1f2a797e895c9786d0c20f1f0ed26fd3ec58cb189563493b28245/cincoconfig-0.2.0.tar.gz" } ], "0.2.1": [ { "comment_text": "", "digests": { "md5": "b96ee5c869133ce03b8de0514aa24be6", "sha256": "f4d2d18a221b5fa442c5f7bd859cde43c136ae8fe63bf59cb385f3b9ed322b5c" }, "downloads": -1, "filename": "cincoconfig-0.2.1-py3-none-any.whl", "has_sig": false, "md5_digest": "b96ee5c869133ce03b8de0514aa24be6", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 32549, "upload_time": "2019-08-23T12:17:51", "url": "https://files.pythonhosted.org/packages/2a/e4/b340126373a478a78a245279aae42da8c4c5e98eed5371e85728ceda0d7d/cincoconfig-0.2.1-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "345b6fd144e88ff9575e80d48ca99a1f", "sha256": "f98e2a3f0834b0c9d6c563751669efe611ffb0a0fd4880dd8f1afc624a37b1e5" }, "downloads": -1, "filename": "cincoconfig-0.2.1.tar.gz", "has_sig": false, "md5_digest": "345b6fd144e88ff9575e80d48ca99a1f", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 32829, "upload_time": "2019-08-23T12:17:52", "url": "https://files.pythonhosted.org/packages/7e/b5/0f908d8f8753f2e59e8e82910705f0a937c4b75feb45717befd30efd543c/cincoconfig-0.2.1.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "b96ee5c869133ce03b8de0514aa24be6", "sha256": "f4d2d18a221b5fa442c5f7bd859cde43c136ae8fe63bf59cb385f3b9ed322b5c" }, "downloads": -1, "filename": "cincoconfig-0.2.1-py3-none-any.whl", "has_sig": false, "md5_digest": "b96ee5c869133ce03b8de0514aa24be6", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 32549, "upload_time": "2019-08-23T12:17:51", "url": "https://files.pythonhosted.org/packages/2a/e4/b340126373a478a78a245279aae42da8c4c5e98eed5371e85728ceda0d7d/cincoconfig-0.2.1-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "345b6fd144e88ff9575e80d48ca99a1f", "sha256": "f98e2a3f0834b0c9d6c563751669efe611ffb0a0fd4880dd8f1afc624a37b1e5" }, "downloads": -1, "filename": "cincoconfig-0.2.1.tar.gz", "has_sig": false, "md5_digest": "345b6fd144e88ff9575e80d48ca99a1f", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 32829, "upload_time": "2019-08-23T12:17:52", "url": "https://files.pythonhosted.org/packages/7e/b5/0f908d8f8753f2e59e8e82910705f0a937c4b75feb45717befd30efd543c/cincoconfig-0.2.1.tar.gz" } ] }