How to Use Parquet Format for Crypto Data (Python Guide)
If you have ever tried to load a multi-year crypto dataset from CSV into pandas, you know the pain: minutes of loading, gigabytes of RAM consumed, kernel crashes. Apache Parquet solves all of this. It is the standard columnar storage format for large-scale data.
Why Parquet Beats CSV for Crypto Data
- Size: a 25GB tick dataset in CSV compresses to ~6GB in Parquet with ZSTD
- Speed: column pruning and predicate pushdown reduce I/O by 10-100x
- Types: timestamps, floats, booleans stored as native types — no parsing errors
- Metadata: row counts, min/max per column stored in the file footer
Reading Parquet with Polars
import polars as pl
# Only specific columns — much faster on large files
df = pl.read_parquet("BTC_trades.parquet", columns=["time", "price", "qty"])
# Lazy evaluation — no RAM until .collect()
df = (
pl.scan_parquet("BTC_trades.parquet")
.filter(pl.col("price") > 50000)
.select(["time", "price", "qty"])
.collect()
)
print(df.shape)
Querying Parquet with DuckDB
import duckdb
result = duckdb.execute("""
SELECT
DATE_TRUNC('hour', to_timestamp(time / 1000)) AS hour,
COUNT(*) AS trades,
SUM(quote_qty) AS volume_usdt
FROM read_parquet('BTC_trades.parquet')
GROUP BY 1 ORDER BY 1
""").df()
print(result.head(10))
Checking Metadata Without Loading Data
import pyarrow.parquet as pq
pf = pq.ParquetFile("BTC_trades.parquet")
print(f"Rows: {pf.metadata.num_rows:,}")
print(f"Schema: {pf.schema_arrow}")
All Glitch List datasets ship in Apache Parquet with ZSTD compression, audited metadata, and documented schema. → Browse the catalog
Summary
Parquet is not just a compression format — it is a query-aware storage layer. For crypto datasets with millions or billions of rows, the difference between CSV and Parquet is the difference between a workflow that works and one that does not.