This is a report describing the variety of Python libraries used with FastAPI in open source projects. The repositories were sourced using GitHub code search. I analyzed requirements.txt files as the most common source of dependencies. The report includes popular packages, FastAPI versions and dependency clusters.
You can use the report to explore new libraries or pick a dependency between a few options. If you want to discover how exactly a library is used with FastAPI, use GitHub code search: fastapi {package_name} filename:requirements.txt
All repositories
This table could include any package specified in a requirements.txt file. Some packages could be depend on others, but still redundantly (or not) specified in requirements files.
The full list formatted with one library on each row.
FastAPI versions
0.10.1: 2 | 0.10.2: 1 | 0.11.0: 1 |
0.12.1: 1 | 0.13.0: 3 | 0.2.0: 1 |
0.20.0: 4 | 0.27.0: 1 | 0.28.0: 1 |
0.29.0: 4 | 0.29.1: 3 | 0.30.0: 2 |
0.31.0: 2 | 0.33.0: 14 | 0.35.0: 12 |
0.38.1: 18 | 0.39.0: 3 | 0.42.0: 23 |
0.43.0: 2 | 0.44.0: 12 | 0.44.1: 9 |
0.45.0: 27 | 0.46.0: 10 | 0.47: 2 |
0.47.0: 1 | 0.47.1: 53 | 0.48.0: 15 |
0.49.0: 13 | 0.49.2: 1 | 0.5.4: 1 |
0.50.0: 1 | 0.51.0: 2 | 0.52.0: 73 |
0.53: 1 | 0.53.0: 7 | 0.53.1: 5 |
0.53.2: 18 | 0.54: 3 | 0.54.0: 12 |
0.54.1: 78 | 0.54.2: 17 | 0.55: 1 |
0.55.0: 2 | 0.55.1: 31 | 0.56.0: 2 |
0.56.1: 1 | 0.57.0: 5 | 0.58: 1 |
0.58.0: 26 | 0.58.1: 39 | 0.59: 1 |
0.59.0: 23 | 0.6.1: 1 | 0.60: 1 |
0.60.0: 12 | 0.60.00: 1 | 0.60.1: 57 |
0.60.2: 7 | 0.61: 1 | 0.61.0: 41 |
0.61.1: 406 | 0.61.2: 228 | 0.62.0: 301 |
0.63: 7 | 0.63.0: 1569 | 0.64: 1 |
0.64.0: 56 | 0.65: 4 | 0.65.0: 32 |
0.65.1: 535 | 0.65.2: 616 | 0.65.3: 19 |
0.66: 2 | 0.66.0: 238 | 0.66.1: 25 |
0.67.0: 23 | 0.68.0: 8 | 0.8.0: 2 |
Clusters
For a few selected packages I collected libraries that developers commonly use together with the source package. The percent is calculated as the number of intersections in requirements.txt files between source and target packages divided by number of occurrences of the target package.
pip-compile files
Some of the projects had their requirements composed with pip-compile. I decided to analyze such files separately: this way I get to group dependencies on direct and indirect (dependencies of other dependencies).
Direct dependencies
Library | Occurrences |
---|---|
Total repositories | 95 |
fastapi | 95 |
uvicorn | 72 |
pydantic | 69 |
starlette | 66 |
typing-extensions | 59 |
click | 51 |
h11 | 46 |
certifi | 46 |
python-dotenv | 40 |
six | 39 |
urllib3 | 39 |
idna | 34 |
requests | 30 |
pyyaml | 28 |
chardet | 26 |
gunicorn | 25 |
python-multipart | 25 |
websockets | 24 |
uvloop | 23 |
sqlalchemy | 22 |
httptools | 21 |
cffi | 21 |
pycparser | 21 |
markupsafe | 20 |
attrs | 20 |
Indirect dependencies
Library | Occurrences |
---|---|
Total repositories | 95 |
fastapi | 95 |
pydantic | 95 |
starlette | 95 |
click | 74 |
h11 | 73 |
uvicorn | 72 |
typing-extensions | 68 |
certifi | 65 |
six | 62 |
urllib3 | 59 |
idna | 55 |
chardet | 46 |
python-dotenv | 43 |
requests | 42 |
websockets | 42 |
httptools | 40 |
uvloop | 40 |
pyyaml | 36 |
attrs | 35 |
python-dateutil | 32 |
cffi | 32 |
pycparser | 32 |
markupsafe | 30 |
python-multipart | 27 |
gunicorn | 25 |
FastAPI versions
Notes
Did you know the specification for a line in requirements.txt goes much further than the common usage? From PEP 808:
All features of the language shown with a name based lookup:
requests [security,tests] >= 2.8.1, == 2.8.* ; python_version < "2.7"
GitHub Search API allows to extract only first 1,000 results for each search query, so I had to get creative with file size qualifier to iterate over all results:
Query 1: fastapi filename:requirements.txt size:1..16
Query 2: fastapi filename:{filename} size:17..32
etc.