{"categories":[{"label":"Application Frameworks","url":"https://skillfed.io/packages/category/software-development-libraries-application-frameworks/2"}],"enrichment":{"capability":"Sanic-routing is a low-level AST-style router that compiles URL path patterns into optimized lookup code, used internally by the Sanic web framework for request routing and signal dispatch.","skillfed_tags":["routing-engine","ast-compilation","sanic-internal"],"use_cases":["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."],"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.\n\nThis is a low-level component designed to be subclassed for specific use cases\u2014Sanic 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.","worth_installing":"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."},"id":"sanic-routing","links":{"html":"https://skillfed.io/packages/sanic-routing","md":"https://skillfed.io/packages/sanic-routing.md","pypi":"https://pypi.org/project/sanic-routing/"},"maintenance":{"status":"dormant"},"meta":{"latest_release":"2023-12-31","license_spdx":null,"license_treatment":"permissive","name":"sanic-routing","python_support":"unspecified","summary":"Core routing component for Sanic"},"popularity":{"monthly_downloads":1525817,"position":3814,"tier":"top_5000"},"security":{"n_vulnerabilities":0},"version":"23.12.0"}
