{ "info": { "author": "Deniz Dogan", "author_email": "deniz@dogan.se", "bugtrack_url": null, "classifiers": [ "Development Status :: 5 - Production/Stable", "Intended Audience :: Developers", "License :: OSI Approved :: MIT License", "Operating System :: OS Independent", "Programming Language :: Python :: 2.7", "Topic :: Software Development :: Libraries :: Python Modules" ], "description": "hungry\n======\n\n.. image:: https://travis-ci.org/denizdogan/hungry.svg?branch=master\n :target: https://travis-ci.org/denizdogan/hungry\n\nPython library for easily \"eating\" exceptions in functions. Eating can mean\neither returning a default value or calling another function.\n\nIntroduction\n------------\n\nThis library is basically just a function, namely ``hungry.eat``. Initially, I\nwrote it for a document parser in which there was a lot of exception handling\nlogic for stuff I didn't really care particularly much about.\n\nExample usage\n-------------\n\nEat all exceptions and return `None` if one was raised:\n\n.. code-block:: python\n\n @hungry.eat()\n def foo():\n ...\n\nEat ``ValueError`` exceptions and return 0 if one was raised:\n\n.. code-block:: python\n\n @hungry.eat(ValueError, error_value=0)\n def foo():\n ...\n\nEat ``IndexError`` and ``ValueError`` and fall back to function\n``bar`` if one of them is raised:\n\n.. code-block:: python\n\n @hungry.eat(IndexError, ValueError, error_handler=bar)\n def foo():\n ...\n\nIn the example above, ``bar`` will be passed the exception as the first\nargument, followed by all the other arguments and keyword arguments in the\ndecorated function. This means that ``bar`` would have e.g. the following\nsignature:\n\n.. code-block:: python\n\n def bar(ex, *args, **kwargs):\n ...\n\nNotes\n-----\n\nThis library will *not* catch exceptions and continue executing the\nfollowing code. Whenever it eats an exception, it immediately returns\nerror_value or calls error_handler.\n\nTODO\n----\n\nComplete the test suite.", "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/denizdogan/hungry", "keywords": null, "license": "MIT", "maintainer": null, "maintainer_email": null, "name": "hungry", "package_url": "https://pypi.org/project/hungry/", "platform": "any", "project_url": "https://pypi.org/project/hungry/", "project_urls": { "Download": "UNKNOWN", "Homepage": "https://github.com/denizdogan/hungry" }, "release_url": "https://pypi.org/project/hungry/0.0.4/", "requires_dist": null, "requires_python": null, "summary": "Easily eats exceptions using decorators", "version": "0.0.4" }, "last_serial": 1706205, "releases": { "0.0.1": [ { "comment_text": "", "digests": { "md5": "88aebcf5416962fa6fbe10f9cb8a8cc1", "sha256": "c2affc0e0a17680da5349ab8d26c03342d34c98eab551277fd7a3038e4847c94" }, "downloads": -1, "filename": "hungry-0.0.1.tar.gz", "has_sig": false, "md5_digest": "88aebcf5416962fa6fbe10f9cb8a8cc1", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 178982, "upload_time": "2015-02-01T21:30:35", "url": "https://files.pythonhosted.org/packages/ea/50/3f00ace4ac7e3d5b185df181676c8b3880bd0a39a7d55fc9e31326428c42/hungry-0.0.1.tar.gz" } ], "0.0.2": [], "0.0.3": [ { "comment_text": "", "digests": { "md5": "730c2a71c9ec306c06f65a53ba40c598", "sha256": "cf940067f01d5c8c2013d7d505b3df26aed1d765cc7e15f10c0c9d8ea7c7f003" }, "downloads": -1, "filename": "hungry-0.0.3.win32.exe", "has_sig": false, "md5_digest": "730c2a71c9ec306c06f65a53ba40c598", "packagetype": "bdist_wininst", "python_version": "any", "requires_python": null, "size": 200608, "upload_time": "2015-02-02T09:02:06", "url": "https://files.pythonhosted.org/packages/5f/6a/bef6d0ad0093577118f199484cc6258578887916e261002a64d5dfef7d5b/hungry-0.0.3.win32.exe" }, { "comment_text": "", "digests": { "md5": "2e2855e3c8a8d26cacb1b6e8484d0810", "sha256": "f26c19cd88cc70bf82b482dafbdd07beb2dd12792215c986afefcc8f338a6689" }, "downloads": -1, "filename": "hungry-0.0.3.zip", "has_sig": false, "md5_digest": "2e2855e3c8a8d26cacb1b6e8484d0810", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 6170, "upload_time": "2015-02-02T09:02:02", "url": "https://files.pythonhosted.org/packages/45/f8/f631e8699558aca0a1f9cfe6c3042a528e0120eacac0d8ff8ceba150b2db/hungry-0.0.3.zip" } ], "0.0.4": [] }, "urls": [] }