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.0.tar.gz
(15.3 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.0.tar.gz.
File metadata
- Download URL: fastapi_therapist-0.1.0.tar.gz
- Upload date:
- Size: 15.3 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 |
cf142a4c8c3bf9ccdf8d072dcce610d2b6c5ed73c287ede5ede93b7573915e45
|
|
| MD5 |
01b95637247ee2063636dc6a7d71c754
|
|
| BLAKE2b-256 |
e3153669d54a69d386ce7921c7e588d3235f8584f451a143ef05131946c592f6
|
File details
Details for the file fastapi_therapist-0.1.0-py3-none-any.whl.
File metadata
- Download URL: fastapi_therapist-0.1.0-py3-none-any.whl
- Upload date:
- Size: 20.2 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 |
a8e3574f04fa5b046a3c2b53f82e4e75eaf77fd9c33b32ee3b847c335251c2f3
|
|
| MD5 |
bf89e6c475940de5f58919d269880a39
|
|
| BLAKE2b-256 |
fcfcf91f6ccab0ddad0ecaf1759ce6d5b578284320738b0a13fa7383bb65b9a3
|