{"id":16543177,"url":"https://github.com/aminalaee/fastapi-extended-route","last_synced_at":"2026-04-20T19:31:54.877Z","repository":{"id":45244707,"uuid":"513423301","full_name":"aminalaee/fastapi-extended-route","owner":"aminalaee","description":"Flask style url_for for FastAPI","archived":false,"fork":false,"pushed_at":"2022-07-24T11:30:52.000Z","size":11,"stargazers_count":1,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-10-11T04:21:36.303Z","etag":null,"topics":["asgi","fastapi"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/aminalaee.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2022-07-13T07:30:42.000Z","updated_at":"2023-10-06T10:06:27.000Z","dependencies_parsed_at":"2022-09-09T22:50:21.364Z","dependency_job_id":null,"html_url":"https://github.com/aminalaee/fastapi-extended-route","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/aminalaee/fastapi-extended-route","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aminalaee%2Ffastapi-extended-route","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aminalaee%2Ffastapi-extended-route/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aminalaee%2Ffastapi-extended-route/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aminalaee%2Ffastapi-extended-route/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/aminalaee","download_url":"https://codeload.github.com/aminalaee/fastapi-extended-route/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aminalaee%2Ffastapi-extended-route/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32062309,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-20T11:35:06.609Z","status":"ssl_error","status_checked_at":"2026-04-20T11:34:48.899Z","response_time":94,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["asgi","fastapi"],"created_at":"2024-10-11T18:59:33.795Z","updated_at":"2026-04-20T19:31:54.860Z","avatar_url":"https://github.com/aminalaee.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Opinionated FastAPI Extended Route\n\nA small utility for FastAPI/Starlette Route and Request to address the following:\n\n- `Request.url_for` doesn't allow adding `query parameters` at the moment.\n- `URL` objects can't have multiple keys like `/?key=value\u0026key=anothervalue`.\n\nWith the following changes:\n\n- Make `Request.url_for` to match path parameters and use unmatched params for query parameters.\n- Provide a custom `Route` which has a new `Request` type.\n- Allow `URL` object to add multiple keys in `query params`.\n- ...\n\nExample:\n\n```python\nfrom fastapi import FastAPI\nfrom fastapi.responses import PlainTextResponse\n\nfrom fastapi_extended_route import Request, Route\n\ndef index(request: Request) -\u003e PlainTextResponse:\n    url = request.url_for(\"index\", key=value)\n    # url == \"http://testserver/?key=value\"\n    return PlainTextResponse(url)\n\napp = FastAPI(\n    routes=[Route(\"/\", index, name=\"index\")],\n)\n```\n\nAs you can see the only change is to use `Route` from the package and\nthe new `Request` object will have a customized `url_for` method which\nhandles both path parameters and query parameters.\n\nIf/when these options are available in Starlette/FastAPI, this is no longer needed.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Faminalaee%2Ffastapi-extended-route","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Faminalaee%2Ffastapi-extended-route","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Faminalaee%2Ffastapi-extended-route/lists"}