Skip to content

Commit

Permalink
docs: update readme & version
Browse files Browse the repository at this point in the history
  • Loading branch information
bdura committed Apr 2, 2024
1 parent 22bd7a7 commit df90b57
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
9 changes: 7 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ shortcuts had to be taken in many cases.
Persil is a pure-Python library. You can install it with pip:

```shell
pip install git+https://github.com/bdura/persil
pip install persil
```

Then, you can play with persil much the same way you would with Parsy,
Expand All @@ -35,6 +35,11 @@ from persil import regex
year = regex(r"\d{4}").map(int)
```

This example should drive home the point that Persil is heavily inspired by Parsy.
The only difference in this particular case is type-safety:
the persil version knows that `year` is a parser that expects
a `str`, and outputs an `int`.

### More complex parsers

Parsy uses generator functions as a most elegant solution to define complex parser.
Expand Down Expand Up @@ -138,4 +143,4 @@ def datetime_parser(stream: Stream[str]) -> datetime:
return datetime(year, month, day)
```

That way, the parsers are only defined once.
That way, the lower-level parsers are only defined once.
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[tool.poetry]
name = "persil"
version = "0.1.0-alpha0"
version = "0.1.0-alpha1"
description = "Persil is a pure-python parsing library, inspired by Parsy"
authors = ["Basile Dura <[email protected]>"]
readme = "README.md"
Expand Down

0 comments on commit df90b57

Please sign in to comment.