Skip to content

Commit

Permalink
feat: Expose public API as package imports
Browse files Browse the repository at this point in the history
- Update usage documentation
  • Loading branch information
kieran-ryan committed Jan 8, 2025
1 parent c5cf2b6 commit b81ffd5
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 4 deletions.
6 changes: 2 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -133,11 +133,9 @@ func main() {
#### Python

```python
from gherkin.parser import Parser
from gherkin.pickles.compiler import Compiler
from gherkin import Compiler, Parser

parser = Parser()
gherkin_document = parser.parse("Feature: ...")
gherkin_document = Parser().parse("Feature: ...")
gherkin_document["uri"] = "uri_of_the_feature.feature"
pickles = Compiler().compile(gherkin_document)
```
Expand Down
11 changes: 11 additions & 0 deletions python/gherkin/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
"""gherkin-official public API."""

from __future__ import annotations

from .parser import Parser
from .pickles.compiler import Compiler

__all__ = [
"Compiler",
"Parser",
]

0 comments on commit b81ffd5

Please sign in to comment.