{"id":15667536,"url":"https://github.com/timofurrer/tag-expressions","last_synced_at":"2025-08-21T05:31:49.024Z","repository":{"id":57473187,"uuid":"83133067","full_name":"timofurrer/tag-expressions","owner":"timofurrer","description":"Python implementation of Shunting-yard Algorithm to evaluate logical tag expressions","archived":false,"fork":false,"pushed_at":"2024-11-23T15:47:31.000Z","size":40,"stargazers_count":3,"open_issues_count":0,"forks_count":1,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-04-02T10:43:45.647Z","etag":null,"topics":["bdd","bool","cucumber","evaluate","expression","logic","parse","radish","shunting-yard-algorithm","tags","tree"],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/timofurrer.png","metadata":{"files":{"readme":"README.rst","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2017-02-25T13:22:00.000Z","updated_at":"2024-11-23T15:44:34.000Z","dependencies_parsed_at":"2024-10-03T14:04:21.326Z","dependency_job_id":"a4faefdc-df13-4e83-9fa7-4d29ba81783e","html_url":"https://github.com/timofurrer/tag-expressions","commit_stats":{"total_commits":13,"total_committers":1,"mean_commits":13.0,"dds":0.0,"last_synced_commit":"9b58c34296b31530f31517ffefc8715516c73da3"},"previous_names":[],"tags_count":5,"template":false,"template_full_name":null,"purl":"pkg:github/timofurrer/tag-expressions","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/timofurrer%2Ftag-expressions","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/timofurrer%2Ftag-expressions/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/timofurrer%2Ftag-expressions/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/timofurrer%2Ftag-expressions/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/timofurrer","download_url":"https://codeload.github.com/timofurrer/tag-expressions/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/timofurrer%2Ftag-expressions/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":271430741,"owners_count":24758362,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-08-21T02:00:08.990Z","response_time":74,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["bdd","bool","cucumber","evaluate","expression","logic","parse","radish","shunting-yard-algorithm","tags","tree"],"created_at":"2024-10-03T14:04:09.029Z","updated_at":"2025-08-21T05:31:48.503Z","avatar_url":"https://github.com/timofurrer.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"tag-expressions\n===============\n\nPackage to evaluate logical tag expressions by using a modified version of the `Shunting Yard algorithm \u003chttps://en.wikipedia.org/wiki/Shunting-yard_algorithm\u003e`_.\nThis package is a Python port of cucumbers tag expression.\n\nIt's also used by `radish \u003chttps://github.com/radish-bdd/radish\u003e`_.\n\n|Build Status| |PyPI package version| |PyPI python versions|\n\n\nInstalling\n----------\n\n.. code:: bash\n\n    $ pip install tag-expressions\n\nHere is a tease\n---------------\n\n\n.. code:: python\n\n    \u003e\u003e\u003e from tagexpressions import parse\n    \u003e\u003e\u003e\n    \u003e\u003e\u003e expression = '( a and b ) or ( c and d )'\n    \u003e\u003e\u003e compiled_expression = parse(expression)\n    \u003e\u003e\u003e print(compiled_expression)\n    ( ( a and b ) or ( c and d ) )\n    \u003e\u003e\u003e\n    \u003e\u003e\u003e data = ['a', 'b', 'c', 'd']\n    \u003e\u003e\u003e assert compiled_expression.evaluate(data) == True\n    \u003e\u003e\u003e\n    \u003e\u003e\u003e data = ['a', 'c']\n    \u003e\u003e\u003e assert compiled_expression.evaluate(data) == False\n    \u003e\u003e\u003e\n    \u003e\u003e\u003e\n    \u003e\u003e\u003e expression = 'not a or b and not c or not d or e and f'\n    \u003e\u003e\u003e compiled_expression = parse(expression)\n    \u003e\u003e\u003e print(compiled_expression)\n    ( ( ( not ( a ) or ( b and not ( c ) ) ) or not ( d ) ) or ( e and f ) )\n    \u003e\u003e\u003e\n    \u003e\u003e\u003e data = ['b', 'e', 'f']\n    \u003e\u003e\u003e assert compiled_expression.evaluate(data) == True\n    \u003e\u003e\u003e\n    \u003e\u003e\u003e data = ['a', 'c', 'd']\n    \u003e\u003e\u003e assert compiled_expression.evaluate(data) == False\n\n\nUsage\n-----\n\nAvailable operators\n~~~~~~~~~~~~~~~~~~~\n\n* **or** - \"or\" conjunction of two given variables\n* **and** - \"and\" conjunction of two given variables\n* **not** - negation of a single variable\n\nEvery other token given in an *infix* is considered a variable.\n\nOperator precedence\n~~~~~~~~~~~~~~~~~~~\n\nFrom high to low:\n\n* ()\n* or\n* and\n* not\n\n.. |Build Status| image:: https://github.com/timofurrer/tag-expressions/actions/workflows/build.yml/badge.svg\n   :target: https://github.com/timofurrer/tag-expressions/actions/workflows/build.yml\n.. |PyPI package version| image:: https://badge.fury.io/py/tag-expressions.svg\n   :target: https://badge.fury.io/py/tag-expressions\n.. |PyPI python versions| image:: https://img.shields.io/pypi/pyversions/tag-expressions.svg\n   :target: https://pypi.python.org/pypi/tag-expressions\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftimofurrer%2Ftag-expressions","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftimofurrer%2Ftag-expressions","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftimofurrer%2Ftag-expressions/lists"}