Practical Python in the AI Era
Build Real Programs with Automation, APIs, Testing, and AI-Assisted Coding
CodeEssentials Python Series, Book 2
Publisher: CodeEssentials Books - https://codeessentialsbooks.com

Companion files, version 2026-09-27
This version covers chapters 1, 2, 3, 4, 5, 6, 7, 8 and these projects:
  - Project 1: Smart File Organizer  (projects/smart-file-organizer/)
  - Project 2: Text & Log Analyzer  (projects/text-log-analyzer/)
  - Project 3: Expense Tracker  (projects/expense-tracker/)
Files for the remaining chapters and projects will be added to this download
as they are completed. Newer versions of these companion files may appear on
https://codeessentialsbooks.com/practical-python-ai-era

PYTHON VERSIONS
The examples need Python 3.12 or newer. Every file in this download was run
on Python 3.12, 3.13, 3.14 and 3.15 (release candidate 2) before packing.
Where the output differs between versions, the book says so.

HOW TO USE THESE FILES
1. Unzip the folder anywhere you like.
2. Open a terminal in the folder of the example you want, for example
   chapters/ch05, and run a script:
       Windows:        python summarize.py
       macOS / Linux:  python3 summarize.py
3. Each script expects to be run from its own folder, because it reads and
   writes files next to itself (sample CSV files, folders it creates).
4. Some scripts create, rename or move files. Run them inside this folder,
   never on your real Documents or Downloads folder. To start again, delete
   the folder and unzip a fresh copy.
5. Some listings stop with an error on purpose: the book uses them to teach
   how to read tracebacks. The chapter tells you which ones.
6. Chapter 8 and later: a few examples need third-party packages. Create a
   virtual environment and install them with
       python -m pip install -r requirements.txt
   (chapters/ch08/requirements.txt) as Chapter 8 explains.

FOLDERS
  chapters/    one folder per chapter: the book's code listings, with the
               sample data files they read
  exercises/   the end-of-chapter exercise files; a file ending in _fixed or
               _solution is the answer to the exercise of the same name, so
               try the exercise first
  projects/    the complete projects, file for file as printed in the book.
               Each project creates its own sample data: run its
               make_sample_*.py script first, as the project chapter shows.

The code is the same as the printed listings. If your output differs from the
book, compare your Python version with the one the book names first.
