Comparison
asgi-csrf vs fastapi-csrf-protect vs starlette-csrf
Maintenance, adoption and momentum side by side, from PyPI, GitHub and deps.dev data refreshed every day.
ASGI middleware for protecting against CSRF attacks
Slowing down. Last release over 2 years ago, little activity since. Fine for existing code; think twice for a new project.
pip install asgi-csrfStateless implementation of Cross-Site Request Forgery (XSRF) Protection by using Double Submit Cookie mitigation pattern
Low maintenance activity. Last release 15 months ago. Weaker on recent releases and release cadence.
pip install fastapi-csrf-protectStarlette middleware implementing Double Submit Cookie technique to mitigate CSRF
Slowing down. Last release over 3 years ago, little activity since. Fine for existing code; think twice for a new project.
pip install starlette-csrfIn short
- asgi-csrf is slowing down (last release over 2 years ago): fine for existing code, risky for a new project.
- starlette-csrf is slowing down (last release over 3 years ago): fine for existing code, risky for a new project.
- fastapi-csrf-protect is the most used: 149.4K downloads a month.
- fastapi-csrf-protect also has the best Pythie’s Index (37).
Side by side
| Metric | asgi-csrf | fastapi-csrf-protect | starlette-csrf |
|---|---|---|---|
| Pythie’s Index | Pythie’s Index: 15 | 37 |