Prompt
How do I get a dataset in Parquet instead of a messy JSON dump?
Latest observation
Oct 16, 2026
OpenAI APIWeb search: off
If the source gives you a messy JSON dump, the usual path is:
- Load the JSON
- Clean/normalize it into tabular columns
- Write it out as Parquet
Quick options
If the JSON is already line-delimited JSON (.jsonl / NDJSON)
You can often convert directly:
import pandas as pd
df = pd.read_json("data.jsonl", lines=True)
df.to_parquet("data.parquet", index=False)
If it’s a nested or inconsistent JSON dump
Use json_normalize:
import json
import pandas as pd
with open("data.json", "r") as f:
raw = json.load(f)
df = pd.json_normalize(raw)
df.to_parquet("data.parquet", index=False)
If the top level is a list of records, this works well. If the JSON is deeply nested, you may need to specify a record_path and meta.
If the file is huge
Pandas may be too memory-heavy. Use PyArrow or Polars.
PyArrow example
import pyarrow.json as paj
import pyarrow.parquet as pq
table = paj.read_json("data.jsonl")
pq.write_table(table, "data.parquet")
Polars example
import polars as pl
df = pl.read_json("data.json")
df.write_parquet("data.parquet")
Important cleaning steps
Before writing Parquet, you often need to:
- flatten nested fields
- convert mixed types to a consistent dtype
- handle missing values
- explode arrays if you want one row per item
- rename weird column names
If you want the dataset from a website/API
Try to request:
format=parquetapplication/x-parquet- a download endpoint offering
.parquet,.arrow, or.csv
Sometimes the provider only serves JSON, so you’ll need to do the conversion yourself.
Rule of thumb
- Small/medium data:
pandas - Large data:
pyarroworpolars - Messy nested JSON: normalize first, then export
If you want, I can show you how to convert a specific JSON sample into a clean Parquet file.