Daily Python Projects

Daily Python Projects

Build a CSV to JSON Converter with Python

Level: Beginner

Ardit Sulce's avatar
Ardit Sulce
Oct 22, 2025
∙ Paid

Your task for today is to create a CSV to JSON converter script that reads a CSV file and converts it to a formatted JSON file. This project introduces you to file format conversion and working with structured data. Use this CSV file here as a sample.

Project Task

Create a CSV to JSON converter that:

  • Reads data from a CSV file

  • Converts each row to a JSON object

  • Handles headers as keys for JSON objects

  • Writes formatted JSON output to a file

  • Displays conversion statistics (rows converted, file sizes)

  • Uses only Python’s built-in csv and json libraries

Bonus (optional):

  • Handle different CSV delimiters (comma, semicolon, tab)

  • Pretty-print JSON with indentation

  • Convert multiple CSV files at once

  • Add data type conversion (numbers, booleans)

This project gives you hands-on practice with file I/O, data format conversion, and working with CSV and JSON — essential skills for data processing and API development.

Expected Output

Here is how the input CSV data look like:

And here is the output JSON file generated by the program:

Join the Python & AI Builders Skool Community

Got questions to ask the author about this project? Join our Python & AI Builders community for weekly Python & AI videos and discussions:

skool.com/automateit

💻 View This Project in Jupyter Notebook

Become a premium member to access the working code in a Jupyter Notebook with the ready-to-run solution to get the output instantly and extend the code as you wish.

Click below to access the notebook (7-day risk-free trial):

Keep reading with a 7-day free trial

Subscribe to Daily Python Projects to keep reading this post and get 7 days of free access to the full post archives.

Already a paid subscriber? Sign in
© 2025 Ardit Sulce
Privacy ∙ Terms ∙ Collection notice
Start your SubstackGet the app
Substack is the home for great culture