All courses
· beginner

Files, CSV and JSON

Get data in and out of your programs. Text files, the two formats you will meet constantly, filesystem paths that work everywhere, and loading messy data without crashing on row four hundred.

Pathaxis · Original content

Written in house, from the work rather than from a syllabus. Every example is one we would use ourselves, and every exercise is checked against the same engine that grades your answer.

67 min 5 lessons 18 quiz questions 6 exercisesStart course

What you’ll learn

  • Read and write text files without leaking handles
  • Parse CSV into dictionaries and write it back correctly
  • Convert between JSON and Python structures
  • Build filesystem paths that work on any operating system
  • Load imperfect data row by row and report what failed
  • Choose between CSV and JSON for a given job

Before you start

  • · Functions and Error Handling in Python
  • · Comfort with lists and dictionaries

Syllabus

01

Files and formats

Text, CSV and JSON, and when each applies.

02

Doing it properly

Paths, encodings and loading data that is not clean.