fastapi-radar 0.1.4__tar.gz → 0.1.6__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 (27) hide show
  1. {fastapi_radar-0.1.4/fastapi_radar.egg-info → fastapi_radar-0.1.6}/PKG-INFO +49 -11
  2. {fastapi_radar-0.1.4 → fastapi_radar-0.1.6}/README.md +48 -10
  3. {fastapi_radar-0.1.4 → fastapi_radar-0.1.6}/fastapi_radar/__init__.py +1 -1
  4. {fastapi_radar-0.1.4 → fastapi_radar-0.1.6}/fastapi_radar/api.py +1 -1
  5. fastapi_radar-0.1.6/fastapi_radar/dashboard/dist/assets/index-BJa0l2JD.js +313 -0
  6. {fastapi_radar-0.1.4 → fastapi_radar-0.1.6}/fastapi_radar/dashboard/dist/index.html +1 -1
  7. {fastapi_radar-0.1.4 → fastapi_radar-0.1.6}/fastapi_radar/radar.py +13 -2
  8. {fastapi_radar-0.1.4 → fastapi_radar-0.1.6/fastapi_radar.egg-info}/PKG-INFO +49 -11
  9. {fastapi_radar-0.1.4 → fastapi_radar-0.1.6}/fastapi_radar.egg-info/SOURCES.txt +1 -1
  10. {fastapi_radar-0.1.4 → fastapi_radar-0.1.6}/pyproject.toml +1 -1
  11. {fastapi_radar-0.1.4 → fastapi_radar-0.1.6}/setup.py +1 -1
  12. fastapi_radar-0.1.4/fastapi_radar/dashboard/dist/assets/index-CxIRSjZZ.js +0 -308
  13. {fastapi_radar-0.1.4 → fastapi_radar-0.1.6}/CONTRIBUTING.md +0 -0
  14. {fastapi_radar-0.1.4 → fastapi_radar-0.1.6}/LICENSE +0 -0
  15. {fastapi_radar-0.1.4 → fastapi_radar-0.1.6}/MANIFEST.in +0 -0
  16. {fastapi_radar-0.1.4 → fastapi_radar-0.1.6}/fastapi_radar/capture.py +0 -0
  17. {fastapi_radar-0.1.4 → fastapi_radar-0.1.6}/fastapi_radar/dashboard/dist/assets/index-DCxkDBhr.css +0 -0
  18. {fastapi_radar-0.1.4 → fastapi_radar-0.1.6}/fastapi_radar/middleware.py +0 -0
  19. {fastapi_radar-0.1.4 → fastapi_radar-0.1.6}/fastapi_radar/models.py +0 -0
  20. {fastapi_radar-0.1.4 → fastapi_radar-0.1.6}/fastapi_radar/utils.py +0 -0
  21. {fastapi_radar-0.1.4 → fastapi_radar-0.1.6}/fastapi_radar.egg-info/dependency_links.txt +0 -0
  22. {fastapi_radar-0.1.4 → fastapi_radar-0.1.6}/fastapi_radar.egg-info/not-zip-safe +0 -0
  23. {fastapi_radar-0.1.4 → fastapi_radar-0.1.6}/fastapi_radar.egg-info/requires.txt +0 -0
  24. {fastapi_radar-0.1.4 → fastapi_radar-0.1.6}/fastapi_radar.egg-info/top_level.txt +0 -0
  25. {fastapi_radar-0.1.4 → fastapi_radar-0.1.6}/setup.cfg +0 -0
  26. {fastapi_radar-0.1.4 → fastapi_radar-0.1.6}/tests/__init__.py +0 -0
  27. {fastapi_radar-0.1.4 → fastapi_radar-0.1.6}/tests/test_radar.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: fastapi-radar
3
- Version: 0.1.4
3
+ Version: 0.1.6
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
@@ -75,6 +75,8 @@ pipenv install fastapi-radar
75
75
 
76
76
  ## Quick Start
77
77
 
78
+ ### With SQL Database (Full Monitoring)
79
+
78
80
  ```python
79
81
  from fastapi import FastAPI
80
82
  from fastapi_radar import Radar
@@ -83,7 +85,7 @@ from sqlalchemy import create_engine
83
85
  app = FastAPI()
84
86
  engine = create_engine("sqlite:///./app.db")
85
87
 
86
- # That's it! One line to add complete monitoring
88
+ # Full monitoring with SQL query tracking
87
89
  radar = Radar(app, db_engine=engine)
88
90
  radar.create_tables()
89
91
 
@@ -93,30 +95,62 @@ async def get_users():
93
95
  return {"users": []}
94
96
  ```
