{ "info": { "author": "Jonathan Tushman", "author_email": "jonathan@zefr.com", "bugtrack_url": null, "classifiers": [], "description": "dict_digger\n===========\n\nDigs into Dicts\n\nUseful syntax for digging into nested dictionaries, lists and tuples, and removes the need to check if a key or index exists, or handling of\nKeyError or IndexError\n\n\nInstallation\n------------\n\n.. code-block:: bash\n\n $ pip install dict_digger\n\n\nUsage\n-----\n\n.. code-block:: python\n\n import dict_digger\n\n h = {\n 'a': {\n 'b': 'tuna',\n 'c': 'fish'\n },\n 'b': {}\n }\n\n result = dict_digger.dig(h, 'a','b')\n print result # prints 'tuna'\n\n result = dict_digger.dig(h, 'c','a')\n print result # prints None\n # Important!! Does not through an error, just returns None\n\n #but if you like\n result = dict_digger.dig(h, 'c','a', fail=True)\n # raises a KeyError\n\n # also support complex objects so ...\n\n complex = {\n 'a': {\n ['tuna','fish']\n },\n 'b': {}\n }\n result = dict_digger.dig(complex, 'a',0)\n print result #prints tuna\n\n\n\nAlternatives\n------------\n\n.. code-block:: python\n\n try:\n result = h['c']['a']\n except KeyError:\n result = None\n\nTesting\n-------\n\nWe are using nose\n\n.. code-block:: bash\n\n $ nosetests\n\n", "description_content_type": null, "docs_url": null, "download_url": "UNKNOWN", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/jtushman/dict_digger", "keywords": null, "license": "MIT", "maintainer": null, "maintainer_email": null, "name": "dict_digger", "package_url": "https://pypi.org/project/dict_digger/", "platform": "UNKNOWN", "project_url": "https://pypi.org/project/dict_digger/", "project_urls": { "Download": "UNKNOWN", "Homepage": "https://github.com/jtushman/dict_digger" }, "release_url": "https://pypi.org/project/dict_digger/0.2.1/", "requires_dist": null, "requires_python": null, "summary": "Useful syntax for digging into nested dictionaries, lists and tuples, and removes the need to check if a key exists", "version": "0.2.1" }, "last_serial": 913212, "releases": { "0.1.1": [ { "comment_text": "", "digests": { "md5": "10152038b0f8d35faf6885ee80cb21d1", "sha256": "de05951de8a0e862bd597cf5755a5e037bced6db38f31254f16958d70b41da33" }, "downloads": -1, "filename": "dict_digger-0.1.1.tar.gz", "has_sig": false, "md5_digest": "10152038b0f8d35faf6885ee80cb21d1", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 1314, "upload_time": "2013-06-18T13:03:20", "url": "https://files.pythonhosted.org/packages/11/d3/92f82a91bc89153bc5b9477d7498c863c43fdd38c773e37789daec617f8c/dict_digger-0.1.1.tar.gz" } ], "0.2.1": [ { "comment_text": "", "digests": { "md5": "0cad877db7638700ce738ece96ccdd9b", "sha256": "85db80169b93bfa3df55f1f111bc2ca695a48e7f4cbcb09aaee37df52094efdd" }, "downloads": -1, "filename": "dict_digger-0.2.1.tar.gz", "has_sig": false, "md5_digest": "0cad877db7638700ce738ece96ccdd9b", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 1627, "upload_time": "2013-11-07T02:06:59", "url": "https://files.pythonhosted.org/packages/77/86/21a269637c44bbcd0a6b1cf8e2e72e56ebaf70e354cce4df852089a907ed/dict_digger-0.2.1.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "0cad877db7638700ce738ece96ccdd9b", "sha256": "85db80169b93bfa3df55f1f111bc2ca695a48e7f4cbcb09aaee37df52094efdd" }, "downloads": -1, "filename": "dict_digger-0.2.1.tar.gz", "has_sig": false, "md5_digest": "0cad877db7638700ce738ece96ccdd9b", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 1627, "upload_time": "2013-11-07T02:06:59", "url": "https://files.pythonhosted.org/packages/77/86/21a269637c44bbcd0a6b1cf8e2e72e56ebaf70e354cce4df852089a907ed/dict_digger-0.2.1.tar.gz" } ] }