cucumber-tag-expressions
Provides a tag-expression parser and evaluation logic for cucumber/behave
What it is and what it does
Cucumber Tag Expressions is a parser and evaluator for boolean tag expressions used in Gherkin-based BDD testing. It takes a human-readable expression like `@fast and not @slow` or `(@login or @registration) and @critical`, parses it into an evaluable form, and then checks whether a given set of tags satisfies that expression. The package has no runtime dependencies and is designed to integrate with test runners like behave, which use tag expressions to filter which scenarios to execute.
The typical workflow is: a test runner receives a tag expression from the command line (e.g., `--tags="@smoke and not @wip"`), passes it to this package's `parse()` function, and then evaluates the resulting object against the tags on each scenario. It supports the full boolean algebra of `and`, `or`, and `not` operators, with parentheses for grouping, making it possible to express complex filtering logic in a readable, declarative way.
Use it for:
- Filter which test scenarios to run in CI/CD pipelines by tag expression (e.g., run only @smoke tests on every commit).
- Locally run a subset of scenarios during development using tag expressions (e.g., `@wip and not @slow`).
- Implement custom test selection logic in a test harness that needs to parse and evaluate tag-based filters.
- Build a test reporting or filtering tool that accepts user-supplied tag expressions to organize test results.
- Enforce test categorization in BDD frameworks by evaluating which scenarios match complex tag criteria.
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
Parses and evaluates boolean tag expressions (using and, or, not operators) to select Gherkin scenarios and features based on their tags, commonly used by BDD test runners like behave.
Yes. This is a lightweight, actively maintained library with zero dependencies, permissive licensing, and a clear, focused purpose. Install it if you are building or using a Gherkin-based BDD test runner (such as behave) or need to parse and evaluate tag expressions for test selection. No security vulnerabilities are known.
Install
cucumber-tag-expressions on PyPI
pip
pip install cucumber-tag-expressionsuv
uv add cucumber-tag-expressionspoetry
poetry add cucumber-tag-expressionsInstalling cucumber-tag-expressions
Before you install
Low friction: pure Python wheel with no runtime dependencies and active maintenance (last commit 2026-08-14). Supports current Python versions (3.10–3.14).
License in practice
MIT license permits unrestricted use, modification, and distribution in commercial and private projects.
Quickstart
pip install cucumber-tag-expressions
from cucumber_tag_expressions import parse
fast = parse("@fast")
print(fast({"@fast", "@wip"})) # True
print(fast({"@performance", "@slow"})) # False
Requires Python 3.10 or later.
Verify before relying
- Whether the package is used by test runners other than behave or if behave integration is automatic.
- Performance characteristics when evaluating complex expressions against large tag sets.
Package facts
| License | MIT (permissive) |
| Python support | supports the current Python release (>=3.10) |
| Install friction | low — pure-Python wheel |
| Runtime dependencies | none |
| Maintenance | actively maintained — 9 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 3,760,567/month — #2,502 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: cucumber_tag_expressions-11.0.1-py3-none-any.whl
Keywords: BDD, testing, cucumber, tag-expressions, behave
Tags
More Python Modules packages
Converts domain names between Unicode and…
permissive · top 100 on PyPI
setuptoolsSetuptools is a Python build backend and…
permissive · top 100 on PyPI
PyYAMLPyYAML parses and emits YAML 1.1 data format,…
permissive · top 100 on PyPI
pydanticPydantic validates Python data structures…
permissive · top 100 on PyPI
annotated-typesProvides reusable metadata objects for use with…
permissive · top 100 on PyPI
typing-inspectionProvides runtime tools to inspect and…
permissive · top 100 on PyPI
cucumber-expressionsCucumber Expressions provides a simpler, more…
permissive · top 5,000 on PyPI
gherkin-officialParses and compiles Gherkin feature files into…
permissive · top 5,000 on PyPI
tag-expressionsParses and evaluates logical tag expressions…
copyleft · top 15,000 on PyPI
behavebehave is a behavior-driven development (BDD)…
permissive · top 5,000 on PyPI
pytest-bddpytest-bdd implements Gherkin-based…
permissive · top 5,000 on PyPI
radish-bddradish is a Behavior Driven Development (BDD)…
permissive · top 15,000 on PyPI
behavexBehaveX extends Behave with parallel test…
unclear · top 15,000 on PyPI
behave-djangoIntegrates Behave BDD testing into Django…
permissive · top 15,000 on PyPI
boolean.pyParse, simplify, and compare boolean…
permissive · top 1,000 on PyPI
license-expressionParses, validates, simplifies, and normalizes…
permissive · top 1,000 on PyPI