liveBook · Manning

Pathlib

pathlib is a Python standard-library module providing object-oriented classes and operations for representing and manipulating filesystem paths.

How 2 Manning books explain it

The Quick Python Book, Fourth Edition

pathlib is a Python standard-library module that provides object-oriented classes and operations for representing and manipulating filesystem paths.

How it is used
Provides an object-oriented approach to filesystem paths and operations alongside os and os.path.
How deep it goes
Works through path construction, inspection, filesystem operations, and combined scripts, while directing readers to documentation for additional methods.
Examples
Uses path-component inspection, recursive .test file backup, and dated text-file archiving as examples.
What you can do after
Apply it via pathlib to inspect paths, find files, create directories, and rename or move files.

Read how The Quick Python Book, Fourth Edition explains pathlib →

Build Python Web Apps with Streamlit

pathlib is Python's standard library module for object-oriented filesystem path manipulation.

How it is used
Builds deployment-safe paths for loading files beside a Python script.
How deep it goes
Explains Path construction, resolution, directory selection, joining, and pandas handoff through a complete loader.
Examples
Uses data_loader.py, sales_data.csv, BASE_DIR, SALES_DATA_PATH, and pandas.read_csv.
What you can do after
Build deployment-portable CSV paths and pass them directly to pandas.read_csv.

Read how Build Python Web Apps with Streamlit explains pathlib →

Also covered in

What to know first

Related concepts

Questions about pathlib

What is pathlib?

pathlib is a Python standard-library module providing object-oriented classes and operations for representing and manipulating filesystem paths.

Which Manning books explain pathlib?

The Quick Python Book, Fourth Edition and Build Python Web Apps with Streamlit.

What should I know before learning pathlib?

Manning books that teach pathlib usually introduce Python first.

What is the difference between pathlib and os?

pathlib is a Python standard-library module providing object-oriented classes and operations for representing and manipulating filesystem paths. The os module is Python’s standard-library interface to operating-system services, including filesystem, pathname, process, and environment operations.

These guides are generated from the text of Manning books by Manning's knowledge graph and link to the sections they draw on. The full books are available on liveBook and at manning.com.