fastapi-radar 0.1.1__tar.gz → 0.1.3__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.

Potentially problematic release.


This version of fastapi-radar might be problematic. Click here for more details.

Files changed (28) hide show
  1. {fastapi_radar-0.1.1/fastapi_radar.egg-info → fastapi_radar-0.1.3}/PKG-INFO +9 -8
  2. {fastapi_radar-0.1.1 → fastapi_radar-0.1.3}/README.md +8 -7
  3. {fastapi_radar-0.1.1 → fastapi_radar-0.1.3}/fastapi_radar/api.py +13 -2
  4. fastapi_radar-0.1.3/fastapi_radar/dashboard/dist/assets/index-CxIRSjZZ.js +308 -0
  5. fastapi_radar-0.1.3/fastapi_radar/dashboard/dist/assets/index-DCxkDBhr.css +1 -0
  6. {fastapi_radar-0.1.1 → fastapi_radar-0.1.3}/fastapi_radar/dashboard/dist/index.html +2 -2
  7. {fastapi_radar-0.1.1 → fastapi_radar-0.1.3}/fastapi_radar/radar.py +4 -1
  8. {fastapi_radar-0.1.1 → fastapi_radar-0.1.3/fastapi_radar.egg-info}/PKG-INFO +9 -8
  9. {fastapi_radar-0.1.1 → fastapi_radar-0.1.3}/fastapi_radar.egg-info/SOURCES.txt +2 -2
  10. {fastapi_radar-0.1.1 → fastapi_radar-0.1.3}/pyproject.toml +1 -1
  11. {fastapi_radar-0.1.1 → fastapi_radar-0.1.3}/tests/test_radar.py +0 -1
  12. fastapi_radar-0.1.1/fastapi_radar/dashboard/dist/assets/index-BrbdDWQe.css +0 -1
  13. fastapi_radar-0.1.1/fastapi_radar/dashboard/dist/assets/index-DjYO9SdO.js +0 -343
  14. {fastapi_radar-0.1.1 → fastapi_radar-0.1.3}/CONTRIBUTING.md +0 -0
  15. {fastapi_radar-0.1.1 → fastapi_radar-0.1.3}/LICENSE +0 -0
  16. {fastapi_radar-0.1.1 → fastapi_radar-0.1.3}/MANIFEST.in +0 -0
  17. {fastapi_radar-0.1.1 → fastapi_radar-0.1.3}/fastapi_radar/__init__.py +0 -0
  18. {fastapi_radar-0.1.1 → fastapi_radar-0.1.3}/fastapi_radar/capture.py +0 -0
  19. {fastapi_radar-0.1.1 → fastapi_radar-0.1.3}/fastapi_radar/middleware.py +0 -0
  20. {fastapi_radar-0.1.1 → fastapi_radar-0.1.3}/fastapi_radar/models.py +0 -0
  21. {fastapi_radar-0.1.1 → fastapi_radar-0.1.3}/fastapi_radar/utils.py +0 -0
  22. {fastapi_radar-0.1.1 → fastapi_radar-0.1.3}/fastapi_radar.egg-info/dependency_links.txt +0 -0
  23. {fastapi_radar-0.1.1 → fastapi_radar-0.1.3}/fastapi_radar.egg-info/not-zip-safe +0 -0
  24. {fastapi_radar-0.1.1 → fastapi_radar-0.1.3}/fastapi_radar.egg-info/requires.txt +0 -0
  25. {fastapi_radar-0.1.1 → fastapi_radar-0.1.3}/fastapi_radar.egg-info/top_level.txt +0 -0
  26. {fastapi_radar-0.1.1 → fastapi_radar-0.1.3}/setup.cfg +0 -0
  27. {fastapi_radar-0.1.1 → fastapi_radar-0.1.3}/setup.py +0 -0
  28. {fastapi_radar-0.1.1 → fastapi_radar-0.1.3}/tests/__init__.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: fastapi-radar
3
- Version: 0.1.1
3
+ Version: 0.1.3
4
4
  Summary: A debugging dashboard for FastAPI applications with real-time monitoring
5
5
  Home-page: https://github.com/doganarif/fastapi-radar
6
6
  Author: Arif Dogan
@@ -46,11 +46,16 @@ Dynamic: requires-python
46
46
  # FastAPI Radar 🛰️
47
47
 
