{ "info": { "author": "Giesela Inc.", "author_email": "team@giesela.dev", "bugtrack_url": null, "classifiers": [], "description": "# konfi\n\n[![CircleCI](https://circleci.com/gh/gieseladev/konfi.svg?style=svg)](https://circleci.com/gh/gieseladev/konfi)\n[![PyPI](https://img.shields.io/pypi/v/konfi.svg)](https://pypi.org/project/konfi/)\n[![Documentation Status](https://readthedocs.org/projects/konfi/badge/?version=latest)](https://konfi.giesela.dev/en/latest/?badge=latest)\n\nkonfi lets you create config templates similar to \n[dataclasses](https://docs.python.org/3/library/dataclasses.html). \nThese templates are then used to load the config from different sources.\nkonfi guarantees that the loaded config corresponds to the template even\ngoing as far as making sure items of a list are of the right type.\n\nThis means you no longer have to worry about the validity of the config,\nif the config is correct it will load and if it isn't it will raise an\nerror telling you why not.\n\n\n## Installation\n\nYou can install konfi from [PyPI](https://pypi.org/project/konfi/):\n\n```bash\npip install konfi\n```\n\n\n## Example\n\n```python\nfrom typing import Optional\n\nimport konfi\n\n\n@konfi.template()\nclass UserInfo:\n name: str\n country: Optional[str]\n\n\n@konfi.template()\nclass AppConfig:\n name: str = \"konfi\"\n user: UserInfo\n\n\nkonfi.set_sources(\n konfi.YAML(\"config.yml\", ignore_not_found=True),\n konfi.Env(prefix=\"app_\"),\n)\n\nconfig = konfi.load(AppConfig)\n\ngreeting = f\"Hello {config.user.name}\"\nif config.user.country:\n greeting += f\" from {config.user.country}\"\n\nprint(greeting)\nprint(f\"Welcome to {config.name}!\")\n```\n\nFor more examples see the [examples/](examples) directory.\n\n\n## Documentation\n\nIf you're ready to jump in, you can find the documentation on \n[Read the Docs](https://konfi.giesela.dev).\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/gieseladev/konfi", "keywords": "", "license": "MIT", "maintainer": "", "maintainer_email": "", "name": "konfi", "package_url": "https://pypi.org/project/konfi/", "platform": "", "project_url": "https://pypi.org/project/konfi/", "project_urls": { "Homepage": "https://github.com/gieseladev/konfi" }, "release_url": "https://pypi.org/project/konfi/0.2.1/", "requires_dist": [ "toml", "pyyaml", "sphinx ; extra == 'docs'", "sphinx-autodoc-typehints ; extra == 'docs'" ], "requires_python": "", "summary": "Python config management, but cute.", "version": "0.2.1" }, "last_serial": 5579516, "releases": { "0.0.1": [ { "comment_text": "", "digests": { "md5": "09e7b137a492f059724418dd9765c29e", "sha256": "d61623811f5bc89885bd424d1a842fed8742202251ca05d858fc0c897fc7c200" }, "downloads": -1, "filename": "konfi-0.0.1-py3-none-any.whl", "has_sig": false, "md5_digest": "09e7b137a492f059724418dd9765c29e", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 17817, "upload_time": "2019-06-30T20:52:59", "url": "https://files.pythonhosted.org/packages/88/8b/291d26390bcd4a1b2e2be95ce3c861065d32fd7dfe7250091c355efe1989/konfi-0.0.1-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "2a1527b2fb6046baacee56058702c8af", "sha256": "095a4b1ae9aa69fc574436435abe3a1b24ba6b46c5033b52e5af23baa902cba4" }, "downloads": -1, "filename": "konfi-0.0.1.tar.gz", "has_sig": false, "md5_digest": "2a1527b2fb6046baacee56058702c8af", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 12319, "upload_time": "2019-06-30T20:53:01", "url": "https://files.pythonhosted.org/packages/4b/3f/fdc82a6e487a2b3b95ab159a2bc7ff3fdc9a1886f2b45d98e65b5c4fb404/konfi-0.0.1.tar.gz" } ], "0.0.2": [ { "comment_text": "", "digests": { "md5": "8ebce6bcdec4fc57da666e5d06ef06ac", "sha256": "d3458838430dae191751f8f66771798a46fd811c56ef4b1b678ea1f6de531a01" }, "downloads": -1, "filename": "konfi-0.0.2-py3-none-any.whl", "has_sig": false, "md5_digest": "8ebce6bcdec4fc57da666e5d06ef06ac", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 20083, "upload_time": "2019-07-01T18:53:18", "url": "https://files.pythonhosted.org/packages/3a/b4/ce4380e4e32c3a474e01f6d47582cfcd2bdfd6dcf815211b9fcaa38345f7/konfi-0.0.2-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "537b9b4ad14e7ee27e8b7aa10866c3e9", "sha256": "a1fb5529dcafd7bd9c07988042b29aa06b1e0c108201b095eb0d8dd7bf4a40e0" }, "downloads": -1, "filename": "konfi-0.0.2.tar.gz", "has_sig": false, "md5_digest": "537b9b4ad14e7ee27e8b7aa10866c3e9", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 14873, "upload_time": "2019-07-01T18:53:19", "url": "https://files.pythonhosted.org/packages/a4/e0/b11ddbd91ade9347db39cdebddbd75d667cd4f1c08e47ca4a400f7dc412a/konfi-0.0.2.tar.gz" } ], "0.1.0": [ { "comment_text": "", "digests": { "md5": "278ec898cbf3ed72b2e90fc36997bb55", "sha256": "7bf07c2a034a43f77e9c565f8a5148010f3ff63751161aee3b16da24e920995f" }, "downloads": -1, "filename": "konfi-0.1.0-py3-none-any.whl", "has_sig": false, "md5_digest": "278ec898cbf3ed72b2e90fc36997bb55", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 21421, "upload_time": "2019-07-03T09:59:22", "url": "https://files.pythonhosted.org/packages/4d/d8/80f9ca7aae6f29717f30926ac12f7ce79dc303656d397bed660c86679399/konfi-0.1.0-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "3c160e7c18ff77bf9a8b89e529290d10", "sha256": "6e658764b872ca6a9d679d1f97c2a5996f78656bc171caa163f03fb880678585" }, "downloads": -1, "filename": "konfi-0.1.0.tar.gz", "has_sig": false, "md5_digest": "3c160e7c18ff77bf9a8b89e529290d10", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 16149, "upload_time": "2019-07-03T09:59:23", "url": "https://files.pythonhosted.org/packages/48/9c/e5098d5cc1ec0e60f713ecd32e891fa1a44b8553daf6b429f9f7ad990011/konfi-0.1.0.tar.gz" } ], "0.2.0": [ { "comment_text": "", "digests": { "md5": "092019545ea387db1b0967559e8f9fe1", "sha256": "0ad1cd9ca8960e51028895503293634517c7e316d46aee538c739c88d13c7d5e" }, "downloads": -1, "filename": "konfi-0.2.0-py3-none-any.whl", "has_sig": false, "md5_digest": "092019545ea387db1b0967559e8f9fe1", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 23228, "upload_time": "2019-07-15T17:55:05", "url": "https://files.pythonhosted.org/packages/df/39/e79a38e3b7559de902a381b0de32b91c183690bd5144c6a6925c7476271b/konfi-0.2.0-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "729e531ca692eda28a1a633f4b69a4f4", "sha256": "170b9b190cdfeb3214de9f4f4ec405bd432bb34f642c5f5062e050e862a5594f" }, "downloads": -1, "filename": "konfi-0.2.0.tar.gz", "has_sig": false, "md5_digest": "729e531ca692eda28a1a633f4b69a4f4", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 17829, "upload_time": "2019-07-15T17:55:06", "url": "https://files.pythonhosted.org/packages/06/85/3a1de2922b972a8d0cebea8c2cdd337f2d5c98545f70155ff1853fabb020/konfi-0.2.0.tar.gz" } ], "0.2.1": [ { "comment_text": "", "digests": { "md5": "50efb31a6d7ad46ddd8b679a9cfc63e1", "sha256": "e65f1a4b759cffc4fee219a1027ea61067c1c2bb62fac40fe420e6303610478f" }, "downloads": -1, "filename": "konfi-0.2.1-py3-none-any.whl", "has_sig": false, "md5_digest": "50efb31a6d7ad46ddd8b679a9cfc63e1", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 23230, "upload_time": "2019-07-24T20:05:07", "url": "https://files.pythonhosted.org/packages/a8/0a/a9cc5db11002c4b6144bfeadd6cc5355cee5c255af36ce5ada827a8aa7eb/konfi-0.2.1-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "e5b061657216e6c1967eb9873f95bb06", "sha256": "1cf67f153bbc8e9fd4112b573f43bec9410438a61e67dbce9bbe9bde7892137e" }, "downloads": -1, "filename": "konfi-0.2.1.tar.gz", "has_sig": false, "md5_digest": "e5b061657216e6c1967eb9873f95bb06", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 17831, "upload_time": "2019-07-24T20:05:08", "url": "https://files.pythonhosted.org/packages/a3/a7/bcce30842ee817e0682472583dab77d0824ed6926e169fc1443a1385d6d4/konfi-0.2.1.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "50efb31a6d7ad46ddd8b679a9cfc63e1", "sha256": "e65f1a4b759cffc4fee219a1027ea61067c1c2bb62fac40fe420e6303610478f" }, "downloads": -1, "filename": "konfi-0.2.1-py3-none-any.whl", "has_sig": false, "md5_digest": "50efb31a6d7ad46ddd8b679a9cfc63e1", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 23230, "upload_time": "2019-07-24T20:05:07", "url": "https://files.pythonhosted.org/packages/a8/0a/a9cc5db11002c4b6144bfeadd6cc5355cee5c255af36ce5ada827a8aa7eb/konfi-0.2.1-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "e5b061657216e6c1967eb9873f95bb06", "sha256": "1cf67f153bbc8e9fd4112b573f43bec9410438a61e67dbce9bbe9bde7892137e" }, "downloads": -1, "filename": "konfi-0.2.1.tar.gz", "has_sig": false, "md5_digest": "e5b061657216e6c1967eb9873f95bb06", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 17831, "upload_time": "2019-07-24T20:05:08", "url": "https://files.pythonhosted.org/packages/a3/a7/bcce30842ee817e0682472583dab77d0824ed6926e169fc1443a1385d6d4/konfi-0.2.1.tar.gz" } ] }