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
assert matched.value == 2
assert matched.params[0].name == "id"
assert matched.params[0].value == "routrie"
matched = router.find("/users")
assert matched is not None
assert matched.value == 1
assert matched.params == []
matched = router.find("/users/repos/)
assert matched is not None
assert matched.value == 3
assert matched.params == []
matched = router.find("/users/repos/something)
assert matched is not None
assert matched.value == 3
assert matched.params[0].name = "any"
assert matched.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.1.2.tar.gz
(7.8 kB
view hashes)
Built Distributions
routrie-0.1.2-cp37-abi3-win_amd64.whl
(134.4 kB
view hashes)
Close
Hashes for routrie-0.1.2-pp38-pypy38_pp73-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 050359f070c8e13c512b67600366bf7da8713d6db97089c39936d72ca58bb405 |
|
MD5 | a07f9878b98b282699dc212983f083e0 |
|
BLAKE2b-256 | 922095026c87f1038fa0e758e54e374e5fdaa3bf152786dca4d3fb42342555c1 |
Close
Hashes for routrie-0.1.2-pp38-pypy38_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | f233f72a307bc5876fc3112ee357fbeb98d5652f380dd79ab8e8833765cfbc18 |
|
MD5 | b99f1693a688c689305185df59a49835 |
|
BLAKE2b-256 | d0a692654031553085842e23a0ed03e56be13ede89de52c42fd0db2bde4704a3 |
Close
Hashes for routrie-0.1.2-pp38-pypy38_pp73-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 54e5f4f6096996a6ea5987ebf63812ebdf6c176b89cfc0eeb593dde42a3c571a |
|
MD5 | 231f7d7dbdda77314c9ea016079b26d8 |
|
BLAKE2b-256 | 39d48ac3ef4d5b0dc2a0f2b4ac869292cf74dce21efae94de2b3da265bf2e5fc |
Close
Hashes for routrie-0.1.2-pp38-pypy38_pp73-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 41631cb9fb0ac3da1f853c5e664a0072d89b204e0e894d3ab8a95abce68bb412 |
|
MD5 | 9356a7ea14c21568af1263da6dcea04e |
|
BLAKE2b-256 | 4b74e8cfcea92913a04d71c459b237659fe7060d1f974a475cb2b03668b34f0f |
Close
Hashes for routrie-0.1.2-pp38-pypy38_pp73-macosx_10_9_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | c1a719bcd5921fae3d1ca52230a0aaf749a3f596c2b1cb53b2b83b03e849932b |
|
MD5 | 9ac5f2a0ac929f9f684e543746ce64f1 |
|
BLAKE2b-256 | b282489d529d16f61f5e3edf0b1e052d69f39311e13436a3bb56e254adc3dcb3 |
Close
Hashes for routrie-0.1.2-pp37-pypy37_pp73-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 85005d38071de0325a596921986f1a62e9ecf67c99429412f2004feb907f26ec |
|
MD5 | 7014f7ddbbb1c76f339c01f026442c99 |
|
BLAKE2b-256 | 3c6d59c4174559ecbd77ad4c006ebfe3bef2986d70fae6173af3908c028a9817 |
Close
Hashes for routrie-0.1.2-pp37-pypy37_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 13d75c41fed34fb04d0cc4045ddd10361702595332995ae71c736d5bed254113 |
|
MD5 | aaf00c0288b45183d3eebeb0b824359d |
|
BLAKE2b-256 | cb9cb150870d4b92e60aa7f2994e4463472f2438c768f8c01d8c6320a809c1a8 |
Close
Hashes for routrie-0.1.2-pp37-pypy37_pp73-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | aaf16fb5dd608e6abc4936efd7218687e34766116caa98ac973390ce7e7e4f97 |
|
MD5 | 48de60e2f4ac81d62facfa07c1dd8bda |
|
BLAKE2b-256 | 6dbae013be1ba985ed36abe9607e108210893c34a8fc4cf217763ae9e2f9f0d1 |
Close
Hashes for routrie-0.1.2-pp37-pypy37_pp73-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 92985202d4f4373886b993ac390a6b56eb69153e68d9196324c779de4f989448 |
|
MD5 | 0220db86ebdefd0e6b1e0e51766098b8 |
|
BLAKE2b-256 | 615576f1be22bfab2ab148abcb5804a934662bda6dce366aad4e27acc9312cdb |
Close
Hashes for routrie-0.1.2-pp37-pypy37_pp73-macosx_10_9_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 85aa36f4da7ae7296d74453c9f853dd0e37858a6816343b438bf97c95c62b24c |
|
MD5 | 9d631b11d5e3635119c466d1f98866ce |
|
BLAKE2b-256 | 82b562f5cbf97d09a1a55a9bc55a746ed8281476921ae1f63a1c12577456c86b |
Close
Hashes for routrie-0.1.2-cp37-abi3-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | ccfb397295578040a966de674e235883a4ac316b44a53c4f87de57293a05e84a |
|
MD5 | 6c2989a527b2da105a39217d78df7c5a |
|
BLAKE2b-256 | 3b8a73374e5060f189cbf60bbdd9e4f2e4269409b99416c03bb3b193f0b012fc |
Close
Hashes for routrie-0.1.2-cp37-abi3-musllinux_1_1_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | aaa83f34d686358d7948addcf5aa144b85cf27cb771964f91fef89b0f5c6fdc3 |
|
MD5 | 1b8736b233aeb35a962d0b3280065c79 |
|
BLAKE2b-256 | 1df6ff4099880e667e1fa5575fd796fcbd40b8ed5cf13b3152cadebbd590d485 |
Close
Hashes for routrie-0.1.2-cp37-abi3-musllinux_1_1_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | eb549b767797ccb58fde9f811d0b6206541b96df15e375d288c7542d39fda380 |
|
MD5 | e76923502062568bd4957cf737e2f8d7 |
|
BLAKE2b-256 | 09c7c5a8d93f5a7128966fbbbff838c5cece11b99c41712893e6b0a84126c8d6 |
Close
Hashes for routrie-0.1.2-cp37-abi3-musllinux_1_1_aarch64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 25f31b4d3b27f2ec6588cd78578dd8d25db192995ee1201ab78c4934821cfdb5 |
|
MD5 | 439d2d7b4075ba872a889f67cdab0ad9 |
|
BLAKE2b-256 | 15592530d11da18a99e3190032bc84fb955475e69799c4bd12edce35cd36aaff |
Close
Hashes for routrie-0.1.2-cp37-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 432355bfb676ebfc425693b30006c6724b9f961c45876ea498a1b577fbcfcf50 |
|
MD5 | 79d09cd338410c67ce80129fe5dcb8cb |
|
BLAKE2b-256 | be7f3415c355aab98b62e282c6092afb3b5591f3dd9a5ce999d6d69d50b95039 |
Close
Hashes for routrie-0.1.2-cp37-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | b91950870c97064778c6fa1094ee73e0abe6a6902014ee32b66bcea518940e4f |
|
MD5 | 4478834b662ac85cd0160a16b52f32ec |
|
BLAKE2b-256 | 850d92f81bfd4179a15e904e5ff69ea8325402aae219547b94aa9c98b2677b10 |
Close
Hashes for routrie-0.1.2-cp37-abi3-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 9377144a452b6ee836b93d23fb53d1c18267772ed6f5af1f4b28ff018b760986 |
|
MD5 | faa5dd62f97a6e6bfb51fa865816a292 |
|
BLAKE2b-256 | 623aca55eaa4ca0c919ff53eb66628fd8b0646da7e63f249981c2fb28aa7d45d |
Close
Hashes for routrie-0.1.2-cp37-abi3-macosx_10_9_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | cb74fe5584095c9abfa77ac392eb16aff8141498f8e9cb01bddf10ce40bcb795 |
|
MD5 | db070883d7bce918bf5d4a6acd2ca9f9 |
|
BLAKE2b-256 | e5c15f428d53b2c144e9457ec3c5144e3cb5b04b69b1e1f0d9588e4719ea3cae |