95
97
 
98
+ ### Without SQL Database (HTTP & Exception Monitoring)
99
+
100
+ ```python
101
+ from fastapi import FastAPI
102
+ from fastapi_radar import Radar
103
+
104
+ app = FastAPI()
105
+
106
+ # Monitor HTTP requests and exceptions only
107
+ # Perfect for NoSQL databases, external APIs, or database-less apps
108
+ radar = Radar(app) # No db_engine parameter needed!
109
+ radar.create_tables()
110
+
111
+ @app.get("/api/data")
112
+ async def get_data():
113
+ # Your MongoDB, Redis, or external API calls here
114
+ return {"data": []}
115
+ ```
116
+
96
117
  Access your dashboard at: **http://localhost:8000/\_\_radar/**
97
118
 
98
119
  ## Features
99
120
 
100
- - **Zero Configuration** - Works with any FastAPI + SQLAlchemy app
121
+ - **Zero Configuration** - Works with any FastAPI app (SQL database optional)
101
122
  - **Request Monitoring** - Complete HTTP request/response capture with timing
102
- - **Database Monitoring** - SQL query logging with execution times
123
+ - **Database Monitoring** - SQL query logging with execution times (when using SQLAlchemy)
103
124
  - **Exception Tracking** - Automatic exception capture with stack traces
104
125
  - **Real-time Updates** - Live dashboard updates as requests happen
126
+ - **Flexible Integration** - Use with SQL, NoSQL, or no database at all
105
127
 
106
128
  ## Configuration
107
129
 
108
130
  ```python
109
131
  radar = Radar(
110
132
  app,
111
- db_engine=engine,
112
- dashboard_path="/__radar", # Custom dashboard path
113
- enable_in_production=False, # Disable in production
114
- capture_body=True, # Capture request/response bodies
115
- capture_headers=True, # Capture headers
116
- max_body_size=10000, # Max body size to capture
133
+ db_engine=engine, # Optional: SQLAlchemy engine for SQL query monitoring
134
+ dashboard_path="/__radar", # Custom dashboard path (default: "/__radar")
135
+ max_requests=1000, # Max requests to store (default: 1000)
136
+ retention_hours=24, # Data retention period (default: 24)
137
+ slow_query_threshold=100, # Mark queries slower than this as slow (ms)
138
+ capture_sql_bindings=True, # Capture SQL query parameters
139
+ exclude_paths=["/health"], # Paths to exclude from monitoring
140
+ theme="auto", # Dashboard theme: "light", "dark", or "auto"
117
141
  )
118
142
  ```
119
143
 
144
+ ## What Gets Captured?
145
+
146
+ - ✅ HTTP requests and responses
147
+ - ✅ Response times and performance metrics
148
+ - ✅ SQL queries with execution times
149
+ - ✅ Query parameters and bindings
150
+ - ✅ Slow query detection
151
+ - ✅ Exceptions with stack traces
152
+ - ✅ Request/response bodies and headers
153
+
120
154
  ## Contributing
121
155
 
122
156
  We welcome contributions! Please see our [Contributing Guide](CONTRIBUTING.md) for details.
@@ -148,10 +182,14 @@ npm run dev # For development with hot reload
148
182
  npm run build # To rebuild the production bundle
149
183
  ```
150
184
 
151
- 4. Run the example app:
185
+ 4. Run the example apps:
152
186
 
153
187
  ```bash
188
+ # Example with SQL database
154
189
  python example_app.py
190
+
191
+ # Example without SQL database (NoSQL/in-memory)
192
+ python example_nosql_app.py
155
193
  ```
156
194
 
157
195
  ## License
@@ -31,6 +31,8 @@ pipenv install fastapi-radar
31
31
 
32
32
  ## Quick Start
33
33
 
34
+ ### With SQL Database (Full Monitoring)
35
+
34
36
  ```python
35
37
  from fastapi import FastAPI
36
38
  from fastapi_radar import Radar
@@ -39,7 +41,7 @@ from sqlalchemy import create_engine
39
41
  app = FastAPI()
40
42
  engine = create_engine("sqlite:///./app.db")
41
43
 
42
- # That's it! One line to add complete monitoring
44
+ # Full monitoring with SQL query tracking
43
45
  radar = Radar(app, db_engine=engine)
