$npx skillfedfor your agent

sanic-routing

Core routing component for Sanic

SkipPyPI Application FrameworksReleased Dec 20231.5M downloads / moMITPure Python

Decision gist · record as of 2026-08-14

pure-Python wheel — sanic_routing-23.12.0-py3-none-any.whl
v23.12.0 · released 2023-12-31

No, unless you are extending Sanic's routing internals or building a custom router from scratch. This package is a low-level component intended for framework developers, not application developers. Sanic users should install Sanic itself, which includes this package as a dependency. The dormant maintenance status (last update 2023-12-31) and lack of active development make it unsuitable for new external projects.AI-flagged interpretation of the facts on this page — verify before relying

Before you install

  • Requires subclassing BaseRouter; the router must be finalized before use.
  • Not intended for direct end-user application.
  • Low install friction with no runtime dependencies.

License · maintenance · safety

MIT (permissive) — MIT license (permissive) places no restrictions on use, modification, or distribution. Safe for commercial and proprietary projects.

last release 2023-12-31 (957 days) · last repo commit 2023-12-31 · 16 stars

0 known vulnerabilities (OSV.dev, 2026-08-14) · 1,525,817 downloads/mo, #3,814 on PyPI

Verify before relying

from sanic_routing import BaseRouter

class Router(BaseRouter):
    def get(self, path, *args, **kwargs):
        return self.resolve(path, *args, **kwargs)

router = Router()
router.add("/", lambda: ...)
router.finalize()
route, handler, params = router.get("/", method="BASE", extra=None)
  • Whether external projects commonly depend on this package or if it is primarily used as an internal Sanic dependency.
  • Performance characteristics and scalability limits for large route sets.
  • Compatibility with Python versions beyond 3.10 (classifiers list 3.7–3.10 only).
Same gist for agents: .md · .json

What it is and what it does

Sanic-routing is a specialized routing library that takes URL path patterns and compiles them into an optimized abstract syntax tree (AST), then generates executable Python code to match incoming requests. It handles three types of routes: fully static paths (matched via key/value lookup), dynamic paths with typed parameters (like `<id:int>`), and regex-based paths including the special `<foo:path>` type that can span multiple path segments. The router groups similar routes together, arranges them into a hierarchical tree of nodes, and generates a single `find_route` function that efficiently dispatches requests without iterating through a list.

This is a low-level component designed to be subclassed for specific use cases—Sanic itself uses it for both HTTP request routing and signal routing. Most Sanic users never interact with it directly; it is embedded in the framework. External projects that need custom routing logic or want to understand how Sanic's routing works internally may subclass `BaseRouter` and customize the resolution behavior.

Use it for

  • Build a custom HTTP router for a web framework by subclassing BaseRouter and defining a get() method.
  • Understand how Sanic compiles URL patterns into optimized dispatch code by inspecting router.find_route_src.
  • Implement event or signal routing with dynamic parameter extraction using the same AST-based tree structure.
  • Benchmark or profile route matching performance by generating and analyzing the compiled routing function.
  • Extend Sanic's routing behavior for specialized path-matching rules beyond standard HTTP routing.

Worth the install?

AI-flagged interpretation of the facts on this page. Verify before relying on it.

Skip

No, unless you are extending Sanic's routing internals or building a custom router from scratch.

This package is a low-level component intended for framework developers, not application developers. Sanic users should install Sanic itself, which includes this package as a dependency. The dormant maintenance status (last update 2023-12-31) and lack of active development make it unsuitable for new external projects.

Install

sanic-routing on PyPI

Before you install

Low install friction with no runtime dependencies. Maintenance is dormant—last release was 2023-12-31 and the repository has not been updated since, though it remains unarchived. Suitable for stable, embedded use within Sanic itself, but external adoption should expect no active development.

Requires subclassing BaseRouter; the router must be finalized before use. Not intended for direct end-user application.

License in practice

MIT license (permissive) places no restrictions on use, modification, or distribution. Safe for commercial and proprietary projects.

