You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Sample Containerized Python API using [DuckDB](https://duckdb.org/)
3
+
4
+
## Flask API
5
+
The service exposes `GET http://localhost:8080/stats` api which returns aggregated user count from DuckDB database `test.duckdb`.
6
+
7
+
**API response:**
8
+
```json
9
+
[
10
+
{
11
+
"date": "2021-02-20",
12
+
"users_joined": 2598
13
+
},
14
+
{
15
+
"date": "2021-02-21",
16
+
"users_joined": 2578
17
+
}
18
+
]
19
+
```
20
+
21
+
## Running without docker
22
+
```bash
23
+
make run
24
+
```
25
+
26
+
## Running as a container
27
+
```bash
28
+
# builds docker image
29
+
make docker.build
30
+
31
+
# runs docker image
32
+
make docker.run
33
+
```
34
+
35
+
## Test Data
36
+
Test data is coming from database file `test.duckdb`. It contains a table called `users` which has following fields with ~1 million randomly generated rows:
37
+
38
+
| id (int32)| joined_date (date) | name (varchar)| email (varchar) |
0 commit comments