DuckDB queries the file directly, no server and no import step: group 1,200 rows of sales.csv by region and West leads at 17,264. It works on Parquet files too.
python3 --version.pip install "duckdb>=1.0"python3 -m venv .venv source .venv/bin/activate
pip install "duckdb>=1.0"
python3 query.py
import duckdb
duckdb.sql("""
SELECT region, SUM(amount) AS revenue
FROM 'sales.csv'
GROUP BY region ORDER BY revenue DESC
""").show()Stop loading CSVs into a database to query them. DuckDB needs no server. SQL reads the file directly. Group by region, and show.
Run it. 1,200 rows, three totals. West leads: $17K. Query the file.
Skip the server.
Read the lesson on GitHub →