Live website available here. Blog post available here.
If you are using this template in Codespaces, click the Start Evidence button in the bottom status bar. This will install dependencies and open a preview of your project in your browser - you should get a popup prompting you to open in browser.
Or you can use the following commands to get started:
npm install
npm run sources
npm run dev -- --host 0.0.0.0See the CLI docs for more command information.
Note: Codespaces is much faster on the Desktop app. After the Codespace has booted, select the hamburger menu → Open in VS Code Desktop.
The easiest way to get started is using the VS Code Extension:
- Install the extension from the VS Code Marketplace
- Open the Command Palette (Ctrl/Cmd + Shift + P) and enter
Evidence: New Evidence Project - Click
Start Evidencein the bottom status bar
npx degit evidence-dev/template my-project
cd my-project
npm install
npm run sources
npm run dev Check out the docs for alternative install methods including Docker, Github Codespaces, and alongside dbt.
The following steps were previously performed manually to update the race data. This process is now largely automated by a GitHub Action that runs the scripts/intelligent_race_updater.py script.
-
Activate Virtual Environment:
- Ensure the Python virtual environment (created using dependencies in
elt/requirements.txt) is active. - Example:
source .venv/bin/activate(or your specific venv activation command).
- Ensure the Python virtual environment (created using dependencies in
-
Update Raw Data and Base DuckDB:
- Run the ELT (Extract, Load, Transform) scripts to fetch the latest race results and build the initial DuckDB database.
- Command:
python elt/extract.py && python elt/transform.py - Alternatively, using the Makefile:
make elt
-
Identify New Races & Update
circuit_races.csv:- Query the
race_results.parquetfile (located indata/raw/) to find races from the current year that have occurred but whose names are not yet filled indata/circuit_races.csv. - Manually (or with the help of a script/LLM) match these new race events to the corresponding placeholder rows in
data/circuit_races.csv(whererace_nameis empty butrace_location,race_slug, etc., are pre-filled for the year's schedule). - Update the empty
race_namefield indata/circuit_races.csvwith the official race name for each matched placeholder.
- Query the
-
Update DuckDB Database with Enriched CSV:
- After
data/circuit_races.csvhas been updated with the new race names, re-run the transformation script to ensure the main DuckDB database (sources/race_results/race_results.duckdb) reflects these additions and is correctly joined. - Command:
python elt/transform.py - (If using
make eltin step 2, and step 3 was manual, you'd re-run this transform part separately or ensure the main update script handles it).
- After
Automation via scripts/intelligent_race_updater.py and GitHub Actions:
- The
scripts/intelligent_race_updater.pyscript (which can be run viamake update) now automates steps 2, 3, and 4.- It calls the ELT scripts (
extract.pyandtransform.py). - It identifies placeholder races in
circuit_races.csv. - It queries an LLM (via OpenRouter API) to find the best matching official race name for each placeholder from the races found in
race_results.parquet. - It updates
circuit_races.csvwith these names.
- It calls the ELT scripts (
- The GitHub Action (
.github/workflows/update_data.yml) orchestrates this process:- Runs
scripts/intelligent_race_updater.pyon a schedule or manually. - If changes are made by the script, it re-runs
elt/transform.pyto ensure the DuckDB is up-to-date with the AI-filled CSV. - It then commits the changes to a new branch and creates a Pull Request.
- Runs
