Online DuckDB Compiler

Query a CSV file using DuckDB

Python
import duckdb
from urllib.request import urlretrieve

# Download a CSV file to use as the source of data
csv_path, _ = urlretrieve('https://raw.githubusercontent.com/mwaskom/seaborn-data/master/tips.csv')

# Query the downloaded CSV file using duckdb
duckdb.sql(f"SELECT * FROM read_csv('{csv_path}') LIMIT 5")
Click Run or press shift + ENTER to run code.