Using Libraries

Overview


By the end of the previous parts, your study log had become much more than a first script. It could keep data between runs, work with structured records, and compute useful summaries about what you had studied. You wrote the loops, the helper functions, and the data handling yourself, because those patterns were the point of the course so far.

This part changes the scale of the tools you use. You will still write Python code, but more of that code will call tools other people have written. Those tools are libraries: collections of functions, classes, constants, and conventions that solve common problems so every programmer does not have to start from an empty file.

This is not a side topic. A large part of real programming is library use. The skill is not just knowing that a library exists. The skill is learning how to import it, read a small example, recognize the shape of the data it expects, test that you understood it, and fit it into your own program without losing control of what the program does.

The structure of this part is as follows:

A useful rhythm for this part is:

  1. read each chapter in order,
  2. run the small examples locally, because third-party libraries are not mainly a sandbox topic,
  3. complete the exercises as they appear,
  4. update your study log in the project checkpoint,
  5. and complete the recap and feedback chapter.

You do not need to memorize every function in every library. That is not how library use works. You need a reliable loop: import, try a tiny example, inspect the result, read the relevant part of the documentation, then use the tool in a small piece of your own program.