{ "info": { "author": "Miroslaw Janiewicz", "author_email": "miroslaw.janiewicz@gmail.com", "bugtrack_url": null, "classifiers": [ "Development Status :: 4 - Beta", "Environment :: Console" ], "description": "YASCP\n=====\n\nThis is Yet Another Simple Configuration Parser module for INI style configurations files.\n\nInstallation\n------------\n\n``pip install yascp``\n\n``easy_install yascp``\n\nUSAGE\n-----\n\nA sample configuration is looking like this and is saved in file called example.conf:\n\n::\n\n [database]\n login = user\n password = topsecret\n host = example.com\n port = 3306\n\n [backend_api]\n login = api_user\n password = api_password\n url = http://example.com:9080\n\nIn scripts\n^^^^^^^^^^\n\nThe constructor takes only two arguments - first one is the name or absoluthe path to the configuration file (see below \"Configuration File\" for more details on this) and a dictionary of default values which will be parsed before any actual configuration file is read. If same section and option is found in a configuration file then the default will be overwritten.\nUntil version 0.2.6 KEY and VALUE could be separated by the '=' sign only but from 2.7 third argument may be passed on to specify the delimiter and it can be anything. Default is still '=' if not specified.\n\n::\n\n import yascp\n config = yascp.parser.Parser(configuration_file_name = 'example.conf', defaults = {'extra.port':'666'}, delimiter = '=')\n\n login = config.database.username\n password = config.database.password\n host = config.database.host\n port = config.database.port\n\n print config.backend_api.url\n print config.extra.port\n\nThere is a convenience method available to print off all of the configuration parsed.\n\nSo running:\n::\n\n config.print_all()\n\nwould print to the screen following:\n\n::\n\n backend_api.url = http://example.com:9080\n backend_api.password = api_password\n backend_api.login = api_user\n extra.port = 666\n database.host = example.com\n database.port = 3306\n database.login = user\n database.password = topsecret\n\n\n**Notice**: *Everything is a string. The module does not distinguish any type of data and so the developer should know where an integer for example is expected an perform all required tests/handle possible errors.*\n\nIn command line\n^^^^^^^^^^^^^^^\n\n::\n\n yascp_parser.py [full path to or name of an INI config file] [section.option to be fetched|--print-all]\n\nThe script takes two arguments\n\nThe first argument is the name of a configuration file or full path to one (see below for \"Configuration File\" section for more details).\n\nThe second argument may be \"--list-all\" to obtain a list of all available options\nor a key of specific option to get value for this option only (run first with\n\"--list-all\" to see what exactly can be used here).\n\nIf an option doesn't belong to any of the sections in the configuration file\nthen it should be addresses with \"default\" section, i.e:\n\n::\n\n default.[myoption]\n\nSample usage:\n\n::\n\n python parser.py /tmp/example.conf --print-all\n backend_api.url = http://example.com:9080\n backend_api.password = api_password\n backend_api.login = api_user\n database.host = example.com\n database.port = 3306\n database.login = user\n database.password = topsecret\n\nKnowing now what options are avaialbe you can fetch only this that you need:\n\n::\n\n python parser.py /tmp/example.conf backend_api.url\n http://example.com:9080\n\nConfiguration File\n------------------\n\nIf absolute path is provided to a configuration file then only that file is read but\nif only a name of configuration file is given then the script will attempt to read\na file by that name in following locations and order:\n\n#. /etc/[config file name]\n#. ~/[config file name]\n#. directory from which the script has been ran.\n\n**Notice**: If more than one configuration file is present then the duplicated options set for example in a configuratioin file saved in /etc/ will be overwritten by those in user's home direcotry and so on.\n\nChangelog\n---------\n0.3.1\n^^^^^\n- Python 2 & 3 compatibility added\n\n0.3.0\n^^^^^\n- fixed issue with \"print_all\" method where if user overwritten one value with anything else than string it would break\n- corrected number of code style issues (too long lines, etc.) in Parser module\n\n0.2.9\n^^^\n- configuration parsing errors are now catched if invoked from command line so no trace is printed\n- '~' is now expanded to user's home dir if Parser is initialized from within external Python code\n- minor spelling corrections\n\n0.2.8\n^^^\n- minor spelling corrections, documentation corrections/updates\n\n0.2.7\n^^^\n- extended functionality - now a delimiter can be passed on when used as a module so from now on KEY and VALUE can be separated by = as usual but also space character, tab character or anything else\n\n0.2.6\n^^^\n- fixed a \"hidden\" issue with infinite recursion within __getattr__ method; this didn't affect the functionality though\n\n0.2.5\n^^^\n- introduced proper access point from shell via script **yascp_parser.py** (available from PATH after installation)\n- introduced possibility to execute the module by a direct call, i.e. **python -m yascp**\n\n\n", "description_content_type": "", "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://pypi.python.org/pypi/yascp/", "keywords": "configuration,parse,parser,ini,yascp", "license": "MIT", "maintainer": "", "maintainer_email": "", "name": "yascp", "package_url": "https://pypi.org/project/yascp/", "platform": "", "project_url": "https://pypi.org/project/yascp/", "project_urls": { "Homepage": "https://pypi.python.org/pypi/yascp/" }, "release_url": "https://pypi.org/project/yascp/0.3.1/", "requires_dist": [ "future" ], "requires_python": "", "summary": "Yet Another Simple Configuration Parser for INI-style configuration files.", "version": "0.3.1" }, "last_serial": 5387879, "releases": { "0.2.2": [ { "comment_text": "", "digests": { "md5": "3056c5fbb7e6d4b5dae512c970597362", "sha256": "2e32495e56ccf67fd0369c77c175b559861707b3fada6012b4107696d58b1e7b" }, "downloads": -1, "filename": "yascp-0.2.2.tar.gz", "has_sig": false, "md5_digest": "3056c5fbb7e6d4b5dae512c970597362", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 5333, "upload_time": "2014-12-29T22:16:55", "url": "https://files.pythonhosted.org/packages/99/d1/62546c69327a7c240cea87c1f711e67979461e034ea627b713e23b2d405d/yascp-0.2.2.tar.gz" } ], "0.2.4": [ { "comment_text": "", "digests": { "md5": "b7cde1c5f04eadaf7a109274f058e68f", "sha256": "8e63fa11d396496930c9a733c125efbdb5db51e1715b92257fd01cb03811ee6d" }, "downloads": -1, "filename": "yascp-0.2.4.tar.gz", "has_sig": false, "md5_digest": "b7cde1c5f04eadaf7a109274f058e68f", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 6268, "upload_time": "2014-12-30T00:21:32", "url": "https://files.pythonhosted.org/packages/48/03/73f574b4287c7ae84321465e90646b23cd23006659dffd5d0325c934fd6b/yascp-0.2.4.tar.gz" } ], "0.2.5": [ { "comment_text": "", "digests": { "md5": "a3c0506e4dd39b438e6557059174019f", "sha256": "eb91e96ef6173a56ca376c1eccdd60a1845ba98c13fd110ab5fd9868674088e1" }, "downloads": -1, "filename": "yascp-0.2.5.tar.gz", "has_sig": false, "md5_digest": "a3c0506e4dd39b438e6557059174019f", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 6440, "upload_time": "2015-01-06T23:06:27", "url": "https://files.pythonhosted.org/packages/35/1b/bf7adbb0781b0f4b9d9e24a3a71a982fb1aba21f10607c6d520f4d6ee31e/yascp-0.2.5.tar.gz" } ], "0.2.6": [ { "comment_text": "", "digests": { "md5": "0e4209196a6d4802958a765f76c86133", "sha256": "f958467eef6d5253c0b4e39f9aa31119c33fab6d6dcf63274e49f13f245bc6cd" }, "downloads": -1, "filename": "yascp-0.2.6.tar.gz", "has_sig": false, "md5_digest": "0e4209196a6d4802958a765f76c86133", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 6692, "upload_time": "2015-01-07T21:30:40", "url": "https://files.pythonhosted.org/packages/2d/f5/33ff294471d52c62c61c3d8ddd4acd346713db3195ce8e4d6992d27f8c31/yascp-0.2.6.tar.gz" } ], "0.2.7": [ { "comment_text": "", "digests": { "md5": "c7408003068ac62a47a46695c0054369", "sha256": "35f02e7940cb91f05c6f8fab40bca5a72fd05c39146460dfef450f47a8e8c0f7" }, "downloads": -1, "filename": "yascp-0.2.7.tar.gz", "has_sig": false, "md5_digest": "c7408003068ac62a47a46695c0054369", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 6921, "upload_time": "2015-01-22T22:10:34", "url": "https://files.pythonhosted.org/packages/5f/b5/551d4e38bb36809501c5f37d504bb7d08eab61830956cefb374452d66477/yascp-0.2.7.tar.gz" } ], "0.2.8": [ { "comment_text": "", "digests": { "md5": "2366cf15960a0731503923556f3f3757", "sha256": "396d1a8838fac39d1d850de2cb6a2fb8915596b291ba7f70e3dde605382c2883" }, "downloads": -1, "filename": "yascp-0.2.8.tar.gz", "has_sig": false, "md5_digest": "2366cf15960a0731503923556f3f3757", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 6926, "upload_time": "2015-01-27T00:30:13", "url": "https://files.pythonhosted.org/packages/3c/99/2efb4a563f8e31460870c2cc91d1fb441f083d07f7b54521119f23aacd9f/yascp-0.2.8.tar.gz" } ], "0.2.9": [ { "comment_text": "", "digests": { "md5": "4a0ad8c8d072e8d7bbaed9d753696596", "sha256": "81bf882c1e013fd37682abc0b9301e736ab8d3dca960187e0cbe10bc915737f0" }, "downloads": -1, "filename": "yascp-0.2.9.tar.gz", "has_sig": false, "md5_digest": "4a0ad8c8d072e8d7bbaed9d753696596", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 7126, "upload_time": "2015-03-18T22:40:36", "url": "https://files.pythonhosted.org/packages/51/d8/4fc151b69dfacd0ec67dfec52857b1974b73905569f7c5443d180171f85a/yascp-0.2.9.tar.gz" } ], "0.3.0": [ { "comment_text": "", "digests": { "md5": "ac3deac42045f973b3e66fd3cfd78816", "sha256": "49e4d6f7ba3835ed7c3f1d8e92e03f8505b2bc2efb15edf4000892d587a48973" }, "downloads": -1, "filename": "yascp-0.3.0.tar.gz", "has_sig": false, "md5_digest": "ac3deac42045f973b3e66fd3cfd78816", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 7375, "upload_time": "2015-10-26T23:13:59", "url": "https://files.pythonhosted.org/packages/fe/0e/9798b918a11d8f53dcfcc97c5a449985a77c98cc9e512f83d40a20939ec1/yascp-0.3.0.tar.gz" } ], "0.3.1": [ { "comment_text": "", "digests": { "md5": "34ae45fff252002e4ab6881d3d7a1d88", "sha256": "0a1bcb443a5ff5e9da222f5d25130cfdffe38f7984d5cc4ffdc9093225e92b87" }, "downloads": -1, "filename": "yascp-0.3.1-py2-none-any.whl", "has_sig": false, "md5_digest": "34ae45fff252002e4ab6881d3d7a1d88", "packagetype": "bdist_wheel", "python_version": "py2", "requires_python": null, "size": 10296, "upload_time": "2019-06-11T19:06:42", "url": "https://files.pythonhosted.org/packages/c3/51/0d72ad90223dd79c7cc3eb4277aeec80fa660a5d04847dd22e9e32f2055e/yascp-0.3.1-py2-none-any.whl" }, { "comment_text": "", "digests": { "md5": "a0c44a5f06d5ef40f6e986c0c76ddd22", "sha256": "82b16b582c332bc26a63ced8f2f430429e4eb0425efbe2db5099e475f46e46d1" }, "downloads": -1, "filename": "yascp-0.3.1-py3-none-any.whl", "has_sig": false, "md5_digest": "a0c44a5f06d5ef40f6e986c0c76ddd22", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 10296, "upload_time": "2019-06-11T19:06:44", "url": "https://files.pythonhosted.org/packages/c9/25/aefa243d1392edcee274c59903c46447611f13fe0245e84ceabea9967a68/yascp-0.3.1-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "571c8d891204234c5784d2f9d37b2946", "sha256": "311a03c0899ec972e8cbba50324124aa57ad28bc34496781f910b14d48804b18" }, "downloads": -1, "filename": "yascp-0.3.1.tar.gz", "has_sig": false, "md5_digest": "571c8d891204234c5784d2f9d37b2946", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 8237, "upload_time": "2019-06-11T19:06:45", "url": "https://files.pythonhosted.org/packages/dd/31/76b1c09b5f7d31bd8e7a54f101bdebefff354999a67754c1827dff553cf1/yascp-0.3.1.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "34ae45fff252002e4ab6881d3d7a1d88", "sha256": "0a1bcb443a5ff5e9da222f5d25130cfdffe38f7984d5cc4ffdc9093225e92b87" }, "downloads": -1, "filename": "yascp-0.3.1-py2-none-any.whl", "has_sig": false, "md5_digest": "34ae45fff252002e4ab6881d3d7a1d88", "packagetype": "bdist_wheel", "python_version": "py2", "requires_python": null, "size": 10296, "upload_time": "2019-06-11T19:06:42", "url": "https://files.pythonhosted.org/packages/c3/51/0d72ad90223dd79c7cc3eb4277aeec80fa660a5d04847dd22e9e32f2055e/yascp-0.3.1-py2-none-any.whl" }, { "comment_text": "", "digests": { "md5": "a0c44a5f06d5ef40f6e986c0c76ddd22", "sha256": "82b16b582c332bc26a63ced8f2f430429e4eb0425efbe2db5099e475f46e46d1" }, "downloads": -1, "filename": "yascp-0.3.1-py3-none-any.whl", "has_sig": false, "md5_digest": "a0c44a5f06d5ef40f6e986c0c76ddd22", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 10296, "upload_time": "2019-06-11T19:06:44", "url": "https://files.pythonhosted.org/packages/c9/25/aefa243d1392edcee274c59903c46447611f13fe0245e84ceabea9967a68/yascp-0.3.1-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "571c8d891204234c5784d2f9d37b2946", "sha256": "311a03c0899ec972e8cbba50324124aa57ad28bc34496781f910b14d48804b18" }, "downloads": -1, "filename": "yascp-0.3.1.tar.gz", "has_sig": false, "md5_digest": "571c8d891204234c5784d2f9d37b2946", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 8237, "upload_time": "2019-06-11T19:06:45", "url": "https://files.pythonhosted.org/packages/dd/31/76b1c09b5f7d31bd8e7a54f101bdebefff354999a67754c1827dff553cf1/yascp-0.3.1.tar.gz" } ] }