Skip to content

Commit

Permalink
🔨(api) add API database seeding
Browse files Browse the repository at this point in the history
Starting from a clean static dataset, we can import statiques to the API
database. Current importation process requires a valid database.
  • Loading branch information
jmaupetit committed Jul 3, 2024
1 parent ecf5704 commit a0a9281
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,10 @@ COMPOSE_RUN_CLIENT = $(COMPOSE_RUN) client
CURL = $(COMPOSE_RUN) curl

# -- Ressources
IRVE_STATIC_DATASET_URL = https://www.data.gouv.fr/fr/datasets/r/eb76d20a-8501-400e-b336-d85724de5435
# Official dataset
# IRVE_STATIC_DATASET_URL = https://www.data.gouv.fr/fr/datasets/r/eb76d20a-8501-400e-b336-d85724de5435
# Clean Dataset
IRVE_STATIC_DATASET_URL = https://raw.githubusercontent.com/loco-philippe/Environmental-Sensing/main/python/Validation/irve/Analyse/IRVE_itinerance_valide2024-06-05.csv
AFIREV_CHARGING_DATASET_URL = https://afirev.fr/en/liste-des-identifiants-attribues/

# ==============================================================================
Expand Down Expand Up @@ -153,6 +156,13 @@ jupytext--to-ipynb: ## convert remote md files into ipynb
bin/jupytext --to ipynb work/src/notebook/**/*.md
.PHONY: jupytext--to-ipynb

seed-api: ## seed the API database (static data)
seed-api: data/irve-statique.csv
cat data/irve-statique.csv | \
$(COMPOSE) exec -T api pipenv run csvjson -I --stream | \
bin/qcc static bulk
.PHONY: seed-api

seed-metabase: ## seed the Metabase server
@echo "Running metabase service …"
@$(COMPOSE) up -d --wait metabase
Expand Down

0 comments on commit a0a9281

Please sign in to comment.