Python wrapper for https://github.com/viz-rs/path-tree
Project description
routrie
A Python wrapper for Rust's path-tree
router (path-tree repo, path-tree crate).
This is a blazingly fast HTTP URL router with support for matching path parameters and catch-all URLs.
Usage:
from routrie import Router, Param
# the generic parameter is the value being stored
# normally this will be an endpoint / route instance
router: Router[int] = Router()
router.insert("/users", 1)
router.insert("/users/:id", 2)
router.insert("/users/repos/*any", 3)
matched = router.find("/foo-bar-baz")
assert matched is None
matched = router.find("/users/routrie")
assert matched is not None
value, params = matched
assert value == 2
assert params[0].name == "id"
assert params[0].value == "routrie"
matched = router.find("/users")
assert matched is not None
value, params = matched
assert value == 1
assert params == []
matched = router.find("/users/repos/)
assert matched is not None
value, params = matched
assert value == 3
assert params == []
matched = router.find("/users/repos/something)
assert matched is not None
value, params = matched
assert value == 3
assert params[0].name = "any"
assert params[0].value = "something"
Contributing
- Clone the repo.
- Run
make init
- Run
make test
- Make your changes
- Push and open a pull request
- Wait for CI to run.
If your pull request gets approved and merged, it will automatically be relased to PyPi (every commit to main
is released).
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
routrie-0.3.1.tar.gz
(8.4 kB
view hashes)
Built Distributions
routrie-0.3.1-cp37-abi3-win_amd64.whl
(128.2 kB
view hashes)
routrie-0.3.1-cp37-abi3-win32.whl
(123.6 kB
view hashes)
Close
Hashes for routrie-0.3.1-pp39-pypy39_pp73-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 18d1a01012b4004d5d7860616fe575ce8475eb9419d63e3170e9a3ccc172e98a |
|
MD5 | ca9984f46c7736040edcd915408327d0 |
|
BLAKE2b-256 | 1d64f4d782ea5227c81cc01ebb6ea9e07da8cecdf59a055f0b16a51726a46f2c |
Close
Hashes for routrie-0.3.1-pp39-pypy39_pp73-manylinux_2_5_x86_64.manylinux1_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | a27af7a825c289e6f0aa1308db36db7d583efc7b0f32f863c7517d9bcc57ca41 |
|
MD5 | 630be1450f408ff7596500a3f16693be |
|
BLAKE2b-256 | cf47201a6aae199a7ef4478bb1badf2f921914c006a4f1f7797918872a9a2ffc |
Close
Hashes for routrie-0.3.1-pp39-pypy39_pp73-macosx_10_7_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 8250dae14001ef4224af19c22f49be957f73546eac988b413506c746926049da |
|
MD5 | 389f8f2c4b314520ab9eb88e7cfc833d |
|
BLAKE2b-256 | b58a80f4b8d7732497dece42d78c69d3004e0cf55213d5569f4d6ea206ab7c2d |
Close
Hashes for routrie-0.3.1-pp38-pypy38_pp73-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 5cb2c1f8f46fb4b2b8ee021afeef2f8ddbbc3a5e499c447807ab6a609fdfb8f4 |
|
MD5 | 8f2d9f7e967e4065bcf5a37ce67e230f |
|
BLAKE2b-256 | 1a79f124989c31e4dcb5e156bffb4fe0bd89b88bc3e1bf880f2928a91112eaa6 |
Close
Hashes for routrie-0.3.1-pp38-pypy38_pp73-manylinux_2_5_x86_64.manylinux1_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 440143379e626018b5264651ab9411ca22d4bc27b4def68455b5f6d8392597fc |
|
MD5 | eadc81ab1ad8d15186a005ab97dff0fe |
|
BLAKE2b-256 | e841e8c2e06ad92f80a065ffde8ec8b1da146c622de6c53c00f9f98f60fe1fe4 |
Close
Hashes for routrie-0.3.1-pp38-pypy38_pp73-macosx_10_7_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 4befa932461ba725a7ae919e876e1c1c673974dd36425ca9dde7288cca4a9454 |
|
MD5 | 384128d88107a55bbdde64c974a54513 |
|
BLAKE2b-256 | 1c85de9f047e1510dc714a2f4cb685fef98ea75d355dd7a58a45526ef0450404 |
Close
Hashes for routrie-0.3.1-pp37-pypy37_pp73-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | ad8f985f3456faba2ab174d3972db391bea0f24b25bc59770fa333ced3aed726 |
|
MD5 | 30d7f801e0e99d36e308962b2719de35 |
|
BLAKE2b-256 | 1054936b016930230039cd8d318b0381435450d8bb29aedde7ff162819ee0864 |
Close
Hashes for routrie-0.3.1-pp37-pypy37_pp73-manylinux_2_5_x86_64.manylinux1_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 597622f3abdf40b883192fb26347f4b315b0a940211570d28bcd3e5e7d41f9f3 |
|
MD5 | 830de0eb48f5d34c9e0084ae1ef1f28f |
|
BLAKE2b-256 | 44c48af2220ec249b2d371813b7355cb5e560a5b7b358548a44ddf6e0efc62e9 |
Close
Hashes for routrie-0.3.1-pp37-pypy37_pp73-macosx_10_7_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | a3f0146bee8ea7c566712dcc2c5e3b566f0dfed1b6fa7db874a59dfc8d6956e0 |
|
MD5 | 6367d3ac50db88cc5fc3ea040cfaabba |
|
BLAKE2b-256 | bfd9ad386613550dfaf06ba8149418b8dbf845851943e624d652dfa329cbc96d |
Close
Hashes for routrie-0.3.1-cp37-abi3-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 05cea6704161cdb6198a88b030adde0f8ff6ebf39ea144eae4de97810cf8f186 |
|
MD5 | 4794ed3fef23a1aed95377361fdf2d00 |
|
BLAKE2b-256 | 5d56b32c63ebe36a654e848035b8af002cd90f305561b01674953f0e52e15141 |
Close
Hashes for routrie-0.3.1-cp37-abi3-win32.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | b6aae55d4854ec89680da0004ec5155e315023471a647bb0676850b197027e35 |
|
MD5 | 541ed972e5e93110981441a295a16227 |
|
BLAKE2b-256 | 208ed96d743b9aebe5a01e248db19249b0ca198689455395d8f3c611c772d2f4 |
Close
Hashes for routrie-0.3.1-cp37-abi3-musllinux_1_2_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | fb38d5d0612f18a68f499248f580bfb2621f8429f3fdaa069ad27ca9d48b2074 |
|
MD5 | 61d140a0a5fc79de8f646efcc16354b8 |
|
BLAKE2b-256 | c9278a01bf1116bda016f4a6cfd4f720b63243fe7e93093941b8c21054ad205b |
Close
Hashes for routrie-0.3.1-cp37-abi3-musllinux_1_2_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | b7cca0ef6daab1b15beebc72982893c13aabbc8bdaf94b73efbbe5df5a220e53 |
|
MD5 | 882a4b93d18589f98b04f2aabc46a8e3 |
|
BLAKE2b-256 | de6f51942323530500526c053244d02d4b346eab4dfb5b1a74576096cbc29084 |
Close
Hashes for routrie-0.3.1-cp37-abi3-musllinux_1_2_armv7l.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 49c57b6f5ed2e97f7125c9aeccc35005dd15f6487c5d480c8dead49ee0e769d3 |
|
MD5 | a41a754cdf86a2dd9fc5b29e194e33d1 |
|
BLAKE2b-256 | 4ecac84ed33466941506d5834f6163c061d72fe51005dd3893d33dd047b7b1a8 |
Close
Hashes for routrie-0.3.1-cp37-abi3-musllinux_1_2_aarch64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 44a04ed430e5bbdf26a007272ad68f60a1688acba92da56b184c2d804d2810eb |
|
MD5 | 86462523eda98ea03120d6131be80d31 |
|
BLAKE2b-256 | 9c98acdc1e95c1cbc176be472a5ccb82d5c9c9398658c54fe2c2e8013d384f55 |
Close
Hashes for routrie-0.3.1-cp37-abi3-manylinux_2_17_s390x.manylinux2014_s390x.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 87b1f5e27d6466b71deca659c301df70fb07cb9669f43fa4450e8602a6fd2025 |
|
MD5 | f808a1ee697c8bef17984e987e3b4a53 |
|
BLAKE2b-256 | 2147637c443bc386c17e395dc916e849b60f5c42aab70da84613b365c607ad2d |
Close
Hashes for routrie-0.3.1-cp37-abi3-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 08d582bcdd7ca08dc8b6891e4cb3ad2a964c3e535a16b249cb0417bd7d25926d |
|
MD5 | a2e2fe9342d9b3ce827c8f41fd6529d8 |
|
BLAKE2b-256 | 8ed7311b3427919862ea7338e6de946204fd915c60d22fc2b0ac858a528daa57 |
Close
Hashes for routrie-0.3.1-cp37-abi3-manylinux_2_17_ppc64.manylinux2014_ppc64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | d77c2420d66f6662f8348bf1b3a25713558c7a7ae0e1faf950155206d9c502e4 |
|
MD5 | 2610aab8dde98db6d0653fc2ddf229af |
|
BLAKE2b-256 | c918f8afcd54dbc2e2c9c1e9c36f84de148c16f1c6b6f6f1d08a76455b73bc32 |
Close
Hashes for routrie-0.3.1-cp37-abi3-manylinux_2_17_armv7l.manylinux2014_armv7l.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 406ae433e9a2d340cb0510a08c18416e87abd4c2c222492920c064a89bffac59 |
|
MD5 | e1d716f2344b764e5844c82449771f76 |
|
BLAKE2b-256 | 8aab50afbcf5554ece7b139bf8c4518bc8c11d80008dc12060de71231158527f |
Close
Hashes for routrie-0.3.1-cp37-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | d25fb23b734f55117337409f0e48353602a131ec32b1acc46fb3f3733b941b9d |
|
MD5 | 97c0640c252869f67ecaf969e9a1bbf0 |
|
BLAKE2b-256 | 0292d5107d3aaa71b39065e7ee08ef6594f994f85274ab39a54067e781601887 |
Close
Hashes for routrie-0.3.1-cp37-abi3-manylinux_2_5_x86_64.manylinux1_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 9964cbd5eba9bd7636c28c47359387fdc9367b85cb3fcddb61c3b4c442dec7ad |
|
MD5 | da6cab4e499e69361bbb60e0de746f98 |
|
BLAKE2b-256 | f7a0925a8ed2c5798628af277cf76b46c612cc19947ee347bff5eab959293ff4 |
Close
Hashes for routrie-0.3.1-cp37-abi3-manylinux_2_5_i686.manylinux1_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 78a7f8be7ee6b92da48ec457f78e0c07c39f1da6fd0578d9df380aaae85334bb |
|
MD5 | 95c9bcae4ab159b741ce923d9a7af8be |
|
BLAKE2b-256 | 5f14a8d117a17f7e318fcc94b5ea31dd02c85f707cad1e08604b6e3f091f0c92 |
Close
Hashes for routrie-0.3.1-cp37-abi3-macosx_10_9_x86_64.macosx_11_0_arm64.macosx_10_9_universal2.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | b8cec98f035d6c796b1b14bc8193947da0c99c2109757f4a1d7b6dca2589dab8 |
|
MD5 | f5de1b6535e5bfbda22a1cc2662eaa8d |
|
BLAKE2b-256 | 528c64328f0bae362acaf36572551f0dc028f0cf654fadca9def5c93fff24330 |
Close
Hashes for routrie-0.3.1-cp37-abi3-macosx_10_7_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | a1cc0730354b1859c8f21b3ef7eb053a9335e7a45590739c6291d3e23fef238a |
|
MD5 | ed19cf3e1928106f9a5429ee6790ff4b |
|
BLAKE2b-256 | 57ff7a85008151a538ad75e1105643b8ba34ff78a03ca2844a3533224fd686e7 |