Diagnose FastAPI codebases for best practices
Project description
fastapi-therapist
Diagnose FastAPI codebases for security, performance, correctness, and architecture issues. Outputs a 0–100 health score.
Installation
pip install fastapi-therapist
Usage
# Scan current directory with verbose output
fastapi-therapist . --verbose
# Scan a specific project
fastapi-therapist /path/to/fastapi/project --verbose
# Output only the score (useful for CI)
fastapi-therapist . --score
Rules
Async/Sync Correctness
| Rule | Severity | Detects |
|---|---|---|
| FASTT001 | ERROR | Sync blocking IO (requests.get, time.sleep) in async endpoint |
| FASTT002 | ERROR | Sync SQLAlchemy calls in async endpoint |
| FASTT003 | WARN/ERROR | async def endpoint with no await |
| FASTT004 | ERROR | asyncio.run() inside async context — nested event loop |
| FASTT005 | ERROR | open() blocking file I/O in async endpoint |
| FASTT006 | WARNING | subprocess.run() / os.system() in async endpoint |
Correctness
| Rule | Severity | Detects |
|---|---|---|
| FASTT011 | WARNING | POST/PUT/PATCH/DELETE missing explicit status_code |
Score
The health score formula:
100 - (unique error rules × 1.5) - (unique warning rules × 0.75)
- 75–100 Great
- 50–74 Needs work
- 0–49 Critical
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
fastapi_therapist-0.1.3.tar.gz
(24.6 kB
view details)
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file fastapi_therapist-0.1.3.tar.gz.
File metadata
- Download URL: fastapi_therapist-0.1.3.tar.gz
- Upload date:
- Size: 24.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.11.3 {"installer":{"name":"uv","version":"0.11.3","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
73f258cff77f92a25e66a8c33cf6f736e1f7a41890f9aa3e1b357b6825e1c52b
|
|
| MD5 |
553e87dcdae9e269c523213a53829c0d
|
|
| BLAKE2b-256 |
bb6f451560d21a1ae632540948bcfe7bb584374ea3bec70aff65eedf99540297
|
File details
Details for the file fastapi_therapist-0.1.3-py3-none-any.whl.
File metadata
- Download URL: fastapi_therapist-0.1.3-py3-none-any.whl
- Upload date:
- Size: 28.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.11.3 {"installer":{"name":"uv","version":"0.11.3","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
ff64bb9aa103d6faf5295776ae2b75cc2b10d0481cf2a326cb3ca77c06206fa9
|
|
| MD5 |
e0902153e03d1e37faba51c0deb107d3
|
|
| BLAKE2b-256 |
b8ba625600751bf96dcdfa84f894e8106e0bf2aa37ac9bb12331067f7b752ce6
|