{ "info": { "author": "Mihalcea Romeo", "author_email": "romeo.mihalcea@gmail.com", "bugtrack_url": null, "classifiers": [], "description": "Simple string conditions\n================\n\nA small python package which evaluates string based conditions.\n\nAs an example let's say you have a class which creates a HTML link\nbut this link can have some widgets attached to it such as a tooltip,\npopover, dropdown, modal etc.\n\nNormally you would declare what widgets are supported by your class in\nan array or dict and loop through it to perform the validations\nbut here comes the tricky part, some widgets don't get\nwell together. Like the tooltip with the popover or the modal with the\ndropdown so you must somehow enforce a condition for each one in part\nwhich takes a lot of time, it's not elegant and not isolated (why should\nthe tooltip care about the popover?).\n\nAs a response to such needs I've created this small library which takes a\nstring such as `(dropdown modal href) (tooltip popover) title` and evaluates\nit so that we can ensure an exception is thrown if we supply both a modal\nand a dropdown to the same link for example. The library supports more\ntrickery so here are a few examples and their 'translations' respectively:\n\n`href&text (dropdown modal) (tooltip popover title)` - `href` and `text` are\nrequired attributes, you can also supply a dropdown or modal and you can also\nprovide a tooltip, popover or title attribute.\n\n`href&text title|tooltip` - `href` and `text` are required, any or both of\ntitle and tooltip must be provided.\n\n`title|text|href` - any or all must be provided\n\n`title&text` - both are required\n\n`(title&text|tooltip popover)` - one of the group can be provided and it's\neither `title + text or tooltip` or `popover`\n\n### To wrap things up ######\n\n`&` (and) binds values and makes them both required \n`|` (or) any or all of the values separated by pipe can be supplied \n`()` (exclusive) group of exclusive values (only one value from the group can be supplied) .\nThe group values can also be glued with either `&` or `|` operators and they\nwill get evaluated accordingly.\n\n... open to suggestions. For more examples you can read the `tests.py` file\n\nP.S. Usage:\n\n\tfrom string_conditions.base import validate, StringConditionsException\n\n\ttry:\n\t\tvalidate( \"title&text\", [\"title\", \"foo\", \"bar\"] )\n\texcept StringConditionsException:\n\t\t....", "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/ciokan/string_condition", "keywords": null, "license": "MIT", "maintainer": null, "maintainer_email": null, "name": "StringConditions", "package_url": "https://pypi.org/project/StringConditions/", "platform": "UNKNOWN", "project_url": "https://pypi.org/project/StringConditions/", "project_urls": { "Download": "UNKNOWN", "Homepage": "https://github.com/ciokan/string_condition" }, "release_url": "https://pypi.org/project/StringConditions/0.2/", "requires_dist": null, "requires_python": null, "summary": "A small python package which evaluates string based conditions", "version": "0.2" }, "last_serial": 870870, "releases": { "0.1": [ { "comment_text": "", "digests": { "md5": "3234cdb1ce895f50f088edf610d5836d", "sha256": "97f79206a82b7db29673d551159c3ea87f2d5fd21f736d56d33bab3950634db7" }, "downloads": -1, "filename": "StringConditions-0.1.tar.gz", "has_sig": false, "md5_digest": "3234cdb1ce895f50f088edf610d5836d", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 2890, "upload_time": "2013-09-21T01:18:47", "url": "https://files.pythonhosted.org/packages/53/a3/2a88447637c6c31f6670abb6b4a7f618351e1dea7f8e32ede025e8edb04e/StringConditions-0.1.tar.gz" } ], "0.2": [ { "comment_text": "", "digests": { "md5": "bb0167a49ef6f2da0d03991067733b13", "sha256": "938eefd4a9464b7ec0ba50dce2dfcc582e30d24696c3e2bfbd55dd72ee79e53c" }, "downloads": -1, "filename": "StringConditions-0.2.tar.gz", "has_sig": false, "md5_digest": "bb0167a49ef6f2da0d03991067733b13", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 2917, "upload_time": "2013-09-22T03:10:41", "url": "https://files.pythonhosted.org/packages/bd/10/0209fd3023b9d09a436b33156eab23e0ac87e7639095699e1744b032f4f5/StringConditions-0.2.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "bb0167a49ef6f2da0d03991067733b13", "sha256": "938eefd4a9464b7ec0ba50dce2dfcc582e30d24696c3e2bfbd55dd72ee79e53c" }, "downloads": -1, "filename": "StringConditions-0.2.tar.gz", "has_sig": false, "md5_digest": "bb0167a49ef6f2da0d03991067733b13", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 2917, "upload_time": "2013-09-22T03:10:41", "url": "https://files.pythonhosted.org/packages/bd/10/0209fd3023b9d09a436b33156eab23e0ac87e7639095699e1744b032f4f5/StringConditions-0.2.tar.gz" } ] }