Faster FastAPI start-up time for Projects with many nested routers
Reason this release was yanked:
Not functioning
Project description
fastapi-deferring-init
WARNING: This is the very first draft of this project and might not work at all. I only published it to test it in bigger projects of mine.
The Problem
When using nested routers in a FastAPI project its start-up time can get long quite fast. That 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 gets used.
The Solution
This library provides a modified APIRoute that defers the calculation of values to the first actual attribute access. This also applies to the top-level router, which means that the route is only fully initialized when an API Endpoint is accessed the first time. Utilities for quickly monkey-patching an existing FastAPI application are also provided.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Hashes for fastapi_deferred_init-0.1.0.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 866062af5e79345a0c8e4443173bcc94205cd08cdd7a5aaff0a3f405bb4b8551 |
|
MD5 | 2cd750bfb6b581a02d4bc9123dbaea2f |
|
BLAKE2b-256 | ec2cf29f91fdd84d779d06a6edf778864937c74bbb319ff16bb8d83b51ed78df |
Hashes for fastapi_deferred_init-0.1.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | b5ffea9171f520fb69f7779018f8e28d2f49437425bbab1abb466674340d260b |
|
MD5 | a26400effbf6cfd7d3cf50a38a93db19 |
|
BLAKE2b-256 | 64be69a8a2c436c11e5ab11fb60a71300450020235a6a9b2d289d2910e43e067 |