{ "info": { "author": "Harry Sanderson", "author_email": "harrysanderson@hotmail.co.uk", "bugtrack_url": null, "classifiers": [ "Development Status :: 4 - Beta", "Intended Audience :: Developers", "License :: OSI Approved :: MIT License", "Natural Language :: English", "Programming Language :: Python :: 3", "Programming Language :: Python :: 3.5", "Programming Language :: Python :: 3.6", "Programming Language :: Python :: 3.7", "Programming Language :: Python :: Implementation :: CPython" ], "description": "

\n \"Image\"\n

\n\n[![Build Status](https://travis-ci.org/GenesisCoast/conditions-py.svg?branch=master)](https://travis-ci.org/GenesisCoast/conditions-py) [![codecov](https://codecov.io/gh/GenesisCoast/conditions-py/branch/master/graph/badge.svg)](https://codecov.io/gh/GenesisCoast/conditions-py) [![PyPI version](https://badge.fury.io/py/conditions-py.svg)](https://badge.fury.io/py/conditions-py)\n\n# Conditions-PY\n\nConditions is a Python port of the famous .NET library [Conditions](https://github.com/ghuntley/conditions) which helps developers write pre- and postcondition validations in a fluent manner. Writing these validations is easy and it improves the readability and maintainability of code.\n\n## Contents\n- [Installation](#installation) \n- [Conditions](#conditions)\n- [Tests](#tests)\n- [Examples](#examples)\n- [Acknowledgements](#acknowledgements)\n\n## Installation\n\nInstallation is done via PIP:\n\n pip install conditions-py\n\n## Conditions\n\nA full list of all the available conditions can be found in the [Wiki](https://github.com/GenesisCoast/conditions-py/wiki).\n\n## Tests\n\nCurrently both unit and integration tests are written using the `pytest` library. Execution of tests in Visual Studio Code is performed using the `pytest` test runner.\n\n## Examples\n\n```python\nimport conditions_py\n\n\ndef speak(message: str):\n Condition\\\n .requires_str(message, 'message')\\\n .is_not_null_or_whitespace()\n\n # Do speaking...\n\n\ndef multiple(left: int, right: int):\n Condition\\\n .requires_num(left, 'left')\\\n .is_positive()\n\n Condition\\\n .requires_num(right, 'right')\\\n .is_greater_than(4)\n \n # Do multiplication\n \n \ndef is_true(value: bool):\n Condition\\\n .requires_bool(value, 'value')\\\n .is_true()\n \n # Do other stuff\n \n \ndef animals(dog: object, cat: object):\n Condition\\\n .requires_obj(dog, 'dog')\\\n .is_not_null()\n \n Condition\\\n .requires_obj(cat, 'cat')\\\n .is_null()\n \n # Do other stuff\n```\n\nA particular validation is executed immediately when it's method is called, and therefore all checks are executed in the order in which they are written:\n\n## Acknowledgements\n\n- The icon \"Tornado\" designed by Adam Whitcroft from The Noun Project.\n- Geoffrey Huntley (ghuntley) who is the original author of \"Conditions\" from which this project was based on.", "description_content_type": "text/markdown", "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/GenesisCoast/conditions-py", "keywords": "", "license": "MIT", "maintainer": "", "maintainer_email": "", "name": "conditions-py", "package_url": "https://pypi.org/project/conditions-py/", "platform": "", "project_url": "https://pypi.org/project/conditions-py/", "project_urls": { "Homepage": "https://github.com/GenesisCoast/conditions-py" }, "release_url": "https://pypi.org/project/conditions-py/0.1.6/", "requires_dist": null, "requires_python": "", "summary": "conditions-py is a library that helps write pre- and postcondition validations in a fluent manner, helping improve the readability and reliability of code.", "version": "0.1.6" }, "last_serial": 5863212, "releases": { "0.1.0": [ { "comment_text": "", "digests": { "md5": "294824d71bda084519051a31a0890054", "sha256": "6231c3310176165c43de36e8b22026c301c3c9623a28e89903f591836ad6afed" }, "downloads": -1, "filename": "conditions_py-0.1.0-py3-none-any.whl", "has_sig": false, "md5_digest": "294824d71bda084519051a31a0890054", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 22571, "upload_time": "2019-08-08T10:10:48", "url": "https://files.pythonhosted.org/packages/20/d2/24b20d0e608e2ce4ed622e14dc850ba8573816cb1637979e34774a0dc641/conditions_py-0.1.0-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "d9de5c08d5a92ca048ac21e9a9a2c44a", "sha256": "17162766d67792f41fd2afa7d440564b6f39e2779e647d4f2dc6c7031c68007a" }, "downloads": -1, "filename": "conditions_py-0.1.0.tar.gz", "has_sig": false, "md5_digest": "d9de5c08d5a92ca048ac21e9a9a2c44a", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 5923, "upload_time": "2019-08-08T10:10:51", "url": "https://files.pythonhosted.org/packages/2f/b6/a8e2779f9ecc0b7f2f5856826a19a7f612a01e02d610d78158f8bbaeb095/conditions_py-0.1.0.tar.gz" } ], "0.1.1": [ { "comment_text": "", "digests": { "md5": "7530c89bf92f8d0bacfac916b91b5689", "sha256": "74ca4fab5e1873c6ccc46fa3e7b1fee17d917cd23cfd57a84b0644d64f5b801f" }, "downloads": -1, "filename": "conditions_py-0.1.1-py3-none-any.whl", "has_sig": false, "md5_digest": "7530c89bf92f8d0bacfac916b91b5689", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 22585, "upload_time": "2019-08-08T10:49:36", "url": "https://files.pythonhosted.org/packages/60/87/edabc2bdd6eac956b67326d1644b4bb39a18bb5957e886488d41c550bc54/conditions_py-0.1.1-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "2b97c06115307597584a12b984364f1b", "sha256": "eaf7b5a958edd3f411517955c107a6b73cd14f834da4b5c1654c9650ee0e111e" }, "downloads": -1, "filename": "conditions_py-0.1.1.tar.gz", "has_sig": false, "md5_digest": "2b97c06115307597584a12b984364f1b", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 5924, "upload_time": "2019-08-08T10:49:38", "url": "https://files.pythonhosted.org/packages/a7/07/50b898fbbd6cdd0a5825c0efa94693dfc92e854c08f6570e3f31d5a2dbf6/conditions_py-0.1.1.tar.gz" } ], "0.1.2": [ { "comment_text": "", "digests": { "md5": "12d32e71fc8be8dce0fe782e716e018c", "sha256": "3faefd8ba66bbbf0a6ab635d3f9ab956a41fae349c0c7d97860b2d7d123a2c2a" }, "downloads": -1, "filename": "conditions_py-0.1.2-py3-none-any.whl", "has_sig": false, "md5_digest": "12d32e71fc8be8dce0fe782e716e018c", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 22761, "upload_time": "2019-08-08T12:42:56", "url": "https://files.pythonhosted.org/packages/a5/cd/1da17c7a177de8c44ec65e9c9b9b564baf1c3113acaaf9069d96f700871f/conditions_py-0.1.2-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "43686e58980bd399831417f3ab40b985", "sha256": "c43b994b91a5077887acb0010e384adf0b4f5c4bbaff386fcd417a97c34a6086" }, "downloads": -1, "filename": "conditions_py-0.1.2.tar.gz", "has_sig": false, "md5_digest": "43686e58980bd399831417f3ab40b985", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 5998, "upload_time": "2019-08-08T12:43:00", "url": "https://files.pythonhosted.org/packages/5a/9f/85e7f3a48749f393a901ac2547060d93bec83cdf6d4bf4633d4cdce759c7/conditions_py-0.1.2.tar.gz" } ], "0.1.3": [ { "comment_text": "", "digests": { "md5": "4776cb6c7f50f6dcf767cdd3f76caebb", "sha256": "018a84e7d02bfda736a4e883874bdaccf1c132434db50f4121e9ec8efe66116e" }, "downloads": -1, "filename": "conditions_py-0.1.3-py3-none-any.whl", "has_sig": false, "md5_digest": "4776cb6c7f50f6dcf767cdd3f76caebb", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 22913, "upload_time": "2019-09-10T12:59:09", "url": "https://files.pythonhosted.org/packages/6e/e6/93e1ab480e6d766073517fa2df45a018c1435981c75b302eaa3d98b78452/conditions_py-0.1.3-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "177efd989a926f8825f1c1f9aaca10d5", "sha256": "2e13f822126ffa9f3b51587a0c20d0c88f3c01f83fa3fbee18cbe06c9a011796" }, "downloads": -1, "filename": "conditions_py-0.1.3.tar.gz", "has_sig": false, "md5_digest": "177efd989a926f8825f1c1f9aaca10d5", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 6155, "upload_time": "2019-09-10T12:59:14", "url": "https://files.pythonhosted.org/packages/08/ba/e5836ec7e24e9469ba7634192f33b60005d1c29789885e94e648c70a530d/conditions_py-0.1.3.tar.gz" } ], "0.1.4": [ { "comment_text": "", "digests": { "md5": "d402d00b30718761011fffe3541cb58d", "sha256": "6e238632367528a1c283bfafa2f734fa6781e90548472d4e6657412410cfb163" }, "downloads": -1, "filename": "conditions_py-0.1.4.tar.gz", "has_sig": false, "md5_digest": "d402d00b30718761011fffe3541cb58d", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 6012, "upload_time": "2019-09-10T13:34:03", "url": "https://files.pythonhosted.org/packages/88/35/082644028ba3af98f0e558975408a67dd3c7a8606437c61c47abb9c64c52/conditions_py-0.1.4.tar.gz" } ], "0.1.5": [ { "comment_text": "", "digests": { "md5": "6347f4298ae46cd1e568e0fbdd65092a", "sha256": "7cc46e3ba4df43444846ff078aebee2598d8b0fd62ea82696e1950c62a9f277e" }, "downloads": -1, "filename": "conditions_py-0.1.5.tar.gz", "has_sig": false, "md5_digest": "6347f4298ae46cd1e568e0fbdd65092a", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 6003, "upload_time": "2019-09-10T15:12:10", "url": "https://files.pythonhosted.org/packages/35/e0/fb7deb754a7f2a10bf67adc4bfd8b62c862f0836065f92aba79f2ab5e1e5/conditions_py-0.1.5.tar.gz" } ], "0.1.6": [ { "comment_text": "", "digests": { "md5": "a17ccd21d24171d16e369c8687bdaeb4", "sha256": "c1490a4d82ab09b2b3154ba391ba923f3f9a87ca420356ea21ab24e23d774f9e" }, "downloads": -1, "filename": "conditions_py-0.1.6.tar.gz", "has_sig": false, "md5_digest": "a17ccd21d24171d16e369c8687bdaeb4", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 6138, "upload_time": "2019-09-20T16:47:09", "url": "https://files.pythonhosted.org/packages/d1/19/6a16d49e52536295092d067c3460cbd7b24b2774a7d8324ce9258ff569e1/conditions_py-0.1.6.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "a17ccd21d24171d16e369c8687bdaeb4", "sha256": "c1490a4d82ab09b2b3154ba391ba923f3f9a87ca420356ea21ab24e23d774f9e" }, "downloads": -1, "filename": "conditions_py-0.1.6.tar.gz", "has_sig": false, "md5_digest": "a17ccd21d24171d16e369c8687bdaeb4", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 6138, "upload_time": "2019-09-20T16:47:09", "url": "https://files.pythonhosted.org/packages/d1/19/6a16d49e52536295092d067c3460cbd7b24b2774a7d8324ce9258ff569e1/conditions_py-0.1.6.tar.gz" } ] }