48
48
  [![Python Version](https://img.shields.io/badge/python-3.8%2B-blue.svg)](https://www.python.org/downloads/)
49
- [![FastAPI](https://img.shields.io/badge/FastAPI-0.68.0%2B-green.svg)](https://fastapi.tiangolo.com)
50
49
  [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
51
50
 
52
51
  **A debugging dashboard for FastAPI applications providing real-time request, database query, and exception monitoring.**
53
52
 
53
+ ✨ **Just one line to add powerful monitoring to your FastAPI app!**
54
+
55
+ ## 🎯 See it in Action
56
+
57
+ ![FastAPI Radar Dashboard Demo](./assets/demo.gif)
58
+
54
59
  ## Installation
55
60
 
56
61
  ```bash
@@ -79,7 +84,7 @@ from sqlalchemy import create_engine
79
84
  app = FastAPI()
80
85
  engine = create_engine("sqlite:///./app.db")
81
86
 
82
- # Initialize Radar - automatically adds middleware and mounts dashboard
87
+ # That's it! One line to add complete monitoring 🚀
83
88
  radar = Radar(app, db_engine=engine)
84
89
  radar.create_tables()
85
90
 
@@ -89,7 +94,7 @@ async def get_users():
89
94
  return {"users": []}
90
95
  ```
91
96
 
92
- Access your dashboard at: **http://localhost:8000/\_\_radar**
97
+ Access your dashboard at: **http://localhost:8000/\_\_radar/**
93
98
 
94
99
  ## Features
95
100
 
@@ -100,10 +105,6 @@ Access your dashboard at: **http://localhost:8000/\_\_radar**
100
105
  - ⚡ **Real-time Updates** - Live dashboard updates as requests happen
101
106
  - 🎨 **Beautiful UI** - Modern React dashboard with shadcn/ui components
102
107
 
103
- ## Screenshots
104
-
105
- <!-- Add screenshots here -->
106
-
107
108
  ## Configuration
108
109
 
109
110
  ```python
@@ -1,11 +1,16 @@
1
1
  # FastAPI Radar 🛰️
2
2
 
3
3
  [![Python Version](https://img.shields.io/badge/python-3.8%2B-blue.svg)](https://www.python.org/downloads/)
4
- [![FastAPI](https://img.shields.io/badge/FastAPI-0.68.0%2B-green.svg)](https://fastapi.tiangolo.com)
5
4
  [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
6
5
 
7
6
  **A debugging dashboard for FastAPI applications providing real-time request, database query, and exception monitoring.**
8
7
 
8
+ ✨ **Just one line to add powerful monitoring to your FastAPI app!**
9
+
10
+ ## 🎯 See it in Action
11
+
12
+ ![FastAPI Radar Dashboard Demo](./assets/demo.gif)
13
+
9
14
  ## Installation
10
15
 
11
16
  ```bash
@@ -34,7 +39,7 @@ from sqlalchemy import create_engine
34
39
  app = FastAPI()
35
40
  engine = create_engine("sqlite:///./app.db")
36
41
 
37
- # Initialize Radar - automatically adds middleware and mounts dashboard
42
+ # That's it! One line to add complete monitoring 🚀
38
43
  radar = Radar(app, db_engine=engine)
39
44
  radar.create_tables()
40
45
 
@@ -44,7 +49,7 @@ async def get_users():
44
49
  return {"users": []}
45
50
  ```
46
51
 
47
- Access your dashboard at: **http://localhost:8000/\_\_radar**
52
+ Access your dashboard at: **http://localhost:8000/\_\_radar/**
48
53
 
49
54
  ## Features
50
55
 
@@ -55,10 +60,6 @@ Access your dashboard at: **http://localhost:8000/\_\_radar**
55
60
  - ⚡ **Real-time Updates** - Live dashboard updates as requests happen
56
61
  - 🎨 **Beautiful UI** - Modern React dashboard with shadcn/ui components
57
62
 
58
- ## Screenshots
59
-
60
- <!-- Add screenshots here -->
61
-
62
63
  ## Configuration
63
64
 
64
65
  ```python
@@ -98,7 +98,18 @@ def create_api_router(get_session_context) -> APIRouter:
98
98
  query = session.query(CapturedRequest)
99
99
 
100
100
  if status_code:
101
- query = query.filter(CapturedRequest.status_code == status_code)
101
+ # Handle status code ranges (e.g., 200 for 2xx, 400 for 4xx)
102
+ if status_code in [200, 300, 400, 500]:
103
+ # Filter by status code range
104
+ lower_bound = status_code
105
+ upper_bound = status_code + 100
106
+ query = query.filter(
107
+ CapturedRequest.status_code >= lower_bound,
108
+ CapturedRequest.status_code < upper_bound,
109
+ )
110
+ else:
111
+ # Exact status code match
112
+ query = query.filter(CapturedRequest.status_code == status_code)
102
113
  if method:
103
114
  query = query.filter(CapturedRequest.method == method)
104
115
  if search:
@@ -246,7 +257,7 @@ def create_api_router(get_session_context) -> APIRouter:
246
257
 
247
258
  @router.get("/stats", response_model=DashboardStats)
248
259
  async def get_stats(
249
- hours: int = Query(1, ge=1, le=24),
260
+ hours: int = Query(1, ge=1, le=720), # Allow up to 30 days
250
261
  slow_threshold: int = Query(100),
251
262
  session: Session = Depends(get_db),
252
263
  ):