cucumber-expressions
Cucumber Expressions - a simpler alternative to Regular Expressions
What it is and what it does
Cucumber Expressions is a pattern-matching library designed for behavior-driven development that replaces regular expressions with a more intuitive, human-readable syntax. It parses expressions like "I have {count} cucumbers" into structured patterns that can extract and validate test step parameters, making test definitions easier to write and understand compared to regex-based approaches.
The library has no external runtime dependencies and supports modern Python versions (3.10 through 3.14). It is actively maintained by the Cucumber project and positioned as a core component for BDD test frameworks that need readable, maintainable step definitions.
Use it for:
- Write readable step definitions in BDD test suites without learning complex regex syntax
- Parse and extract parameters from Gherkin-style test steps in behavior-driven tests
- Build custom test frameworks that need human-friendly pattern matching for step matching
- Integrate with Cucumber-based testing tools to standardize step expression syntax
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
Cucumber Expressions provides a simpler, more readable alternative to regular expressions for pattern matching in behavior-driven development (BDD) test frameworks, with an intuitive syntax designed for test step definitions.
Yes. The package is actively maintained, has no dependencies, supports current Python versions, carries a permissive MIT license, and fills a genuine need in BDD testing by offering a more readable alternative to regex for test step definitions. Install it if you're building or using BDD test frameworks.
Install
cucumber-expressions on PyPI
pip
pip install cucumber-expressionsuv
uv add cucumber-expressionspoetry
poetry add cucumber-expressionsInstalling cucumber-expressions
Before you install
Low install friction with no runtime dependencies. Actively maintained with a recent release (9 days old) and steady repository activity.
License in practice
MIT license permits free use, modification, and distribution with minimal restrictions, making it suitable for both open-source and commercial projects.
Quickstart
pip install cucumber-expressions
from cucumber_expressions import CucumberExpressionParser
parser = CucumberExpressionParser()
expression = parser.parse("I have {count} cucumbers")
Requires Python 3.10 or later.
Verify before relying
- Whether the parser handles custom parameter types beyond built-in types
- Performance characteristics when parsing complex expressions at scale
- Integration examples with specific BDD frameworks (pytest-bdd, behave, etc.)
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,558,089/month — #2,577 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: cucumber_expressions-20.1.0-py3-none-any.whl
Keywords: cucumber, BDD, testing, expressions
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-tag-expressionsParses and evaluates boolean tag expressions…
permissive · top 5,000 on PyPI
behavebehave is a behavior-driven development (BDD)…
permissive · top 5,000 on PyPI
gherkin-officialParses and compiles Gherkin feature files into…
permissive · top 5,000 on PyPI
pytest-bddpytest-bdd implements Gherkin-based…
permissive · top 5,000 on PyPI
behave-djangoIntegrates Behave BDD testing into Django…
permissive · top 15,000 on PyPI
radish-bddradish is a Behavior Driven Development (BDD)…
permissive · top 15,000 on PyPI
exrexExrex generates all or random strings matching…
agpl · top 15,000 on PyPI
behavexBehaveX extends Behave with parallel test…
unclear · top 15,000 on PyPI
allure-behaveIntegrates Behave BDD test execution with…
permissive · top 15,000 on PyPI
regressProvides Python bindings to the Rust regress…
permissive · top 5,000 on PyPI