{ "info": { "author": "Bruno Rocha", "author_email": "rochacbruno@gmail.com", "bugtrack_url": null, "classifiers": [ "Development Status :: 2 - Pre-Alpha", "Programming Language :: Python", "Programming Language :: Python :: 2", "Programming Language :: Python :: 2.7", "Programming Language :: Python :: 3", "Programming Language :: Python :: 3.3" ], "description": "[![Build\nStatus](https://travis-ci.org/rochacbruno/raise_if.png)](https://travis-ci.org/rochacbruno/raise_if)\n[![Coverage\nStatus](https://coveralls.io/repos/rochacbruno/raise_if/badge.png)](https://coveralls.io/r/rochacbruno/raise_if)\n![Utility](https://img.shields.io/badge/utility-0%25-lightgrey.svg)\n![Emacs](https://img.shields.io/badge/built%20with-EMACs-blue.svg)\n\n[![forthebadge](http://forthebadge.com/images/badges/built-with-love.svg)](http://forthebadge.com)\n[![forthebadge](http://forthebadge.com/images/badges/gluten-free.svg)](http://forthebadge.com)\n[![forthebadge](http://forthebadge.com/images/badges/built-by-developers.svg)](http://forthebadge.com)\n# raise_if\n\nPython could have raise conditions like Ruby.\n\n```ruby\ndef i_must_have_truth(value)\n raise TypeError, 'You must give me truth' if value == false\nend\n```\n\nBut the only one line option that works hurts PEP8\n```python\ndef i_must_have_truth(value):\n if not value: raise TypeError('You must give me truth')\n```\n\nSo..\n\n```python\n$ pip install raise_if\n\nimport raise_if\n\ndef i_must_have_truth(value):\n raise_if(not value, TypeError, 'You must give me truth')\n```\n\nPass exception type and arguments\n\n```python\nraise_if(not 1 == 2, TypeError, 'Fails', another_arg='foo')\n```\n\nor\n\n```python\nraise_if(not 1 == 2, TypeError('Fails', another_arg='foo'))\n```\n\nWhy??\n\nBecause I am lazy and I do not like extra breaks in a chain of if statements!\n\n:)\n\n\n", "description_content_type": null, "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/rochacbruno/raise_if", "keywords": "", "license": "", "maintainer": "", "maintainer_email": "", "name": "raise_if", "package_url": "https://pypi.org/project/raise_if/", "platform": "", "project_url": "https://pypi.org/project/raise_if/", "project_urls": { "Homepage": "https://github.com/rochacbruno/raise_if" }, "release_url": "https://pypi.org/project/raise_if/0.1.4/", "requires_dist": null, "requires_python": "", "summary": "Probably the small python package, only includes raise_if function", "version": "0.1.4" }, "last_serial": 2722283, "releases": { "0.1.0": [ { "comment_text": "", "digests": { "md5": "fbc805fa4a7c01ac97d53613a1226f13", "sha256": "3aeb5779dcdb3047115113f019cb9ae39a3695291070ad297887425f7cc8dc9b" }, "downloads": -1, "filename": "raise_if-0.1.0.tar.gz", "has_sig": false, "md5_digest": "fbc805fa4a7c01ac97d53613a1226f13", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 1553, "upload_time": "2015-05-19T15:20:03", "url": "https://files.pythonhosted.org/packages/a2/fd/3f8cd2dd04035efa07ae643a83c7e9798e9ccdb625d24855d305b78ab220/raise_if-0.1.0.tar.gz" } ], "0.1.1": [ { "comment_text": "", "digests": { "md5": "d3a645e5d7ebaf62f35275d8f90e0834", "sha256": "be750bfbba62c1473028f40c5459c8d64491a6ad45b1e2ff437006a6f1299679" }, "downloads": -1, "filename": "raise_if-0.1.1.tar.gz", "has_sig": false, "md5_digest": "d3a645e5d7ebaf62f35275d8f90e0834", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 1801, "upload_time": "2016-01-27T11:17:19", "url": "https://files.pythonhosted.org/packages/3b/b6/6bdc7eaf00f776d3f7707e7641447b11cfba81c956fba50b0e80f7472765/raise_if-0.1.1.tar.gz" } ], "0.1.2": [ { "comment_text": "", "digests": { "md5": "1814c7ea7cab9cd218b80901a6f41835", "sha256": "a533640de98ea27037ae9bdc43d45033eedecf65b9b1337d1990184f98ecbc3a" }, "downloads": -1, "filename": "raise_if-0.1.2.tar.gz", "has_sig": false, "md5_digest": "1814c7ea7cab9cd218b80901a6f41835", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 2060, "upload_time": "2016-01-27T11:18:22", "url": "https://files.pythonhosted.org/packages/7e/b1/90b2c5297ede146c14c53d44c896e666aa2be12a28a25c72cf900df275d2/raise_if-0.1.2.tar.gz" } ], "0.1.3": [ { "comment_text": "", "digests": { "md5": "4b24de6d6f95a6b98c4053d6d0060262", "sha256": "10a448d6c8389a68c8fccd96cc4201c64467c3ed278e9bd5c1beb72fa0373416" }, "downloads": -1, "filename": "raise_if-0.1.3.tar.gz", "has_sig": false, "md5_digest": "4b24de6d6f95a6b98c4053d6d0060262", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 1854, "upload_time": "2016-06-30T21:59:37", "url": "https://files.pythonhosted.org/packages/58/1a/530aff084ab0735b75a689f743347c1ba9f33c59bf5c612f79ebfa4d2819/raise_if-0.1.3.tar.gz" } ], "0.1.4": [ { "comment_text": "", "digests": { "md5": "d550bca903da309a6ca87b23fb3c6a9c", "sha256": "bcaf75a3bdbe1b5cfcb59ddcb98c21074c13132c903fe1d33fed79e0a1bd97e0" }, "downloads": -1, "filename": "raise_if-0.1.4.tar.gz", "has_sig": false, "md5_digest": "d550bca903da309a6ca87b23fb3c6a9c", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 2053, "upload_time": "2017-03-22T04:52:35", "url": "https://files.pythonhosted.org/packages/09/d0/bfa18ae9d9599376d1afa3e0f9c1cf347addf8e49542a4e48d08d52d430b/raise_if-0.1.4.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "d550bca903da309a6ca87b23fb3c6a9c", "sha256": "bcaf75a3bdbe1b5cfcb59ddcb98c21074c13132c903fe1d33fed79e0a1bd97e0" }, "downloads": -1, "filename": "raise_if-0.1.4.tar.gz", "has_sig": false, "md5_digest": "d550bca903da309a6ca87b23fb3c6a9c", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 2053, "upload_time": "2017-03-22T04:52:35", "url": "https://files.pythonhosted.org/packages/09/d0/bfa18ae9d9599376d1afa3e0f9c1cf347addf8e49542a4e48d08d52d430b/raise_if-0.1.4.tar.gz" } ] }