Skip to content

Commit a05f307

Browse files
committed
initial commit
0 parents  commit a05f307

27 files changed

+4294
-0
lines changed

.env

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
PROJECT_ROOT=/home/athena/nintorac/duck_api
2+
PROJECT_NAME=duckapi
3+
4+
DBT_PROFILES_DIR=${PROJECT_ROOT}/duckapi_dbt
5+
DBT_PROJECT_DIR=${PROJECT_ROOT}/duckapi_dbt

.gitignore

+9
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
2+
target/
3+
dbt_packages/
4+
logs/
5+
6+
__pycache__
7+
.user.yml
8+
9+
*.duckdb

.sqlfluff

+12
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
[sqlfluff]
2+
verbose = 0
3+
nocolor = False
4+
dialect = duckdb
5+
templater = jinja
6+
output_line_length = 80
7+
8+
[sqlfluff:layout:type:comma]
9+
line_position = leading
10+
11+
[sqlfluff:capitalisation:type:keywords]
12+
capitalisation_policy = lower

Makefile

+25
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
.PHONY: test fluff data_build install_dev data_build make_request run_api
2+
3+
mr = curl -s -X POST -H "Content-Type: application/json" \
4+
-d '[{"group_id": "🦆", "event_value": 13}, {"group_id": "🐇", "event_value": 8}, {"group_id": "🐰", "event_value": 2}, {"group_id": "🐰", "event_value": 5}, {"group_id": "🦆", "event_value": 3}, {"group_id": "🐇", "event_value": 23}, {"group_id": "🐇", "event_value": 1}, {"group_id": "🦆", "event_value": 17}, {"group_id": "🐰", "event_value": 5}]' http://localhost:8000/analyse_data/
5+
6+
test:
7+
pytest
8+
9+
fluff:
10+
sqlfluff fix
11+
12+
install_dev:
13+
poetry install --with dev
14+
15+
data_build:
16+
dbt build
17+
18+
run_api:
19+
fastapi dev duckapi/api.py
20+
21+
make_request:
22+
${mr}
23+
24+
make_request_pretty:
25+
${mr} | jq

README.md

+20
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
# DuckAPI
2+
3+
There will be a blog post, I'll put the link here if I remember
4+
5+
## Getting started
6+
7+
The repository can be found here [github.com/Nintorac/duckapi](https://github.com/Nintorac/duckapi)
8+
9+
10+
First edit the `.env` file so that `PROJECT_ROOT` var is pointing to the root of this repository.
11+
12+
Then, assuming you already have conda installed,
13+
14+
```bash
15+
conda create -n duckapi python=3.10 -y
16+
conda activate duckapi
17+
pip install poetry
18+
make install_dev
19+
make test
20+
```

0 commit comments

Comments
 (0)