44
46
  radar.create_tables()
45
47
 
@@ -49,30 +51,62 @@ async def get_users():
49
51
  return {"users": []}
50
52
  ```
51
53
 
54
+ ### Without SQL Database (HTTP & Exception Monitoring)
55
+
56
+ ```python
57
+ from fastapi import FastAPI
58
+ from fastapi_radar import Radar
59
+
60
+ app = FastAPI()
61
+
62
+ # Monitor HTTP requests and exceptions only
63
+ # Perfect for NoSQL databases, external APIs, or database-less apps
64
+ radar = Radar(app) # No db_engine parameter needed!
65
+ radar.create_tables()
66
+
67
+ @app.get("/api/data")
68
+ async def get_data():
69
+ # Your MongoDB, Redis, or external API calls here
70
+ return {"data": []}
71
+ ```
72
+
52
73
  Access your dashboard at: **http://localhost:8000/\_\_radar/**
53
74
 
54
75
  ## Features
55
76
 
56
- - **Zero Configuration** - Works with any FastAPI + SQLAlchemy app
77
+ - **Zero Configuration** - Works with any FastAPI app (SQL database optional)
57
78
  - **Request Monitoring** - Complete HTTP request/response capture with timing
58
- - **Database Monitoring** - SQL query logging with execution times
79
+ - **Database Monitoring** - SQL query logging with execution times (when using SQLAlchemy)
59
80
  - **Exception Tracking** - Automatic exception capture with stack traces
60
81
  - **Real-time Updates** - Live dashboard updates as requests happen
82
+ - **Flexible Integration** - Use with SQL, NoSQL, or no database at all
61
83
 
62
84
  ## Configuration
63
85
 
64
86
  ```python
65
87
  radar = Radar(
66
88
  app,
67
- db_engine=engine,
68
- dashboard_path="/__radar", # Custom dashboard path
69
- enable_in_production=False, # Disable in production
70
- capture_body=True, # Capture request/response bodies
71
- capture_headers=True, # Capture headers
72
- max_body_size=10000, # Max body size to capture
89
+ db_engine=engine, # Optional: SQLAlchemy engine for SQL query monitoring
90
+ dashboard_path="/__radar", # Custom dashboard path (default: "/__radar")
91
+ max_requests=1000, # Max requests to store (default: 1000)
92
+ retention_hours=24, # Data retention period (default: 24)
93
+ slow_query_threshold=100, # Mark queries slower than this as slow (ms)
94
+ capture_sql_bindings=True, # Capture SQL query parameters
95
+ exclude_paths=["/health"], # Paths to exclude from monitoring
96
+ theme="auto", # Dashboard theme: "light", "dark", or "auto"
73
97
  )
74
98
  ```
75
99
 
100
+ ## What Gets Captured?
101
+
102
+ - ✅ HTTP requests and responses
103
+ - ✅ Response times and performance metrics
104
+ - ✅ SQL queries with execution times
105
+ - ✅ Query parameters and bindings
106
+ - ✅ Slow query detection
107
+ - ✅ Exceptions with stack traces
108
+ - ✅ Request/response bodies and headers
109
+
76
110
  ## Contributing
77
111
 
78
112
  We welcome contributions! Please see our [Contributing Guide](CONTRIBUTING.md) for details.
@@ -104,10 +138,14 @@ npm run dev # For development with hot reload
104
138
  npm run build # To rebuild the production bundle
105
139
  ```
106
140
 
107
- 4. Run the example app:
141
+ 4. Run the example apps:
108
142
 
109
143
  ```bash
144
+ # Example with SQL database
110
145
  python example_app.py
146
+
147
+ # Example without SQL database (NoSQL/in-memory)
148
+ python example_nosql_app.py
111
149
  ```
112
150
 
113
151
  ## License
@@ -2,5 +2,5 @@
2
2
 
3
3
  from .radar import Radar
4
4
 
5
- __version__ = "0.1.4"
5
+ __version__ = "0.1.6"
6
6
  __all__ = ["Radar"]
@@ -52,7 +52,7 @@ class QueryDetail(BaseModel):
52
52
  id: int
53
53
  request_id: str
54
54
  sql: str
55
- parameters: Optional[List[Any]]
55
+ parameters: Optional[Dict[str, Any]]
56
56
  duration_ms: Optional[float]
57
57
  rows_affected: Optional[int]
58
58
  connection_name: Optional[str]