Skip to content

Commit ddc1486

Browse files
committed
Update README.md
1 parent e26fe0b commit ddc1486

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
lines changed

README.md

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,20 +5,26 @@
55
[![Ruff](https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/astral-sh/ruff/main/assets/badge/v2.json)](https://github.com/astral-sh/ruff)
66
[![CI](https://github.com/urlpattern/python-urlpattern/actions/workflows/CI.yml/badge.svg)](https://github.com/urlpattern/python-urlpattern/actions)
77

8-
This library is an implementation of [the URL Pattern Standard](https://urlpattern.spec.whatwg.org/) for Python written in Rust.
8+
An implementation of [the URL Pattern Standard](https://urlpattern.spec.whatwg.org/) for Python written in Rust
9+
10+
## Introduction
911

1012
It provides a pattern matching syntax like `/users/:id/`, similar to [Express](https://expressjs.com/) or [Path-to-RegExp](https://github.com/pillarjs/path-to-regexp) in Node.js. You can use it as a foundation to build your own web server or framework.
1113

1214
It's a thin wrapper of [denoland/rust-urlpattern](https://github.com/denoland/rust-urlpattern) with [PyO3](https://github.com/PyO3/pyo3) + [Maturin](https://github.com/PyO3/maturin).
1315

14-
## Example
16+
## Examples
1517

1618
```py
1719
from urlpattern import URLPattern
1820

1921
pattern = URLPattern("https://example.com/admin/*")
2022
print(pattern.test("https://example.com/admin/main/")) # output: True
2123
print(pattern.test("https://example.com/main/")) # output: False
24+
```
25+
26+
```py
27+
from urlpattern import URLPattern
2228

2329
pattern = URLPattern({"pathname": "/users/:id/"})
2430
result = pattern.exec({"pathname": "/users/4163/"})
@@ -42,3 +48,5 @@ py -m pip install urlpattern
4248
## Limitations
4349

4450
Due to limitations in the dependency [denoland/rust-urlpattern](https://github.com/denoland/rust-urlpattern), it may not support all features specified in [the standard](https://urlpattern.spec.whatwg.org/).
51+
52+
Check the limitations in [`tests/test_lib.py`](tests/test_lib.py).

0 commit comments

Comments
 (0)