{ "info": { "author": "dashwav", "author_email": "", "bugtrack_url": null, "classifiers": [ "Development Status :: 4 - Beta", "Intended Audience :: Developers", "License :: OSI Approved :: Mozilla Public License 2.0 (MPL 2.0)", "Natural Language :: English", "Programming Language :: Python :: 3 :: Only", "Programming Language :: Python :: 3.6", "Programming Language :: Python :: 3.7", "Programming Language :: Python :: 3.8" ], "description": "# Gila\n\nGila is a python3 layered configuration library based very heavily on the [viper](https://github.com/spf13/viper) config library for Go. It is designed to facilitate making [12 factor](https://12factor.net/) apps as easy as possible using python3.\n\n# Motivation\n\nAfter having used the Viper config library in Go, I became very used to the ease of use and flexibility that it offered. After looking for a library to use in my python projects I was unable to find one that combined all of the very useful features that Viper supports.\n\n# Features\n\n* Allow default values to be set for each config key\n* Automatically find config files on multiple paths\n* Load in environment variables automatically that have a specific prefix\n* Support most popular config languages: `yaml, toml, json, properties files, hcl, dotenv`\n* Singleton pattern available for ease of use in most applications\n* Hierarchical loading for non-ambiguous results.\n\n# Installation\n\nRequires python 3.6+\n\n`pip install gila`\n\n# Simple Example\nMore examples can be found in the examples directory\n```python\nimport gila\nfrom os import environ\n\n# Setting default values for keys\ngila.set_default('host', 'localhost:8080')\ngila.set_default('allow_insecure', False)\n\n# This will tell Gila to automatically load in ENV vars that start with GILA\ngila.set_env_prefix('GILA')\ngila.automatic_env()\n\n# This would normally be done outside of program\n# eg. in docker compose or k8s manifest\nenviron['GILA_HOST'] = 'localhost:9999'\n\n# This is the preferred method of grabbing\n# the configurations. Other methods exist (all_config, debug)\n# but this method is the most performant for single\n# value calls.\nhost = gila.get('host')\nallow_insecure = gila.get('allow_insecure')\n\n\"\"\"\nOutput:\nHost: localhost:9999\nInsecure allowed: false\n\"\"\"\nprint(f'Host: {host}')\nprint(f'Insecure allowed: {allow_insecure}')\n```\n\n# Supported Config Filetypes\n* yaml (`.yaml, .yml`)\n* json (`.json`)\n* toml (`.toml`)\n* hcl (`.hcl`)\n* environment variables\n * Values will be cast to strings\n * Keys are cast to lowercase: ENV_VAR -> `gila.get('env_var')`\n* properties file (`.properties, .prop, .props`)\n * Values will be cast to strings\n* dotenv (`.env`)\n * Values will be cast to strings\n * No nested values supported\n\n\n# Additional Help\nCheck out our documentation on [ReadTheDocs](https://gila.readthedocs.io/en/latest/gila.html#) or if you prefer minimum working examples, checkout the directory which house a plethora of use cases from simple to more complex configurations.\n\n# Credits\nSteve Francia [spf13](https://github.com/spf13) for creating the Viper library\n\nAuthors of [pyyaml](https://github.com/yaml/pyyaml), [pyhcl](https://github.com/virtuald/pyhcl), and [toml](https://github.com/uiri/toml) packages, as Gila would have been much harder to create and maintain without them\n\n\n# Major differences from Viper\n\n* Case sensitivity - all keys in Gila are case sensitive, this allows for proper json, yaml, and toml support. ENV keys are not case sensitive unless manually bound.\n* No support for remote config - while I think that supporting consul and etcd is a very nice feature, I think at this moment in time that it is a feature that belongs in a seperate library.\n* No support for command flags - Viper relies pretty heavily on [Cobra](https://github.com/spf13/cobra) companionship for command flags. You should choose your own flavour of CLI parser (docopts, argparse, etc) and pair it with this library (check out our examples).\n* Watching for changes in config files - I would very much so like to add this feature, but it is not a feature that I felt was necessary at `v1.0.0`. If you would like this feature you can thumbs up [the issue](https://gitlab.com/dashwav/gila/issues/1), or open a PR with an implementation.\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://gitlab.com/dashwav/gila", "keywords": "", "license": "MPL2.0", "maintainer": "", "maintainer_email": "", "name": "gila", "package_url": "https://pypi.org/project/gila/", "platform": "", "project_url": "https://pypi.org/project/gila/", "project_urls": { "Homepage": "https://gitlab.com/dashwav/gila" }, "release_url": "https://pypi.org/project/gila/0.5.0/", "requires_dist": [ "PyYAML (==5.1.2)", "toml (==0.10.0)", "pyhcl (==0.3.13)", "python-dotenv (==0.10.3)" ], "requires_python": "", "summary": "A simple python3 config library based ongolang's spf13/viper", "version": "0.5.0", "yanked": false, "yanked_reason": null }, "last_serial": 7257553, "releases": { "0.2.0": [ { "comment_text": "", "digests": { "md5": "1026c7b5a001bb24140bc75b534e2c9f", "sha256": "b876e6bd3963eaaca1a346058568a5893290b8a6ec640c2c497ab66b5756d4a9" }, "downloads": -1, "filename": "gila-0.2.0-py3-none-any.whl", "has_sig": false, "md5_digest": "1026c7b5a001bb24140bc75b534e2c9f", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 12392, "upload_time": "2019-10-29T03:25:54", "upload_time_iso_8601": "2019-10-29T03:25:54.995525Z", "url": "https://files.pythonhosted.org/packages/87/ee/d54112fc338fc03fd73944ec5b3d0573ec628f7f94f9c2469a0164f58d16/gila-0.2.0-py3-none-any.whl", "yanked": false, "yanked_reason": null } ], "0.3.0": [ { "comment_text": "", "digests": { "md5": "16b9cbaaa8c4d8d4c564f185c30d357d", "sha256": "c44d989113f9969e82be074abc6345680b468090787d73dd99b11694509fba05" }, "downloads": -1, "filename": "gila-0.3.0-py3-none-any.whl", "has_sig": false, "md5_digest": "16b9cbaaa8c4d8d4c564f185c30d357d", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 12414, "upload_time": "2019-10-30T07:18:40", "upload_time_iso_8601": "2019-10-30T07:18:40.831687Z", "url": "https://files.pythonhosted.org/packages/d1/5d/fb0fd27790aed7360974a5a1bf268c83ccdebe0949171fb8199781f0a1db/gila-0.3.0-py3-none-any.whl", "yanked": false, "yanked_reason": null } ], "0.4.0": [ { "comment_text": "", "digests": { "md5": "a223cc901ff06b4c01bd255563e54953", "sha256": "c4afefc65ba976a4f7f612f622b222921dfb9b65e8e4abc016664139626435e1" }, "downloads": -1, "filename": "gila-0.4.0-py3-none-any.whl", "has_sig": false, "md5_digest": "a223cc901ff06b4c01bd255563e54953", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 15579, "upload_time": "2019-11-12T01:57:21", "upload_time_iso_8601": "2019-11-12T01:57:21.048301Z", "url": "https://files.pythonhosted.org/packages/ee/9b/06a2bdc029a2bc0381913f0f52e99de1493a19a91c192eb18b1850c41419/gila-0.4.0-py3-none-any.whl", "yanked": false, "yanked_reason": null } ], "0.5.0": [ { "comment_text": "", "digests": { "md5": "cb5a295f16d77b0f52221eca6f13d3ca", "sha256": "ad60bc37717d1c601333e67450e5fa9e554f9e3d7c4dd321ef803d7f56156d2c" }, "downloads": -1, "filename": "gila-0.5.0-py3-none-any.whl", "has_sig": false, "md5_digest": "cb5a295f16d77b0f52221eca6f13d3ca", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 15555, "upload_time": "2020-05-16T20:10:19", "upload_time_iso_8601": "2020-05-16T20:10:19.387165Z", "url": "https://files.pythonhosted.org/packages/3d/dc/6c634e03acbf8adeb598f10298edcccb178924f14f2aba943f1091bb30c6/gila-0.5.0-py3-none-any.whl", "yanked": false, "yanked_reason": null } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "cb5a295f16d77b0f52221eca6f13d3ca", "sha256": "ad60bc37717d1c601333e67450e5fa9e554f9e3d7c4dd321ef803d7f56156d2c" }, "downloads": -1, "filename": "gila-0.5.0-py3-none-any.whl", "has_sig": false, "md5_digest": "cb5a295f16d77b0f52221eca6f13d3ca", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 15555, "upload_time": "2020-05-16T20:10:19", "upload_time_iso_8601": "2020-05-16T20:10:19.387165Z", "url": "https://files.pythonhosted.org/packages/3d/dc/6c634e03acbf8adeb598f10298edcccb178924f14f2aba943f1091bb30c6/gila-0.5.0-py3-none-any.whl", "yanked": false, "yanked_reason": null } ], "vulnerabilities": [] }