{ "info": { "author": "ikh software, inc.", "author_email": "ikh@ikhsoftware.com", "bugtrack_url": null, "classifiers": [ "License :: OSI Approved :: BSD License", "Operating System :: OS Independent", "Programming Language :: Python :: 3" ], "description": "# pyaconf - yet another config library built around python dictionary\n\nPyaconf is a config library that is built around python dictionary and supports dynamic python, json, yaml, and ini formats with inheritance.\nIt features:\n\n* All configs are json compatible dicts.\n* Supports layered configs (inheritance) via `__include__` dict entry, for example, the following yaml config would read the dictionary defined from config `boo.json` and then will update it with `user` and `password` from this config:\n\n```yaml\n__include__: boo.json\nuser: romeo\npassword: romeoalpha\n```\n\n* Includes may be used at any level and apply only to its layer. \n* Simple API: `load`, `dump`, and for more advanced use `merge`.\n* Supports dynamic configs written in Python `.pyaconf`, for example:\n\n```python\nimport os\ndef config():\n return dict(\n __include__ = [\"secret.yml\"],\n user = \"romeo\", \n password = os.environ['PASSWORD'],\n database = dict(\n __include__ = \"db.ini\",\n ),\n )\n```\n\n* Allows to output configs in `.json` and `.yaml`. Provides two shell scripts.\n* Supports `.ini` input format as understood by python's `configparser`.\n* Supports Jinji2 templates, you just need to add `.j2` or `.jinji2` extension to your config file and it will be processed by Jinji2. For example:\n\n```yaml\nuser: {{ username }}\npassword = {{ password }}\n```\n\n* The dictionary that contains includes serves as a context for these includes. For template includes, the dictionary is passed as a context to the template processing. For non-template includes, the dictionary merges with the include. When all includes processed this way, they all merge together.\n\n```yaml\n__include__: [a.yaml.j2, b.yaml]\nx: 1\ny: 2\n```\n\n* Another example with template:\n\n```yaml\n# common.yaml.j2\nhost: local\nuser: {{ username }}\npassword: {{ password }}\ncredentials: [{{ password }}, {{username}}]\n```\n\n```yaml\n# devel.yaml\n__include__: common.yaml.j2\nusername: Donald\npassword: Trump\noffice: 113D\n```\n\n```yaml\n# pyaconf_render -f json devel.yaml\n{\n \"credentials\": [\n \"Trump\",\n \"Donald\"\n ],\n \"host\": \"local\",\n \"password\": \"Trump\",\n \"user\": \"Donald\"\n}\n```\n\n## API\n\n### load\n\n```python\ndef load(src, *, format='auto', path=None, context={}):\n \"\"\" loads a dict that may include special keyword '__include__' at multiple levels,\n and resolves these includes and returns a dict without includes. It can also read the input dict from a file\n src -- dict|Mapping, FILE|io.StringIO(s), pathlib.Path|str\n format -- 'auto' | 'pyaconf' | 'json' | 'yaml' | 'ini'\n path -- is used only when src doesn't contain path info, it is used for error messages and resolve relative include paths\n context -- is a dict that is used as context for template rendering if src is a template\n \"\"\"\n```\n\n### dump\n\n```python\ndef dump(x, dst=sys.stdout, *, format='auto'):\n \"\"\" Dumps resolved (without includes) config in json or yaml format. It doesn't preserve comments either. \n x -- dict|Mapping\n dst -- FILE|io.StringIO(s), pathlib.Path|str\n format -- 'auto' | 'json' | 'yaml'\n \"\"\"\n```\n\n\n### merge\n\n```python\ndef merge(xs):\n \"\"\" merges the list of dicts (that dont contain includes) and returns a new dict\n where the values of the first dict are updated recursively by the values of the second dict.\n xs -- a list of dicts\n \"\"\"\n```\n\n## Scripts\n\n* pyaconf_render -- loads and merges multiple configs and renders the result in json or yaml format\n\n## License\n\nOSI Approved 3 clause BSD License\n\n## Prerequisites\n\n* Python 3.7+\n\n## Installation\n\nIf prerequisites are met, you can install `pyaconf` like any other Python package, using pip to download it from PyPI:\n\n $ pip install pyaconf\n\nor using `setup.py` if you have downloaded the source package locally:\n\n $ python setup.py build\n $ sudo python setup.py install\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://bitbucket.org/ikh/pyaconf", "keywords": "", "license": "", "maintainer": "", "maintainer_email": "", "name": "pyaconf", "package_url": "https://pypi.org/project/pyaconf/", "platform": "", "project_url": "https://pypi.org/project/pyaconf/", "project_urls": { "Bug Reports": "https://bitbucket.org/ikh/pyaconf/issues", "Homepage": "https://bitbucket.org/ikh/pyaconf" }, "release_url": "https://pypi.org/project/pyaconf/0.7.0/", "requires_dist": [ "pyyaml (==5.1.*)", "jinja2 (==2.10.*)" ], "requires_python": ">= 3.7", "summary": "Yet another config library that is built around python dictionary and supports dynamic python, json, yaml, and ini formats with inheritance with Jinji2 templates", "version": "0.7.0" }, "last_serial": 5822066, "releases": { "0.1.0": [ { "comment_text": "", "digests": { "md5": "abc2fb12ad325b3b5c373b52ac83f385", "sha256": "51009c4ae2fa155b92e756789c9357964342d7e40b2741d300c20378c7b7865c" }, "downloads": -1, "filename": "pyaconf-0.1.0-py3-none-any.whl", "has_sig": false, "md5_digest": "abc2fb12ad325b3b5c373b52ac83f385", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": ">= 3.7", "size": 4966, "upload_time": "2019-09-09T07:21:14", "url": "https://files.pythonhosted.org/packages/39/56/0ef7ed9a4092fe4ad6393cf42514d42556b34b0253924ee31da7aa19ef52/pyaconf-0.1.0-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "cc872892208a270f401c2c1864f244e0", "sha256": "1bf2aface584436d4120778b66282663ec6a52abcea8a860ef36cf7c90bee434" }, "downloads": -1, "filename": "pyaconf-0.1.0.tar.gz", "has_sig": false, "md5_digest": "cc872892208a270f401c2c1864f244e0", "packagetype": "sdist", "python_version": "source", "requires_python": ">= 3.7", "size": 2461, "upload_time": "2019-09-09T07:21:17", "url": "https://files.pythonhosted.org/packages/a6/df/70f9b7bdec7352c962ffa5334da3d3e0dec731bfd24291597ffc34c88b41/pyaconf-0.1.0.tar.gz" } ], "0.4.0": [ { "comment_text": "", "digests": { "md5": "062f70e1a19fefdb0feca7e64505695b", "sha256": "933315b8216e318bd6a3ee2a39fa431a2d826febfe43aab6ac51b8d4999ca770" }, "downloads": -1, "filename": "pyaconf-0.4.0-py3-none-any.whl", "has_sig": false, "md5_digest": "062f70e1a19fefdb0feca7e64505695b", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": ">= 3.7", "size": 7632, "upload_time": "2019-09-10T17:43:35", "url": "https://files.pythonhosted.org/packages/14/5b/eebcd389e47936cca7b5b446a720c78576d9334c5a4264d6883a4454dbda/pyaconf-0.4.0-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "65aa1f4eb0d7a45d9e8dd3055bbd1848", "sha256": "19cf50c06d7966a7ba5ff8c4eb8185c57580a14e8236831a9d6789f3769095da" }, "downloads": -1, "filename": "pyaconf-0.4.0.tar.gz", "has_sig": false, "md5_digest": "65aa1f4eb0d7a45d9e8dd3055bbd1848", "packagetype": "sdist", "python_version": "source", "requires_python": ">= 3.7", "size": 5254, "upload_time": "2019-09-10T17:43:37", "url": "https://files.pythonhosted.org/packages/6f/f2/dac7063a2d462c7d6862a5978e49aa6515b0f74160a58672980468d8761a/pyaconf-0.4.0.tar.gz" } ], "0.5.0": [ { "comment_text": "", "digests": { "md5": "f8506dd9da03c9f4a3deab071af06957", "sha256": "d529367fc35321ee1aaa1cde4e2d1d655c843c294662474e66eddb647099a1ee" }, "downloads": -1, "filename": "pyaconf-0.5.0-py3-none-any.whl", "has_sig": false, "md5_digest": "f8506dd9da03c9f4a3deab071af06957", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": ">= 3.7", "size": 8271, "upload_time": "2019-09-11T02:09:56", "url": "https://files.pythonhosted.org/packages/1f/46/2fb02c515c928cf1b059ee400710d4dca5cde2f1ac5eafd0f2131975608e/pyaconf-0.5.0-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "113c54a019a18f052636b8684a7b079c", "sha256": "3265956b3eaddb2e383d35e647efc1a160391ef11223c99e70793c520cf1014f" }, "downloads": -1, "filename": "pyaconf-0.5.0.tar.gz", "has_sig": false, "md5_digest": "113c54a019a18f052636b8684a7b079c", "packagetype": "sdist", "python_version": "source", "requires_python": ">= 3.7", "size": 4992, "upload_time": "2019-09-11T02:09:57", "url": "https://files.pythonhosted.org/packages/9a/05/1ef12e05aad5f6d84ab09b941ff838b12dd429af11d7d5565d6da34b7ec9/pyaconf-0.5.0.tar.gz" } ], "0.6.0": [ { "comment_text": "", "digests": { "md5": "ceace7ab82b57c5b3277250e6b25fcf6", "sha256": "3a1f73a54759027c8d04ee7154d581c43a7554f1c56cc9defd66fddd47d83cbe" }, "downloads": -1, "filename": "pyaconf-0.6.0-py3-none-any.whl", "has_sig": false, "md5_digest": "ceace7ab82b57c5b3277250e6b25fcf6", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": ">= 3.7", "size": 8740, "upload_time": "2019-09-12T01:37:49", "url": "https://files.pythonhosted.org/packages/f8/c8/3bb24aa936c279111c64ead3e592d9eb426c581c97cf487cccaaf809af4a/pyaconf-0.6.0-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "f4897031730149c427af40ac73d091b0", "sha256": "740c909e713dd86fffff031e1f55f60fc68f03f0b7721362c19b9369931cd657" }, "downloads": -1, "filename": "pyaconf-0.6.0.tar.gz", "has_sig": false, "md5_digest": "f4897031730149c427af40ac73d091b0", "packagetype": "sdist", "python_version": "source", "requires_python": ">= 3.7", "size": 5773, "upload_time": "2019-09-12T01:37:50", "url": "https://files.pythonhosted.org/packages/1e/68/a87ab0a55e645782701c045a777ac2f1a1fb60c47c7f107b9aad6f87f6e7/pyaconf-0.6.0.tar.gz" } ], "0.7.0": [ { "comment_text": "", "digests": { "md5": "93f679dedb638ca9720ce8375b13449b", "sha256": "ad6ab79df11940f6e510d19e0e86ef54221ca8f9d61a849eeb37bd01dab03477" }, "downloads": -1, "filename": "pyaconf-0.7.0-py3-none-any.whl", "has_sig": false, "md5_digest": "93f679dedb638ca9720ce8375b13449b", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": ">= 3.7", "size": 8960, "upload_time": "2019-09-12T19:10:09", "url": "https://files.pythonhosted.org/packages/0a/ec/32c616e138bbe13f13d03bf50e75313c83e0e482d52c0b450e6b6e27eb9a/pyaconf-0.7.0-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "feaeb1401e7791216401269aa47270a0", "sha256": "5f357fc5b365fea586b215b22dc333b351648928795507f84c38551c0940ec2e" }, "downloads": -1, "filename": "pyaconf-0.7.0.tar.gz", "has_sig": false, "md5_digest": "feaeb1401e7791216401269aa47270a0", "packagetype": "sdist", "python_version": "source", "requires_python": ">= 3.7", "size": 6064, "upload_time": "2019-09-12T19:10:12", "url": "https://files.pythonhosted.org/packages/37/44/163033f2526534637d1f08e0b48bb4de8f700d122ea62d257400fd37dc49/pyaconf-0.7.0.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "93f679dedb638ca9720ce8375b13449b", "sha256": "ad6ab79df11940f6e510d19e0e86ef54221ca8f9d61a849eeb37bd01dab03477" }, "downloads": -1, "filename": "pyaconf-0.7.0-py3-none-any.whl", "has_sig": false, "md5_digest": "93f679dedb638ca9720ce8375b13449b", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": ">= 3.7", "size": 8960, "upload_time": "2019-09-12T19:10:09", "url": "https://files.pythonhosted.org/packages/0a/ec/32c616e138bbe13f13d03bf50e75313c83e0e482d52c0b450e6b6e27eb9a/pyaconf-0.7.0-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "feaeb1401e7791216401269aa47270a0", "sha256": "5f357fc5b365fea586b215b22dc333b351648928795507f84c38551c0940ec2e" }, "downloads": -1, "filename": "pyaconf-0.7.0.tar.gz", "has_sig": false, "md5_digest": "feaeb1401e7791216401269aa47270a0", "packagetype": "sdist", "python_version": "source", "requires_python": ">= 3.7", "size": 6064, "upload_time": "2019-09-12T19:10:12", "url": "https://files.pythonhosted.org/packages/37/44/163033f2526534637d1f08e0b48bb4de8f700d122ea62d257400fd37dc49/pyaconf-0.7.0.tar.gz" } ] }