Quickstart

from sanic_routing import BaseRouter

class Router(BaseRouter):
    def get(self, path, *args, **kwargs):
        return self.resolve(path, *args, **kwargs)

router = Router()
router.add("/", lambda: ...)
router.finalize()
route, handler, params = router.get("/", method="BASE", extra=None)

Verify before relying

  • Whether external projects commonly depend on this package or if it is primarily used as an internal Sanic dependency.
  • Performance characteristics and scalability limits for large route sets.
  • Compatibility with Python versions beyond 3.10 (classifiers list 3.7–3.10 only).

Package facts

LicenseMIT permissive
Python supportNot specified
Install frictionLow. Pure-Python wheel
Runtime dependenciesNone
MaintenanceDormant 957 days since the last release
Last repo commit
First released
Downloads1,525,817 / month, #3,814 on PyPI 30-day window, as of 2026-08-14
Known vulnerabilitiesNone known OSV.dev, checked 2026-08-14
Classifiers
Development Status :: 4 - BetaEnvironment :: Web EnvironmentLicense :: OSI Approved :: MIT LicenseProgramming Language :: Python :: 3.10Programming Language :: Python :: 3.7Programming Language :: Python :: 3.8Programming Language :: Python :: 3.9

Evidence: sanic_routing-23.12.0-py3-none-any.whl

Tags

Capabilities
URL path routing compilerAST-based route matchingdynamic path parameter routingHTTP request routing libraryroute tree compilationregex and static path routingSanic framework routing
Topics
routing-engineast-compilationsanic-internal

Let your AI agent find packages like this

Example. Real query, live index.

You found this page by searching. An agent finds it by wishing: SkillFed indexes 14,416 PyPI packages by what they can do, searchable in plain language.

wish › “URL path routing compiler”

  • sanic-routingSanic-routing is a low-level AST-style router that compiles URL path…
  • repathConverts Express-style path strings (like `/user/:name`) into regular…
  • zope.traversingResolves object paths by traversing an object hierarchy and computing…

Give your agent the search over MCP, or paste the wish link into any chat.

More Application Frameworks packages

fastapi Worth it
PyPI · Software Development · released Jul 2026

FastAPI is a Python web framework for building REST APIs using type hints, with automatic request validation, serialization, and interactive API documentation.

MITpure Python · 3.10+
568.6Mdownloads / mo
annotated-doc With conditions
PyPI · Software Development · released Jul 2026

Provides a way to document function parameters, class attributes, return types, and variables inline using Python's `Annotated` type hint syntax instead of traditional docstrings.

MITpure Python · 3.9+
456.2Mdownloads / mo
textual Worth it
PyPI · Application Frameworks · released Jun 2026

Textual is a Python framework for building cross-platform user interfaces that run in the terminal or web browser using a modern, component-based API.

Install it if you're developing CLI tools, dashboards, or interactive terminal applications.

MITpure Python
443.6Mdownloads / mo
typer Worth it
PyPI · Software Development · released Aug 2026

Typer builds command-line applications from Python functions using type hints, automatically generating help text, argument parsing, and shell completion.

Install it if you are building CLIs in Python.

MITpure Python · 3.10+
369.3Mdownloads / mo
mcp Worth it
PyPI · Application Frameworks · released Jul 2026

Build and connect to Model Context Protocol servers that expose tools, resources, and prompts to LLM applications over stdio, HTTP, or SSE transports.

Install it if you need to build or connect to servers.

MITpure Python · 3.10+
319.3Mdownloads / mo
Werkzeug Worth it
PyPI · Application Frameworks · released Apr 2026

Werkzeug is a WSGI utility library providing request/response objects, URL routing, an interactive debugger, HTTP utilities, and a development server for building web applications.

BSD-3-Clausepure Python · 3.9+
268.1Mdownloads / mo

See also repath · aiohttp-fast-url-dispatcher · trame-router · sglang-router · semantic-router · Sanic-Cors · sanic-ext · jupyter-ai-router · sanic · nab-index