{ "info": { "author": "Ivan Chernousov", "author_email": "krusnik.viers@gmail.com", "bugtrack_url": null, "classifiers": [ "Development Status :: 4 - Beta", "Intended Audience :: Developers", "License :: OSI Approved :: MIT License", "Operating System :: OS Independent", "Programming Language :: Python", "Programming Language :: Python :: 3", "Programming Language :: Python :: 3.5", "Programming Language :: Python :: 3.6", "Programming Language :: Python :: 3.7", "Programming Language :: Python :: 3.8", "Programming Language :: Python :: Implementation :: PyPy", "Topic :: Software Development :: Libraries" ], "description": "# flexiconf\nSimple and flexible separation settings from code\n\n[![Build Status](https://travis-ci.org/KrusnikViers/flexiconf.svg?branch=master)](https://travis-ci.org/KrusnikViers/flexiconf)\n[![codecov](https://codecov.io/gh/KrusnikViers/flexiconf/branch/master/graph/badge.svg)](https://codecov.io/gh/KrusnikViers/flexiconf)\n[![PyPI version](https://badge.fury.io/py/flexiconf.svg)](https://badge.fury.io/py/flexiconf)\n[![Maintainability](https://api.codeclimate.com/v1/badges/f947f0c596656595854f/maintainability)](https://codeclimate.com/github/KrusnikViers/flexiconf/maintainability)\n\nInstall: `pip install flexiconf`\n\n## How to use:\n### Config creation:\n```\nimport flexiconf\nconfig = flexiconf.Configuration([ ...loaders... ])\n```\nConfiguration is being read at the moment of an object creation, all `get` are fast and read-only operations. Sources of the configuration are defined by loaders list, that will be described later.\n\nYou may also create multiple configurations with different sources - for example, parse command line parameters first, to define configuration files to be read as a full config later.\n\n### Accessing parameters:\n\nConfiguration is treated as a tree of dicts and lists. For best compatibility, recommended to use only alphanumeric symbols and `_` as a key. Point `.` inside the key is treated as a divider between nested sections during both parsing ang getting.\n\nAfter being parsed, tree could be received directly by `Configuration.as_dict()` method. \n\nDifferent parameters could be received via get operators: with auto cast (`config.get_bool(...)`, `config.get_int(...)`, etc) or by generic `get` method. `get` methods receive `key_path` parameter (e.g. `section_1.subsection.key_name`) and optional `default` parameter of any type, including `None`. `KeyError` will be raised, if key was not found and default option was not provided.\n\n### Loaders:\nLoaders are objects, that read configuration from different sources. Loaders are executed in direct order, later loaders will override previously parsed options with the same keys.\n\n`JsonLoader` and `IniLoader` are both take optional `config_files_pattern` parameter, describing `glob` pattern to files with configuration. If not provided, parser will look for all `*.json/*.ini` files in the caller directory recursively.\n\n`EnvLoader` takes optional `pattern` parameter, to define keys to be added in configuration.\n\n`ArgsLoader` looks for all command line parameters with `key=value` format, with optional number of `-` as a prefix.\n\n### Custom loaders:\nIf you want to write your own loader, you could simply inherit from `flexiconf.BaseLoader` class and implement `load` method.\n\n### Contribution:\nIf you have some improvements, bug fixes or think, that your loader will be useful for other people, feel free to create pull request!", "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/KrusnikViers/flexiconf", "keywords": "", "license": "", "maintainer": "", "maintainer_email": "", "name": "flexiconf", "package_url": "https://pypi.org/project/flexiconf/", "platform": "", "project_url": "https://pypi.org/project/flexiconf/", "project_urls": { "Homepage": "https://github.com/KrusnikViers/flexiconf" }, "release_url": "https://pypi.org/project/flexiconf/1.0.4/", "requires_dist": null, "requires_python": "", "summary": "Simple and flexible separation settings from code", "version": "1.0.4" }, "last_serial": 4854315, "releases": { "1.0.0": [ { "comment_text": "", "digests": { "md5": "c37e83ad793ccb0715bcc537abdeee9c", "sha256": "07bda1e17548ea113173d6bf7b74e1ca660787e8cfb24d2ddd137125cf8ed9ef" }, "downloads": -1, "filename": "flexiconf-1.0.0.tar.gz", "has_sig": false, "md5_digest": "c37e83ad793ccb0715bcc537abdeee9c", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 3186, "upload_time": "2019-02-21T15:20:29", "url": "https://files.pythonhosted.org/packages/dd/fe/41aabf783cfe52ac5284aee27a336ca770142580efaa9b916d21c41ad80c/flexiconf-1.0.0.tar.gz" } ], "1.0.1": [ { "comment_text": "", "digests": { "md5": "ce7c821b22de13fe680025fc6a3b14b6", "sha256": "82f408e10a9883a05d06ab065468265a1d42ced16ecd0ad6772ca632299bc59c" }, "downloads": -1, "filename": "flexiconf-1.0.1.tar.gz", "has_sig": false, "md5_digest": "ce7c821b22de13fe680025fc6a3b14b6", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 3420, "upload_time": "2019-02-21T15:44:54", "url": "https://files.pythonhosted.org/packages/bc/0b/4acc16d0d7c9d14c72eca70bffa8d367d47d3cd9acaddd409b1c25408c83/flexiconf-1.0.1.tar.gz" } ], "1.0.2": [ { "comment_text": "", "digests": { "md5": "ee65df925dbf770989bfff925eca0eae", "sha256": "3392721bd2ae49a5ed7e1bd60880c834fd869e638465875cc4e7a5ce7892a8d1" }, "downloads": -1, "filename": "flexiconf-1.0.2.tar.gz", "has_sig": false, "md5_digest": "ee65df925dbf770989bfff925eca0eae", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 3727, "upload_time": "2019-02-21T16:28:50", "url": "https://files.pythonhosted.org/packages/8f/ba/ea49d4a93f2005dc32a4f503f6bc083c2a1fd390eae2eba2d254c64b6379/flexiconf-1.0.2.tar.gz" } ], "1.0.3": [ { "comment_text": "", "digests": { "md5": "a287abbdb014356846b78f592aeea535", "sha256": "c048f30ee752827676a7de8f46aef0b6a70d3080a17282f2abbaba9105bafd07" }, "downloads": -1, "filename": "flexiconf-1.0.3.tar.gz", "has_sig": false, "md5_digest": "a287abbdb014356846b78f592aeea535", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 5052, "upload_time": "2019-02-21T23:08:02", "url": "https://files.pythonhosted.org/packages/0e/a0/d8ddb5c77cd12c2dca8289713c1242da3a502d3ef5e9e506ca763ca31794/flexiconf-1.0.3.tar.gz" } ], "1.0.4": [ { "comment_text": "", "digests": { "md5": "99b451c9f1e732ff3c4cbef486894bb3", "sha256": "7b80ad9932649fa9b4dede394a71c9d52956e371b3837716ae8348e15ea2cde5" }, "downloads": -1, "filename": "flexiconf-1.0.4.tar.gz", "has_sig": false, "md5_digest": "99b451c9f1e732ff3c4cbef486894bb3", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 5197, "upload_time": "2019-02-22T12:26:26", "url": "https://files.pythonhosted.org/packages/4b/82/3b0c778d16608580e1c89576ac5353fcbe0003b8beceef88e86cf03c7615/flexiconf-1.0.4.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "99b451c9f1e732ff3c4cbef486894bb3", "sha256": "7b80ad9932649fa9b4dede394a71c9d52956e371b3837716ae8348e15ea2cde5" }, "downloads": -1, "filename": "flexiconf-1.0.4.tar.gz", "has_sig": false, "md5_digest": "99b451c9f1e732ff3c4cbef486894bb3", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 5197, "upload_time": "2019-02-22T12:26:26", "url": "https://files.pythonhosted.org/packages/4b/82/3b0c778d16608580e1c89576ac5353fcbe0003b8beceef88e86cf03c7615/flexiconf-1.0.4.tar.gz" } ] }