Skip to main content

Python wrapper for https://github.com/viz-rs/path-tree

Project description

routrie

CI

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(
  {
    "/users": 1,
    "/users/:id": 2,
    "/user/repo/*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

  1. Clone the repo.
  2. Run make init
  3. Run make test
  4. Make your changes
  5. Push and open a pull request
  6. 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


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.8.0.tar.gz (9.7 kB view details)

Uploaded Source

Built Distributions

routrie-0.8.0-pp39-pypy39_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (207.4 kB view details)

Uploaded PyPy manylinux: glibc 2.17+ x86-64

routrie-0.8.0-pp39-pypy39_pp73-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (193.8 kB view details)

Uploaded PyPy manylinux: glibc 2.17+ ARM64

routrie-0.8.0-pp39-pypy39_pp73-macosx_10_7_x86_64.whl (188.9 kB view details)

Uploaded PyPy macOS 10.7+ x86-64

routrie-0.8.0-pp38-pypy38_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (207.1 kB view details)

Uploaded PyPy manylinux: glibc 2.17+ x86-64

routrie-0.8.0-pp38-pypy38_pp73-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (193.7 kB view details)

Uploaded PyPy manylinux: glibc 2.17+ ARM64

routrie-0.8.0-pp38-pypy38_pp73-macosx_10_7_x86_64.whl (188.8 kB view details)

Uploaded PyPy macOS 10.7+ x86-64

routrie-0.8.0-pp37-pypy37_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (209.5 kB view details)

Uploaded PyPy manylinux: glibc 2.17+ x86-64

routrie-0.8.0-pp37-pypy37_pp73-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (195.8 kB view details)

Uploaded PyPy manylinux: glibc 2.17+ ARM64

routrie-0.8.0-pp37-pypy37_pp73-macosx_10_7_x86_64.whl (190.7 kB view details)

Uploaded PyPy macOS 10.7+ x86-64

routrie-0.8.0-cp37-abi3-win_amd64.whl (135.5 kB view details)

Uploaded CPython 3.7+ Windows x86-64

routrie-0.8.0-cp37-abi3-win32.whl (131.1 kB view details)

Uploaded CPython 3.7+ Windows x86

routrie-0.8.0-cp37-abi3-musllinux_1_2_x86_64.whl (377.6 kB view details)

Uploaded CPython 3.7+ musllinux: musl 1.2+ x86-64

routrie-0.8.0-cp37-abi3-musllinux_1_2_i686.whl (402.1 kB view details)

Uploaded CPython 3.7+ musllinux: musl 1.2+ i686

routrie-0.8.0-cp37-abi3-musllinux_1_2_armv7l.whl (458.5 kB view details)

Uploaded CPython 3.7+ musllinux: musl 1.2+ ARMv7l

routrie-0.8.0-cp37-abi3-musllinux_1_2_aarch64.whl (374.4 kB view details)

Uploaded CPython 3.7+ musllinux: musl 1.2+ ARM64

routrie-0.8.0-cp37-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (206.4 kB view details)

Uploaded CPython 3.7+ manylinux: glibc 2.17+ x86-64

routrie-0.8.0-cp37-abi3-manylinux_2_17_s390x.manylinux2014_s390x.whl (260.1 kB view details)

Uploaded CPython 3.7+ manylinux: glibc 2.17+ s390x

routrie-0.8.0-cp37-abi3-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl (295.1 kB view details)

Uploaded CPython 3.7+ manylinux: glibc 2.17+ ppc64le

routrie-0.8.0-cp37-abi3-manylinux_2_17_ppc64.manylinux2014_ppc64.whl (303.4 kB view details)

Uploaded CPython 3.7+ manylinux: glibc 2.17+ ppc64

routrie-0.8.0-cp37-abi3-manylinux_2_17_armv7l.manylinux2014_armv7l.whl (195.4 kB view details)

Uploaded CPython 3.7+ manylinux: glibc 2.17+ ARMv7l

routrie-0.8.0-cp37-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (192.8 kB view details)

Uploaded CPython 3.7+ manylinux: glibc 2.17+ ARM64

routrie-0.8.0-cp37-abi3-manylinux_2_5_i686.manylinux1_i686.whl (228.8 kB view details)

Uploaded CPython 3.7+ manylinux: glibc 2.5+ i686

routrie-0.8.0-cp37-abi3-macosx_10_9_x86_64.macosx_11_0_arm64.macosx_10_9_universal2.whl (362.3 kB view details)

Uploaded CPython 3.7+ macOS 10.9+ universal2 (ARM64, x86-64) macOS 10.9+ x86-64 macOS 11.0+ ARM64

routrie-0.8.0-cp37-abi3-macosx_10_7_x86_64.whl (188.2 kB view details)

Uploaded CPython 3.7+ macOS 10.7+ x86-64

File details

Details for the file routrie-0.8.0.tar.gz.

File metadata

  • Download URL: routrie-0.8.0.tar.gz
  • Upload date:
  • Size: 9.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.10.7

File hashes

Hashes for routrie-0.8.0.tar.gz
Algorithm Hash digest
SHA256 4b9f1ae625e5febaab629ff57260889c1ea0ce6535faeab5a5415d4caae8fb8a
MD5 87571f6eb248e23d159b0211b13cff81
BLAKE2b-256 7197f2e19968e3876dd4b8807b0e8e6e847241c146dee8a487f615ffec233356

See more details on using hashes here.

Provenance

File details

Details for the file routrie-0.8.0-pp39-pypy39_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for routrie-0.8.0-pp39-pypy39_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 a2d84be5c36d4a10545ed3a6929882d36e7774f4447c1e94984146b85ec0d5f7
MD5 c7d23f117cfd7ade7d418530d4d7f6ce
BLAKE2b-256 44b922778e83f89b73786c07c30fed8547268b3726d35b34b6506b288e658d3d

See more details on using hashes here.

Provenance

File details

Details for the file routrie-0.8.0-pp39-pypy39_pp73-manylinux_2_17_aarch64.manylinux2014_aarch64.whl.

File metadata

File hashes

Hashes for routrie-0.8.0-pp39-pypy39_pp73-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 4f0cf84c193681ff594c0e78a0e8270137ac2476391d0a0c3498a5fbcaabcc1f
MD5 0dd0bb8f262c1e97fd7723355587c1d8
BLAKE2b-256 bab918cd47dffb91dfeb2ebf53b3e86f3b5bd03e85d5c86fbaa3eac0ad0a3bd6

See more details on using hashes here.

Provenance

File details

Details for the file routrie-0.8.0-pp39-pypy39_pp73-macosx_10_7_x86_64.whl.

File metadata

File hashes

Hashes for routrie-0.8.0-pp39-pypy39_pp73-macosx_10_7_x86_64.whl
Algorithm Hash digest
SHA256 1548c13d776a6d1fc2ef23db68ba4615a83e0ddb57287fb5919fdd5b16189462
MD5 e98d2fe02b102d26c060ccf809b8c589
BLAKE2b-256 0ad3d04f95206b276c71ce0ba19880058789c6590138b6c44a27e49cbf267420

See more details on using hashes here.

Provenance

File details

Details for the file routrie-0.8.0-pp38-pypy38_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for routrie-0.8.0-pp38-pypy38_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 2a8d4ba86aadb55562530d27338cbd2ab30e75347a0677968f83a3ca4fdf1fd0
MD5 4ddd7222650730fcede159794645f4ae
BLAKE2b-256 2455ad5e8e7d39b5ea853f246c724f9c86f0ac33be2d85e2c7a63e7ea8c15447

See more details on using hashes here.

Provenance

File details

Details for the file routrie-0.8.0-pp38-pypy38_pp73-manylinux_2_17_aarch64.manylinux2014_aarch64.whl.

File metadata

File hashes

Hashes for routrie-0.8.0-pp38-pypy38_pp73-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 e367f1674985bd56f93d313028d451be5de432afbaad9fbc1b0e5d249a2a01a8
MD5 49a2f4a563ab5056ea694823ec68445d
BLAKE2b-256 7699fb9029af15ff5534e60f01227b6c673b1d67bb01851f8efb157bc75210ba

See more details on using hashes here.

Provenance

File details

Details for the file routrie-0.8.0-pp38-pypy38_pp73-macosx_10_7_x86_64.whl.

File metadata

File hashes

Hashes for routrie-0.8.0-pp38-pypy38_pp73-macosx_10_7_x86_64.whl
Algorithm Hash digest
SHA256 8fda9b5f90b437209379ae542072a799a5f8c465e4af10c9aefe34bac8c95529
MD5 bfebeee4bff89640d5a50b75334b228f
BLAKE2b-256 a5705954e3bf27a6dddc5fc79ae63070f23e7ec7b7e5704d46bbd01a004d6af6

See more details on using hashes here.

Provenance

File details

Details for the file routrie-0.8.0-pp37-pypy37_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for routrie-0.8.0-pp37-pypy37_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 8593bef060e1f4c18c621bd8cc52e510bcc03d075b9888fc437c3de87db0b463
MD5 bd9251119eb4312cbcc9ac7ed2a769b4
BLAKE2b-256 52ab7222a8aa0a2d90026cc0910157117c361ebabc8175a96247bb3d779f223a

See more details on using hashes here.

Provenance

File details

Details for the file routrie-0.8.0-pp37-pypy37_pp73-manylinux_2_17_aarch64.manylinux2014_aarch64.whl.

File metadata

File hashes

Hashes for routrie-0.8.0-pp37-pypy37_pp73-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 cefa3fc36a06d097a0640338c2e678031c9538fe108fab417b4f78c800f90877
MD5 21eba79b5bb137fdb2716799b8c7a822
BLAKE2b-256 0f26b1bf0987d9a5b67002932a08192cf290d21691cd8c4c0b1fd673848872b3

See more details on using hashes here.

Provenance

File details

Details for the file routrie-0.8.0-pp37-pypy37_pp73-macosx_10_7_x86_64.whl.

File metadata

File hashes

Hashes for routrie-0.8.0-pp37-pypy37_pp73-macosx_10_7_x86_64.whl
Algorithm Hash digest
SHA256 71daf244038fa9f36381cfa1b1349029b64c74518cdfd865f556a4d0b99a2377
MD5 99e1b1fa864d5b209b68949e9f511a79
BLAKE2b-256 b35b30768cc5e9b3ea567d185e3b4d2f73bb60ea41aee865efd432960b19e35f

See more details on using hashes here.

Provenance

File details

Details for the file routrie-0.8.0-cp37-abi3-win_amd64.whl.

File metadata

  • Download URL: routrie-0.8.0-cp37-abi3-win_amd64.whl
  • Upload date:
  • Size: 135.5 kB
  • Tags: CPython 3.7+, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.10.7

File hashes

Hashes for routrie-0.8.0-cp37-abi3-win_amd64.whl
Algorithm Hash digest
SHA256 0d6e3487854e055503ad0ffa3b3de26478ee1f443b7112c7b5464e21291641d3
MD5 299778abf67ae3770fd68d9155405be8
BLAKE2b-256 ea01f9c1c533f06c987dc917a224cbf8d3304d0cd56902e59f1f6c0316e3f780

See more details on using hashes here.

Provenance

File details

Details for the file routrie-0.8.0-cp37-abi3-win32.whl.

File metadata

  • Download URL: routrie-0.8.0-cp37-abi3-win32.whl
  • Upload date:
  • Size: 131.1 kB
  • Tags: CPython 3.7+, Windows x86
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.10.7

File hashes

Hashes for routrie-0.8.0-cp37-abi3-win32.whl
Algorithm Hash digest
SHA256 357082153b125a4db18af83e41baf7de4fdede2ea591f6fce54a5d34850441f0
MD5 860d9e930711a6a4391c92f6133f37c7
BLAKE2b-256 412c1e79e928aad3e545c555da75423ef2f50f3fee169128491ca09da422db1d

See more details on using hashes here.

Provenance

File details

Details for the file routrie-0.8.0-cp37-abi3-musllinux_1_2_x86_64.whl.

File metadata

File hashes

Hashes for routrie-0.8.0-cp37-abi3-musllinux_1_2_x86_64.whl
Algorithm Hash digest
SHA256 dddaf253eb66fea9084ea3cbe430fce99ee1aa97ede785ea8321ac7857de8b5f
MD5 40ad1606f62e024e81ec07751326d7bd
BLAKE2b-256 f6f48d44e4ad61ece19ee08a0e9084fa17f30df8b12895720b8f1d7d41d30169

See more details on using hashes here.

Provenance

File details

Details for the file routrie-0.8.0-cp37-abi3-musllinux_1_2_i686.whl.

File metadata

File hashes

Hashes for routrie-0.8.0-cp37-abi3-musllinux_1_2_i686.whl
Algorithm Hash digest
SHA256 637a2ac1c27d11f315b613156aeb47155625fff59ccb8eacb6ffabbcc213f01b
MD5 6b81249a74226a2c5148062b7e2ab7c1
BLAKE2b-256 66790eb9af3114d376a5f32b9143c6b8b48a08a7b3c085144dfd0ff7ec492bbe

See more details on using hashes here.

Provenance

File details

Details for the file routrie-0.8.0-cp37-abi3-musllinux_1_2_armv7l.whl.

File metadata

File hashes

Hashes for routrie-0.8.0-cp37-abi3-musllinux_1_2_armv7l.whl
Algorithm Hash digest
SHA256 260eae7995a846040c1598cfdceba896f1932a47492f981a9622808dbf160d92
MD5 b93579cea33178aee27eb91b2a35187d
BLAKE2b-256 a7916a427c36bc8a90aad0d45799d5dca1e64a6089ebbce9533dae3b0cde38a2

See more details on using hashes here.

Provenance

File details

Details for the file routrie-0.8.0-cp37-abi3-musllinux_1_2_aarch64.whl.

File metadata

File hashes

Hashes for routrie-0.8.0-cp37-abi3-musllinux_1_2_aarch64.whl
Algorithm Hash digest
SHA256 a79159619007cf068282f3ec864c302aca58e8f4a6ad89538db37124dc11c626
MD5 3c683e1437e58005f7dbcbadddb302a4
BLAKE2b-256 e934eca0e6ee402773684a7dfd32cd2d521eac42f8b6619d4136c409c98dae19

See more details on using hashes here.

Provenance

File details

Details for the file routrie-0.8.0-cp37-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for routrie-0.8.0-cp37-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 98fa15b4f043b2deb9c5bd0749293fa7a63ff16ee14a640d9659c26002fff22b
MD5 e6a3a9ec1f5f5eb5bbf77863dc105726
BLAKE2b-256 04eeda266a9cbc49271958040a6480bf45055d2c1c10d8feecf17fa7ef42e976

See more details on using hashes here.

Provenance

File details

Details for the file routrie-0.8.0-cp37-abi3-manylinux_2_17_s390x.manylinux2014_s390x.whl.

File metadata

File hashes

Hashes for routrie-0.8.0-cp37-abi3-manylinux_2_17_s390x.manylinux2014_s390x.whl
Algorithm Hash digest
SHA256 30674142ca01499513207855a6e10a1a124ebfa1f4df073c90d70070b146e9c8
MD5 6b463cd01a974f1d8cf19d26509f07e6
BLAKE2b-256 eeacb3e51b36ecd0d2e82ece65fe8fa3c8a18a273d5742d87d50aab9a109e85f

See more details on using hashes here.

Provenance

File details

Details for the file routrie-0.8.0-cp37-abi3-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl.

File metadata

File hashes

Hashes for routrie-0.8.0-cp37-abi3-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl
Algorithm Hash digest
SHA256 6c70adcc612a56b030c38814b165d23d979659c8162fcce4cf3ab2958d9f7ab9
MD5 b001939594beab6134bb84df99823362
BLAKE2b-256 5b82508d1f86d7a82f36b9b9122495219e460fe6b24026c24ca0e2a601a34a29

See more details on using hashes here.

Provenance

File details

Details for the file routrie-0.8.0-cp37-abi3-manylinux_2_17_ppc64.manylinux2014_ppc64.whl.

File metadata

File hashes

Hashes for routrie-0.8.0-cp37-abi3-manylinux_2_17_ppc64.manylinux2014_ppc64.whl
Algorithm Hash digest
SHA256 352d53f23b0a60feed9cbda4e5fc1c119622eeb375d89cdd9e8787479a052fb1
MD5 60cc089b7dd75e4b5ad216401eb6903d
BLAKE2b-256 a6734be29700892733823f6bea02a686b9a6ec4b3aea9996af7a76fb52a4019e

See more details on using hashes here.

Provenance

File details

Details for the file routrie-0.8.0-cp37-abi3-manylinux_2_17_armv7l.manylinux2014_armv7l.whl.

File metadata

File hashes

Hashes for routrie-0.8.0-cp37-abi3-manylinux_2_17_armv7l.manylinux2014_armv7l.whl
Algorithm Hash digest
SHA256 eb9f990a6f6e90f686f363b104ba2a7b4698665c164fbcc08da356f4bc3bc746
MD5 9c5840a70b61a8708085e9bfc647edc4
BLAKE2b-256 ddcd18a2a0f58e66d0b898b63422664fb7bd2eba787e558619f46ad69b0705b7

See more details on using hashes here.

Provenance

File details

Details for the file routrie-0.8.0-cp37-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl.

File metadata

File hashes

Hashes for routrie-0.8.0-cp37-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 91c40e0d6d94d6a9c527c3b36b4526204c540b3693c3c0ddb3fc83490a5106c2
MD5 9bafc84021d95f9797dd45bd8f8e63f5
BLAKE2b-256 aad4f6e1f30bb326e433c526ad212f837bf277cb70066e2d913fac27fdff3fbd

See more details on using hashes here.

Provenance

File details

Details for the file routrie-0.8.0-cp37-abi3-manylinux_2_5_i686.manylinux1_i686.whl.

File metadata

File hashes

Hashes for routrie-0.8.0-cp37-abi3-manylinux_2_5_i686.manylinux1_i686.whl
Algorithm Hash digest
SHA256 13c518a3ed9f149db58ff3dc54c8272e923e731cb04a5310a62a51a254acf81d
MD5 f947a1e99ad3d8c3f5755a4e66223e65
BLAKE2b-256 2a2ec6bc3870bb391e4e93741ec551ef3fd98cf7d8440a370026bd8542a5a0c0

See more details on using hashes here.

Provenance

File details

Details for the file routrie-0.8.0-cp37-abi3-macosx_10_9_x86_64.macosx_11_0_arm64.macosx_10_9_universal2.whl.

File metadata

File hashes

Hashes for routrie-0.8.0-cp37-abi3-macosx_10_9_x86_64.macosx_11_0_arm64.macosx_10_9_universal2.whl
Algorithm Hash digest
SHA256 a83ba3f297c73a2bfda25ef8d6611166464797de1ed799804faa4450484c8a56
MD5 dbe51e0ba32a3aaafb9f1db5657b1847
BLAKE2b-256 2d30867454fa57f539fd2e19c9c4c14de5a5460cbfc072cc23d025db6fb4aff6

See more details on using hashes here.

Provenance

File details

Details for the file routrie-0.8.0-cp37-abi3-macosx_10_7_x86_64.whl.

File metadata

File hashes

Hashes for routrie-0.8.0-cp37-abi3-macosx_10_7_x86_64.whl
Algorithm Hash digest
SHA256 03d2bafb93ee461d09a576cc8d036ac926719db73074844f7fc2265a82b25b30
MD5 cdf619b1d3dec7d2ccae0751559f5c1e
BLAKE2b-256 3e168f03389aa791496b51b1d70a65983c8eab2915f990e01f33863e492594a4

See more details on using hashes here.

Provenance

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page