CSV to JSON in Python: Preserve Leading Zeros and Empty Fields Synthetic example for https://csv.jhsoftlabs.com/guides/csv-to-json-preserve-types Default mode produces two objects with string values, including ID "00123", quantity "4" and blank strings. With --quantity-as-number, quantities become 4 and null while IDs and notes remain strings. Read the guide for interpretation and application-specific steps. Preserve your own source files.