--- id: tag-expressions version: "2.0.1" license: unclear license_treatment: copyleft maintenance: dormant --- # tag-expressions — Built-in functions, types, exceptions, and other objects. License: copyleft · Maintenance: dormant · Downloads: 176.1K/mo ## What it is and what it does tag-expressions is a Python port of Cucumber's tag expression evaluator. It takes a logical expression written with tags and boolean operators (and, or, not) and compiles it into an evaluable form, then checks whether a given set of tags satisfies that expression. The package uses a modified Shunting Yard algorithm to parse infix expressions into an internal representation that respects operator precedence: parentheses, then or, then and, then not. It's designed for test filtering and tagging scenarios, particularly in BDD frameworks like Cucumber and radish. You write an expression like '(a and b) or (c and d)', compile it once, then evaluate it repeatedly against different tag lists to determine whether they match the filter criteria. Use it for: - Filter test cases in BDD frameworks by tag combinations without re-parsing the expression each time - Build dynamic test selection logic where users specify tag filters as human-readable boolean expressions - Implement tag-based feature gating or conditional logic in test runners or CI pipelines - Parse and evaluate user-supplied tag queries in applications that organize content or items by tags ## Worth the install? AI-flagged interpretation of the facts above — verify before relying. Parses and evaluates logical tag expressions using a modified Shunting Yard algorithm, supporting and, or, and not operators to filter data based on tag membership. Yes, if you need to evaluate logical tag expressions in a test or filtering context. The package is stable, dependency-free, and supports modern Python versions. The copyleft license is a consideration for proprietary use. Dormancy is not a blocker for a mature, focused library with no external dependencies, but verify it meets your Python version and licensing requirements before adopting. ## Install pip install tag-expressions uv add tag-expressions poetry add tag-expressions ## Installing tag-expressions Before you install: Low install friction with no runtime dependencies. Repository is dormant (last commit 2024-11-23, 629 days since release), but the package is marked Production/Stable and supports modern Python versions through 3.13. License in practice: Licensed under GPLv3+, a copyleft license requiring derivative works to be distributed under the same terms. Use in proprietary software may require careful review of your distribution model. Quickstart: from tagexpressions import parse expression = '(a and b) or (c and d)' compiled = parse(expression) data = ['a', 'b', 'c', 'd'] result = compiled.evaluate(data) # True Verify before relying: - Whether the package is actively maintained or if dormancy poses a risk for future Python compatibility - Real-world usage frequency beyond the stated 176,087 monthly downloads ranking ## Package facts - License: not declared (copyleft) - Python support: unspecified - Install friction: low - Maintenance: dormant - Downloads: 176.1K/month (top 15,000 on PyPI) - Known vulnerabilities: none known ## Tags tag expression parser, logical tag filtering, boolean tag evaluation, tag expression evaluator, and or not tag logic, shunting yard parser, tag-based filtering, bdd-testing, tag-filtering [View on SkillFed](https://skillfed.io/packages/tag-expressions) · [View on PyPI](https://pypi.org/project/tag-expressions/)