python-matchit package contains binding for matchit rust library.
pip install python-matchitfrom matchit import Router
router = Router()
router.insert("/users/{id}", "test_id")
res = router.at("/users/123")
assert res.value == "test_id"
assert res.params == {"id": "123"}
try:
assert r.at("/noway")
except LookupError:
print("Not found as expected")