An ELT project to extract data from Fatsecret, load into BigQuery then transform into star schema models with DBT.
pip: Follow the steps here to install pip uv: Follow the steps here to install uv sqlfluff: Follow the steps here to install sqlfluff
- Create a
.envrc
file with the following variables:
# Fat secret API Keys
export FATSECRET_CLIENT_ID=*********
export FATSECRET_CLIENT_SECRET=*********
export UV_NO_ENV_FILE=1
# Bigquery
export GCP_PROJECT=*********
export GCP_SA_KEYFILE=********* # service account JSON path
export GCP_PROJECT_RAW_DATASET=*********
export FAT_SECRET_FOOD_TABLE_NAME=*********
- Download direnv
- Configure your shell profile:
UV_NO_ENV_FILE=1
eval "$(direnv hook zsh)" # or bash etc
- Restart your shell to load env variables
- Install Ruff for Python formatting
- Install sqlfluff for formatting sql
uv run --package load init_storage
uv run --package load extract_data_to_storage
uvx --directory data/transform --from dbt-core dbt deps
uvx --directory data/transform --from dbt-bigquery dbt build
uvx --directory data/transform --from dbt-bigquery dbt build --select
sqlfluff lint
# fix
sqlfluff fix