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.1.tar.gz
(18.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.1.tar.gz.
File metadata
- Download URL: fastapi_therapist-0.1.1.tar.gz
- Upload date:
- Size: 18.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 |
0f0cc277800380348a776c75ae91d011e0e31ba80a95e8f73579901409bd0908
|
|
| MD5 |
c906ed9c1e80ac4b682c1c12f8ac6912
|
|
| BLAKE2b-256 |
36aabe90f309080d8acded243dd82c0337684c9627b43f9dbb96511f6df0e723
|
File details
Details for the file fastapi_therapist-0.1.1-py3-none-any.whl.
File metadata
- Download URL: fastapi_therapist-0.1.1-py3-none-any.whl
- Upload date:
- Size: 24.3 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 |
c05173e58ef2f8a2fadad26d2dd9d4fd82f8138744097036b8a8340d8335e317
|
|
| MD5 |
08dc56d907d6aaa73f907eefe1e6289b
|
|
| BLAKE2b-256 |
1c5513dcc49208c1d81f2a1db211332ec20990ffd95fda39923028fee1e164b2
|