Parse Shopify CSV and group rows by Handle.
Shopify CSV structure:
- First row with product data contains title, description, etc.
- Subsequent rows for same Handle contain variant data only (empty title/description)
- Each variant row has Option1/Option2 values and prices
Summary
Functions
Get the first (main) row for a product group. Contains title, description, and other product-level data.
Parse CSV file and group rows by Handle (product identifier).
Get all variant rows (rows with price data).
Functions
Get the first (main) row for a product group. Contains title, description, and other product-level data.
Parse CSV file and group rows by Handle (product identifier).
Returns a map where keys are handles and values are lists of row maps.
Examples
CSVParser.parse_and_group("/path/to/products.csv")
# => %{
# "product-handle" => [
# %{"Handle" => "product-handle", "Title" => "Product", ...},
# %{"Handle" => "product-handle", "Option1 Value" => "Small", ...},
# ...
# ],
# ...
# }
Get all variant rows (rows with price data).