
Marketing CSV Cleaner — Merge Daily Exports
Send: labeled marketing CSV exports and a JSON column mapping. Get back: one sorted metrics CSV with a row per date and source, with dates and numbers normalized. #التسويق
Daily marketing numbers often arrive as several CSV exports with inconsistent date and number formats: short dates with no year, currency marks, percent signs, and ratio marks like 2.4x. This small command-line tool cleans and merges them into one table.
Add each input with an optional source label, point the tool at a JSON column mapping, and choose how short dates get their year. Count fields are written as integers; revenue and ratio keep two decimals. A clean run exits 0, a run with unparsable cells exits 1 with a warning, and a bad mapping or empty result exits 2. The tool only reads your inputs and writes the one CSV you name.
Example
python3 scripts/daily_marketing_metrics_csv_builder.py --input north=examples/north_funnel.csv --input south=examples/south_funnel.csv --columns examples/columns.json --default-year 2026 --output examples/metrics.csv
OK rows=5 warnings=0 output=examples/metrics.csv
Python 3.9+, standard library only. No network access.


