{"id":16966123,"url":"https://github.com/jvllmr/fastapi-deferred-init","last_synced_at":"2026-02-09T12:17:08.562Z","repository":{"id":202824372,"uuid":"708210171","full_name":"jvllmr/fastapi-deferred-init","owner":"jvllmr","description":"Improve start-up time for FastAPI apps with many nested routers","archived":false,"fork":false,"pushed_at":"2025-04-01T06:11:27.000Z","size":298,"stargazers_count":0,"open_issues_count":2,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-04-01T07:24:08.388Z","etag":null,"topics":["fastapi","speedup"],"latest_commit_sha":null,"homepage":"https://jvllmr.github.io/fastapi-deferred-init/dev/bench/","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/jvllmr.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-10-21T21:18:41.000Z","updated_at":"2025-04-01T06:07:48.000Z","dependencies_parsed_at":null,"dependency_job_id":"7369022e-e211-45b1-b4d1-0f64f9d72d3e","html_url":"https://github.com/jvllmr/fastapi-deferred-init","commit_stats":{"total_commits":72,"total_committers":3,"mean_commits":24.0,"dds":"0.20833333333333337","last_synced_commit":"969d3a639036b9e6226c470300ab055e5e50b47a"},"previous_names":["jvllmr/fastapi-deferred-init"],"tags_count":10,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jvllmr%2Ffastapi-deferred-init","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jvllmr%2Ffastapi-deferred-init/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jvllmr%2Ffastapi-deferred-init/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jvllmr%2Ffastapi-deferred-init/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jvllmr","download_url":"https://codeload.github.com/jvllmr/fastapi-deferred-init/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248493604,"owners_count":21113288,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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":["fastapi","speedup"],"created_at":"2024-10-14T00:04:41.221Z","updated_at":"2026-02-09T12:17:08.454Z","avatar_url":"https://github.com/jvllmr.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# fastapi-deferred-init\n\n![PyPI - Downloads](https://img.shields.io/pypi/dd/fastapi-deferred-init)\n[![GitHub license](https://img.shields.io/github/license/jvllmr/fastapi-deferred-init)](https://github.com/jvllmr/fastapi-deferred-init/blob/master/LICENSE)\n![Tests](https://github.com/jvllmr/fastapi-deferred-init/actions/workflows/test.yml/badge.svg)\n\n## The Problem\n\nWhen using nested routers in a FastAPI project its start-up time can get long quite fast.\nThat is because every router re-calculates the routes defined by a nested router when including it and the pre-calculated values by the nested router never get used. In short: values in nested routers are calculated although they will never be used.\n\n## The Solution\n\nThis library provides a modified APIRoute that defers the calculation of values to the first actual attribute access. A router which uses the route as a default is also provided.\n\n## Caveat\n\nWhen using the deferred APIRoute on every layer of the app, startup errors are deferred to the first time a route is called. So errors related to route registration might go undetected if the route is not tested at least once.\n\n## Pull Request\n\nI created a pull request to merge this change back into FastAPI: https://github.com/tiangolo/fastapi/pull/10589\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjvllmr%2Ffastapi-deferred-init","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjvllmr%2Ffastapi-deferred-init","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjvllmr%2Ffastapi-deferred-init/lists"}