--- id: gherkin-official version: "42.0.1" license: MIT license_treatment: permissive maintenance: active --- # gherkin-official — Gherkin parser (official, by Cucumber team) License: permissive · Maintenance: active · Downloads: 2.8M/mo ## What it is and what it does Gherkin is the official parser and compiler for the Gherkin language, maintained by the Cucumber team. It reads Gherkin feature files (plain-text specifications written in a business-readable syntax) and converts them into structured data—abstract syntax trees and pickles—that testing frameworks can execute. The library is designed to work in-process, producing easily consumable objects without requiring subprocess calls or JSON parsing. You can use it either as a library (the recommended approach) or via a command-line interface that outputs newline-delimited JSON conforming to the Cucumber Event Protocol. It supports multiple languages through i18n translations and handles table cell escaping. The package depends only on typing-extensions and supports Python 3.10 through 3.14. Use it for: - Parse .feature files in a test runner to convert Gherkin scenarios into executable test cases. - Build custom BDD tooling that consumes Gherkin specifications and generates test code or reports. - Validate Gherkin syntax in feature files before passing them to Cucumber or similar frameworks. - Extract and analyze test scenarios from feature files for documentation or coverage reporting. - Integrate Gherkin parsing into CI/CD pipelines to compile feature files into intermediate representations. ## Worth the install? AI-flagged interpretation of the facts above — verify before relying. Parses and compiles Gherkin feature files into abstract syntax trees and pickles for behavior-driven development testing frameworks. Yes. This is the official Gherkin parser maintained by the Cucumber team, actively developed, permissively licensed (MIT), and has minimal dependencies. Install it if you need to parse or compile Gherkin feature files programmatically or integrate BDD workflows into custom tooling. The only constraint is a Python 3.10+ requirement. ## Install pip install gherkin-official uv add gherkin-official poetry add gherkin-official ## Installing gherkin-official Before you install: Low install friction with a single lightweight runtime dependency (typing-extensions). Active maintenance with a recent release (9 days old) and steady repository activity. License in practice: MIT license permits unrestricted use, modification, and distribution in both open-source and proprietary projects. Quickstart: from gherkin import Compiler, Parser gherkin_document = Parser().parse("Feature: ...") gherkin_document["uri"] = "uri_of_the_feature.feature" pickles = Compiler().compile(gherkin_document) Requires Python 3.10 or later. Verify before relying: - Whether the library API is stable across minor versions or subject to breaking changes - Performance characteristics when parsing large feature files or many files in sequence - Whether i18n support covers all languages needed for your test suite ## Package facts - License: MIT (permissive) - Python support: supports_current - Install friction: low - Maintenance: active - Downloads: 2.8M/month (top 5,000 on PyPI) - Known vulnerabilities: none known ## Tags gherkin parser, feature file parsing, bdd test parsing, cucumber gherkin, feature file compiler, gherkin ast, behavior driven development parser, bdd, testing, parser [View on SkillFed](https://skillfed.io/packages/gherkin-official) · [View on PyPI](https://pypi.org/project/gherkin-official/)