{ "info": { "author": "Kyle Laplante", "author_email": "kyle.laplante@gmail.com", "bugtrack_url": null, "classifiers": [ "Topic :: Text Processing :: General", "Topic :: Text Processing :: Indexing", "Topic :: Utilities" ], "description": "A class to parse configuration files that require indexing.\r\nThis class returns a dictionary that you can call to retrieve items\r\nfrom your config file.\r\n\r\nTo use this parser to its full potential create config files in the\r\nfollowing format for example:\r\n\r\n(Example config file)\r\n\r\n# Home server\r\nserver_1 = somename\r\nip_1 = 1.2.3.4\r\nlocation_1 = san jose\r\n\r\n# Remote server\r\nserver_2 = someothername\r\nip_2 = 4.3.2.1\r\nlocation_2 = boston\r\n\r\n# Universal configs\r\nuniversal_key = something universal\r\nmy_username = kyle\r\n\r\n\r\nYou can keep raising the indexed number as much as you want.\r\nThe way to use this library is to pick a config definition\r\nthat you know will be different for each index. In this case I would\r\nuse \"server\" as the \"defining key\" and that would make each server name\r\ninto its own dictionary and the key/value pairs for it would be the config\r\nkey/values that are associated with the same index number.\r\n\r\nThere are 3 lists that are created on each parse:\r\nkeys = this is a list of the keys that are not indexed\r\n (used for universal purposes)\r\nindex_keys = this is a list of all the keys that are indexed\r\n (this is generated based on the defining key)\r\nall_keys = this is a list of all the keys combined \r\n\r\nExamples:\r\n\r\nimport IndexConfigParser\r\n\r\n(The following code will print the dictionaries of each index key)\r\nicp = IndexConfigParser.IndexConfigParser(\"/home/kyle/config.cfg\", \"server\")\r\nfor key in icp.index_keys:\r\n print \"The dictionary for %s is: \" %key\r\n print icp[key]\r\n\r\n(The following is how to call a specific key in the index key dict)\r\nicp = IndexConfigParser.IndexConfigParser(\"/home/kyle/config.cfg\", \"server\")\r\nvar = \"somename\"\r\nicp[var][\"ip\"]\r\n(Using the example config file above this would return \"1.2.3.4\")", "description_content_type": null, "docs_url": "https://pythonhosted.org/IndexConfigParser/", "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "UNKNOWN", "keywords": "index config parse parser cfg file", "license": "GPL", "maintainer": "", "maintainer_email": "", "name": "IndexConfigParser", "package_url": "https://pypi.org/project/IndexConfigParser/", "platform": "Unix, Linux, Windows", "project_url": "https://pypi.org/project/IndexConfigParser/", "project_urls": { "Homepage": "UNKNOWN" }, "release_url": "https://pypi.org/project/IndexConfigParser/1.2/", "requires_dist": null, "requires_python": null, "summary": "Python library to parse config files that require indexing", "version": "1.2" }, "last_serial": 812166, "releases": { "1.0": [ { "comment_text": "", "digests": { "md5": "899857514a890ddb22c1e256a9835fba", "sha256": "149ec437df9170054f14838aeb166d3134bd41e9707197a916093c360614627b" }, "downloads": -1, "filename": "IndexConfigParser-1.0.tar.gz", "has_sig": false, "md5_digest": "899857514a890ddb22c1e256a9835fba", "packagetype": "bdist_dumb", "python_version": "any", "requires_python": null, "size": 1764, "upload_time": "2013-07-08T23:48:12", "url": "https://files.pythonhosted.org/packages/ac/81/5f2963609055c3daea0ceb7f783134f5e0e9a2699720308104e0bdbacf61/IndexConfigParser-1.0.tar.gz" } ], "1.1": [ { "comment_text": "", "digests": { "md5": "e0894a7c6a359c69a104d56a8a7b73ff", "sha256": "bcf739baf88d928fa2222b199eaaabc5399cb12027a97a468e10336add4e1164" }, "downloads": -1, "filename": "IndexConfigParser-1.1.tar.gz", "has_sig": false, "md5_digest": "e0894a7c6a359c69a104d56a8a7b73ff", "packagetype": "bdist_dumb", "python_version": "any", "requires_python": null, "size": 1765, "upload_time": "2013-07-09T00:57:19", "url": "https://files.pythonhosted.org/packages/3c/37/700bb99be0b93496da7398d78e5de0f2314f28274d840db4b7d8c65f0501/IndexConfigParser-1.1.tar.gz" } ], "1.2": [ { "comment_text": "", "digests": { "md5": "1b7a1f8ece2b064b29cb42c92b9abe00", "sha256": "90cb12245e02bb0c59cfb6a01ca25058b2aed35dcbddc869984c6206b567b6b4" }, "downloads": -1, "filename": "IndexConfigParser-1.2.tar.gz", "has_sig": false, "md5_digest": "1b7a1f8ece2b064b29cb42c92b9abe00", "packagetype": "bdist_dumb", "python_version": "any", "requires_python": null, "size": 2021, "upload_time": "2013-07-09T04:15:57", "url": "https://files.pythonhosted.org/packages/b5/12/8c08260f90f439a8d642ab599d0f4e055c9caeb2dbb2e96db0b9908e9bec/IndexConfigParser-1.2.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "1b7a1f8ece2b064b29cb42c92b9abe00", "sha256": "90cb12245e02bb0c59cfb6a01ca25058b2aed35dcbddc869984c6206b567b6b4" }, "downloads": -1, "filename": "IndexConfigParser-1.2.tar.gz", "has_sig": false, "md5_digest": "1b7a1f8ece2b064b29cb42c92b9abe00", "packagetype": "bdist_dumb", "python_version": "any", "requires_python": null, "size": 2021, "upload_time": "2013-07-09T04:15:57", "url": "https://files.pythonhosted.org/packages/b5/12/8c08260f90f439a8d642ab599d0f4e055c9caeb2dbb2e96db0b9908e9bec/IndexConfigParser-1.2.tar.gz" } ] }