HomeCourse › Module 07

Working with Files

Open CSVs, Excel workbooks, folders full of spreadsheets, and write back out. The bread-and-butter file operations.

Toolkit 6 lessons ~55 min

Lessons in this module

  1. Reading and writing CSV files · 9 min
    The csv standard library module and the pandas one-liner equivalents.
  2. Reading Excel files with pandas · 8 min
    read_excel: the easiest way to get a .xlsx into Python.
  3. openpyxl — when you need cell-level control · 9 min
    Read/write individual cells, formatting, formulas, and styling. The library pandas uses under the hood.
  4. Looping through many files · 8 min
    Combine, transform, or report on a whole folder of files in one go.
  5. Text files, JSON, and other formats · 7 min
    When you're not dealing with CSV/Excel: plain text, JSON, and a quick note on XML.
  6. Encoding, BOMs, and other file gotchas · 6 min
    Why exports from old systems look like garbage, and how to fix them.