{ "info": { "author": "Lars Klitzke", "author_email": "Lars.Klitzke@gmail.com", "bugtrack_url": null, "classifiers": [ "License :: OSI Approved :: GNU Lesser General Public License v3 or later (LGPLv3+)", "Natural Language :: English", "Operating System :: OS Independent", "Programming Language :: Python :: 3.5", "Programming Language :: Python :: 3.6", "Programming Language :: Python :: 3.7" ], "description": "Modconf\n========\n\n|pipeline| |coverage|\n\nThis is a Python package which enables to modularize configuration files.\n\nIn configuration-based applications, it is sometimes desirable to group\nsections in a configuration file. This can, for instance, be sections which are for a specific purpose, e.g. modules in\nan application which shall be configurable.\n\nFor this purpose, *pymodconf* add the functionality to define custom ``Tag`` s representing groups in a configuration\nfile.\nFor instance, if you have an application with multiple modules you can define the tag ``Module:`` and add that prefix to\neach section in the configuration file describing a certain module.\n\nInstallation\n#############\n\nYou can find the latest version on `PyPi `_. So simply use ``pip`` with\n\n.. code-block:: bash\n\n pip install pymodconf\n\n\nUsage\n######\nThis following configuration file shows the feature set of ``pymodconf``:\n\n.. code-block:: ini\n\n 1: [Application]\n 2: name=pymodconf\n 3: string=Hello ${name}!\n 4: list=One, Two, Three, Four\n\n 6: [Some Section]\n 7: opt=${Application:name}-section\n\n 9: [Module: Test]\n 10:log-dir= /tmp/test_module\n\n\nSections\n*********\n\nIn line ``[1]`` a new section ``Application`` is created with multiple options show in lines ``[2]-[3]``.\n\nVariable replacement\n*********************\n\nDue to the fact that ``pymodconf`` is based on the ``configparser`` module, the variable-replacement feature is available,\ntoo. In line ``[3]`` a reference to an option in the same section is shown. If you want to reference an option in any\nother section, you'll have to specify the name of the section, as you can see in line ``[7]``.\n\nLists\n******\nIf ``pymodconf`` finds any commata in the value of an option, it will split up that value and generate a list of it. In\nline ``[4]`` the value is represented in Python as a list with four entries: 'One', 'Two', 'Three', 'Four'.\n\nDirectory creation\n*******************\nAnother feature of ``pymodconf`` is the automatic directory creation. If any option name ends with the suffix ``-dir`` it\nwill try to recursively create the directory tree. For instance, due to the definition in line ``[10]``, a directory\n``test-module`` will be created in the directory ``/tmp/``.\n\nTagging\n********\n\nThe most interesting feature of ``pymodconf`` is the ability to group sections using user-defined ``Tag`` s. As you\ncan see\nin line ``[9]`` a section with the tag definition ``Module`` is defined.\n\nBefore ``pymodconf`` is able to group such sections, you'll have to register the tag at ``pymodconf`` with:\n\n.. code-block:: python\n\n import pymodconf as mc\n\n module_tag = mc.tag.Tag('Module:')\n\n mc.tag.register(module_tag)\n\nAfterwards, you can load the configuration file with:\n\n.. code-block:: python\n\n config = mc.parser.load('example.cfg')\n\nThe result is dictionary with section names and user-defined modules as keys and the corresponding options as values.\n\nYou can, for instance, access the section belonging to the group ``Module`` either with:\n\n.. code-block:: python\n\n config['module'] # returns [{'name': ' Test', 'log-dir': '/tmp/test_module'}]\n\nor using the tag itself with:\n\n.. code-block:: python\n\n config[str(module_tag)] # returns [{'name': ' Test', 'log-dir': '/tmp/test_module'}]\n\nThanks\n#######\n\nIf you like this tool, donate some bugs \ud83d\udcb8 for a drink or two at\n\n* ETH: *0xf7d518A730D93a6d27415EcaE5D801Dde125dE15*\n* XRP: *rhVWrjB9EGDeK4zuJ1x2KXSjjSpsDQSaU6* with destination tag *653103618*\n* Stellar: *GCXDBCRQHDTUJDSZUJPC5TTLBERIWRC7SYBTZO3UOFM2QBE2JXK3DJKE* with Memo *3388649662849648*\n\nor via `PayPal`_. Cheers \ud83c\udf7b!\n\nLicense\n########\n\nThis program is free software: you can redistribute it and/or modify it under the terms of the `GNU General Public\nLicense `_ as published by the Free Software Foundation, either version 3\nof the License, or (at your option) any later version. This program is distributed in the hope that it will be\nuseful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR\nPURPOSE. See the GNU General Public License for more details.\n\nYou should have received a copy of the GNU General Public License along with this program. If not, see http://www.gnu.org/licenses/.\n\n.. |pipeline| image:: https://gitlab.klitzke-web.de/lkl/pymodconf/badges/master/pipeline.svg\n :target: https://gitlab.klitzke-web.de/lkl/pymodconf/commits/master\n\n.. |coverage| image:: https://gitlab.klitzke-web.de/lkl/pymodconf/badges/master/coverage.svg\n :target: https://gitlab.klitzke-web.de/lkl/pymodconf/commits/master\n.. _PayPal: https://www.paypal.me/LarsKlitzke\n\n", "description_content_type": "", "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "", "keywords": "", "license": "", "maintainer": "", "maintainer_email": "", "name": "pymodconf", "package_url": "https://pypi.org/project/pymodconf/", "platform": "", "project_url": "https://pypi.org/project/pymodconf/", "project_urls": null, "release_url": "https://pypi.org/project/pymodconf/0.0.3/", "requires_dist": null, "requires_python": "", "summary": "Modularized configuration files.", "version": "0.0.3" }, "last_serial": 4418305, "releases": { "0.0.1": [ { "comment_text": "", "digests": { "md5": "e1402773543ed7841f80e5012a4cdc41", "sha256": "dde6506b2616b80fc6c26ff28f8f1e220597a6c4bbe9e9fd3c5dfc7c068ee2fe" }, "downloads": -1, "filename": "pymodconf-0.0.1-py3-none-any.whl", "has_sig": false, "md5_digest": "e1402773543ed7841f80e5012a4cdc41", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 27363, "upload_time": "2018-10-03T17:39:00", "url": "https://files.pythonhosted.org/packages/77/4a/eac6a46959952f518465ef43cc283300658267818554b42b772f28d2a224/pymodconf-0.0.1-py3-none-any.whl" } ], "0.0.2": [ { "comment_text": "", "digests": { "md5": "4688afdedf489a896b2b8060e8e9b519", "sha256": "4ec41f213502c448dd8e0f7f92ce643c7fc12f461d00fc0794acd13da0956081" }, "downloads": -1, "filename": "pymodconf-0.0.2-py3-none-any.whl", "has_sig": false, "md5_digest": "4688afdedf489a896b2b8060e8e9b519", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 24568, "upload_time": "2018-10-09T09:32:46", "url": "https://files.pythonhosted.org/packages/ab/ca/ad810538bcbaabb7ddd7679989f98c2075397ca585617dd36ab5429c0504/pymodconf-0.0.2-py3-none-any.whl" } ], "0.0.3": [ { "comment_text": "", "digests": { "md5": "fecc6484fc8f6da6108f4b0e95df22e2", "sha256": "9dab183190e67ecbe675521fc99259ed4f393955072d187e7a7af4aa346dbdaf" }, "downloads": -1, "filename": "pymodconf-0.0.3-py3-none-any.whl", "has_sig": false, "md5_digest": "fecc6484fc8f6da6108f4b0e95df22e2", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 24567, "upload_time": "2018-10-26T08:15:51", "url": "https://files.pythonhosted.org/packages/40/eb/29547464b5717a620580061535e9f3ce7997bf6cf77b03d66dc4d548d49d/pymodconf-0.0.3-py3-none-any.whl" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "fecc6484fc8f6da6108f4b0e95df22e2", "sha256": "9dab183190e67ecbe675521fc99259ed4f393955072d187e7a7af4aa346dbdaf" }, "downloads": -1, "filename": "pymodconf-0.0.3-py3-none-any.whl", "has_sig": false, "md5_digest": "fecc6484fc8f6da6108f4b0e95df22e2", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 24567, "upload_time": "2018-10-26T08:15:51", "url": "https://files.pythonhosted.org/packages/40/eb/29547464b5717a620580061535e9f3ce7997bf6cf77b03d66dc4d548d49d/pymodconf-0.0.3-py3-none-any.whl" } ] }