{ "info": { "author": "Nima Ghorbani", "author_email": "nima.gbani@gmail.com", "bugtrack_url": null, "classifiers": [ "Intended Audience :: Developers", "License :: OSI Approved :: GNU General Public License v3 (GPLv3)", "Natural Language :: English", "Operating System :: MacOS :: MacOS X", "Operating System :: Microsoft :: Windows", "Operating System :: POSIX", "Operating System :: POSIX :: BSD", "Operating System :: POSIX :: Linux", "Programming Language :: Python", "Programming Language :: Python :: 2", "Programming Language :: Python :: 2.7", "Programming Language :: Python :: 3", "Programming Language :: Python :: 3.7" ], "description": "Configer\n========\n\nThis is the repository for the package **CONFIGER** helps with easy configuration of arguments in a python code.\n\nIntroduction\n------------\n\nWhen Python programs grow large, one would eventually need a way to load configurations through a file. The common answer to this would by Python's ConfigParser. But at least I find the result of using ConfigParse an ugly code:\n```\nimport ConfigParser\nConfig = ConfigParser.ConfigParser()\nConfig.read(\"c:\\\\tomorrow.ini\")\nConfig.get(section, option)\n```\n\nThat's why I packaged my solution to this issue. Configer basically gives you a flattened ConfigParser with extra functionality:\n- dot-access of values in the settings file\n- dump settings to a file for later use\n- add different settings while choosing to overload previous one.\n\nDependencies\n------------\n\nThis package is written for **Python 2.7**.\nThe only dependency is **configparser** and will be installed automatically by the ``setup.py``.\n\nInstallation\n------------\n\nIn the root directory, type in\n```\npip install .\n```\n\nExamples\n--------\n\nOverall Configer will be a sleek way to disentangle settings away from the mechanics. An exact copy of the above code will be:\n```\nfrom configer import Configer\nConfig = Configer(default_ps_fname='c:\\\\tomorrow.ini')\nConfig.option\n```\n\nNote that you don't have sections anymore and you can access an option with a dot-access approach.\n\nOther use cases would be:\n\n1. **Loading default settings**\n ```\n default_ps_fname = 'pyconfiger/Configer/test/sample_settings.ini'\n ps = Configer(default_ps_fname=default_ps_fname)\n print(ps.status) # None\n ```\n\n2. **Loading default settings while adding new arguments**\n ```\n ps = Configer(default_ps_fname=default_ps_fname, status=False)\n print(ps.status) # False\n ps.status = True\n print(ps.status) # True\n ps.new_status = True\n print(ps.new_status) # True\n ```\n\n3. **Loading default settings while initializing with a dictionary of arguments**\n ```\n ps = Configer(default_ps_fname=default_ps_fname, status=False,**{'somethings': [1.0, 2.0]})\n print(ps.somethings) # [1.0, 2.0]\n ```\n\n4. **Adding and overloading with a second Configer instance**\n ```\n ps1 = Configer(status=False)\n ps2 = Configer(status=True, othersetting = 'this')\n\n ps3 = ps1 + ps2\n print(ps3.status) # False\n print(ps3.othersetting) # 'this'\n\n ps4 = ps1.overload(ps2)\n print(ps4.status) # True\n ```\n\n5. **Dumping current Configer instance as an *.ini* file**\n ```\n ps = Configer(default_ps_fname=default_ps_fname, status=False)\n print(ps.status) # False\n ps.dump_settings(fname='~/settings.ini') # saves the settings to the specified file\n ```\n\nTests\n-----\n\nTo run the tests, type in in the root directory:\n```\npython -m unittest discover\n```\n\nLicense\n-------\n\nSee LICENSE.txt\n\nAuthor\n------\n\nNima Ghorbani, nima.ghorbani@tuebingen.mpg.de", "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/nimagbani/configer", "keywords": "", "license": "GNU Affero General Public License, version 3", "maintainer": "Nima Ghorbani", "maintainer_email": "nima.gbani@gmail.com", "name": "configer", "package_url": "https://pypi.org/project/configer/", "platform": "", "project_url": "https://pypi.org/project/configer/", "project_urls": { "Homepage": "https://github.com/nimagbani/configer" }, "release_url": "https://pypi.org/project/configer/1.3.1/", "requires_dist": null, "requires_python": "", "summary": "Easy configuration of arguments in a python code!", "version": "1.3.1" }, "last_serial": 5385654, "releases": { "0.9": [ { "comment_text": "", "digests": { "md5": "bd1e7a9861bad3b257db6621fa5d7832", "sha256": "78d6f76f7e7868f3c210a8e4b0eae17b7950367d7941f1c8fb4487f2c55d1da2" }, "downloads": -1, "filename": "configer-0.9.tar.gz", "has_sig": false, "md5_digest": "bd1e7a9861bad3b257db6621fa5d7832", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 3531, "upload_time": "2018-08-28T17:40:51", "url": "https://files.pythonhosted.org/packages/45/99/23d507e7cca2904d8ffe834f532211b89349d74c76348dc78826ff108258/configer-0.9.tar.gz" } ], "1.1": [ { "comment_text": "", "digests": { "md5": "e2be366281ecf4b58b953447290ee43b", "sha256": "9de36f8490b2413cc78b2f3de8e7fee4f4840caa3f9706d9df4f608132c13ef9" }, "downloads": -1, "filename": "configer-1.1.tar.gz", "has_sig": false, "md5_digest": "e2be366281ecf4b58b953447290ee43b", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 3958, "upload_time": "2018-10-25T13:49:11", "url": "https://files.pythonhosted.org/packages/13/5a/a69d1c7cab28dbb08ad99951f3aac4b954502aa3c2796fc4fe54d8f420e1/configer-1.1.tar.gz" } ], "1.2": [ { "comment_text": "", "digests": { "md5": "5eee9edc0c965d553d9ebd22a0ea9314", "sha256": "152561522e6116e000bb9d4badae958f1c95e21c652f7376db3d7319f02ec4fe" }, "downloads": -1, "filename": "configer-1.2.tar.gz", "has_sig": false, "md5_digest": "5eee9edc0c965d553d9ebd22a0ea9314", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 3953, "upload_time": "2018-10-25T14:57:53", "url": "https://files.pythonhosted.org/packages/21/9b/c64d4bfe9f6216ea48a7dd74476832633747dde05f59ee241e67e335e3f6/configer-1.2.tar.gz" } ], "1.2.1": [ { "comment_text": "", "digests": { "md5": "430fdf8dad9ce9a559b497170618452a", "sha256": "c9560ea52a53cf0443295632b648f806efaae21073fa0e9eca819e930f1a2e1e" }, "downloads": -1, "filename": "configer-1.2.1.tar.gz", "has_sig": false, "md5_digest": "430fdf8dad9ce9a559b497170618452a", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 4019, "upload_time": "2018-10-25T15:47:38", "url": "https://files.pythonhosted.org/packages/28/1c/c29c7513108530aedd0fb43ff2675dbe6ae27f69e3351cdc6cc52db27f74/configer-1.2.1.tar.gz" } ], "1.2.2": [ { "comment_text": "", "digests": { "md5": "3972853409b66bf62fe3025d02c6297e", "sha256": "dbe00dacbf5a96966a6711baaabf32996b08281faa63feb15f3020676a79f544" }, "downloads": -1, "filename": "configer-1.2.2.tar.gz", "has_sig": false, "md5_digest": "3972853409b66bf62fe3025d02c6297e", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 4016, "upload_time": "2018-10-25T20:53:40", "url": "https://files.pythonhosted.org/packages/83/a2/0aff0c715dad63972f5fe384b4ca4e6d95a9a25835a7c1eb0d89ab81b7c8/configer-1.2.2.tar.gz" } ], "1.2.3": [ { "comment_text": "", "digests": { "md5": "33da18ccc9559c3ed88af3b41286f869", "sha256": "0e45325a94405453ee9fdef115e82adeff4209b84ffd719066aedeccbb02368f" }, "downloads": -1, "filename": "configer-1.2.3.tar.gz", "has_sig": false, "md5_digest": "33da18ccc9559c3ed88af3b41286f869", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 4029, "upload_time": "2019-05-03T11:16:59", "url": "https://files.pythonhosted.org/packages/20/63/0055d1918e167c6233dc693c3f77265991085ac21b38b14ecf8c573a53ba/configer-1.2.3.tar.gz" } ], "1.2.4": [ { "comment_text": "", "digests": { "md5": "2d4c1e6df9dbcfda18ec3e585fb7aa3d", "sha256": "647ac58efa61c828944a5a7d335b383be933177a6d2148757ab3f0ad167ce761" }, "downloads": -1, "filename": "configer-1.2.4.tar.gz", "has_sig": false, "md5_digest": "2d4c1e6df9dbcfda18ec3e585fb7aa3d", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 4044, "upload_time": "2019-06-06T15:31:26", "url": "https://files.pythonhosted.org/packages/3e/45/ed6f94697b8f28dbe8127c60079cbbf25b7d98af8426e34363ac3f5e6aa9/configer-1.2.4.tar.gz" } ], "1.3.0": [ { "comment_text": "", "digests": { "md5": "66fc1d25bc431af519e93253c383baa4", "sha256": "a8398e76a722be894dc98545fefc6df5aa148639bb530e92ff343a62d4028ba2" }, "downloads": -1, "filename": "configer-1.3.0.tar.gz", "has_sig": false, "md5_digest": "66fc1d25bc431af519e93253c383baa4", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 4055, "upload_time": "2019-06-08T10:06:07", "url": "https://files.pythonhosted.org/packages/3b/af/cd97eafc138db1dc22aebcd2315350bce3316a1bc98b475a01b1a4376724/configer-1.3.0.tar.gz" } ], "1.3.1": [ { "comment_text": "", "digests": { "md5": "08240ac14c52625358c6c76016dbb84b", "sha256": "e560406b9bd0b9c5f98c205b84708f2225421f53f9dd67b9211cdaa0c6ff1b3b" }, "downloads": -1, "filename": "configer-1.3.1.tar.gz", "has_sig": false, "md5_digest": "08240ac14c52625358c6c76016dbb84b", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 4074, "upload_time": "2019-06-11T09:19:27", "url": "https://files.pythonhosted.org/packages/49/e1/cc2e7500059abce39fe0b95e57047dc52076c7171dadba650ae09e07ca0b/configer-1.3.1.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "08240ac14c52625358c6c76016dbb84b", "sha256": "e560406b9bd0b9c5f98c205b84708f2225421f53f9dd67b9211cdaa0c6ff1b3b" }, "downloads": -1, "filename": "configer-1.3.1.tar.gz", "has_sig": false, "md5_digest": "08240ac14c52625358c6c76016dbb84b", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 4074, "upload_time": "2019-06-11T09:19:27", "url": "https://files.pythonhosted.org/packages/49/e1/cc2e7500059abce39fe0b95e57047dc52076c7171dadba650ae09e07ca0b/configer-1.3.1.tar.gz" } ] }