Pathlib
pathlib is a Python standard-library module providing object-oriented classes and operations for representing and manipulating filesystem paths.
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
- Uses Path objects to handle filesystem locations and operations, including file searches and archiving.
- How deep it goes
- Works through path properties and filesystem methods, then combines them in scripts; defers the full method catalog to the documentation.
- Examples
- Demonstrates path components, recursive .test file-size totals, and a dated archive for matching text files.
- What you can do after
- Build it from scratch: search for matching files, inspect them, and move them into a created directory with pathlib.
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 →
Related concepts
- osalternative to · The os module is Python’s standard-library interface to operating-system services, including filesystem, pathname, process, and environment operations.
- file pathuses · A file path is a textual or structured identifier specifying the location of a file or directory in a filesystem.
- os.pathalternative to · os.path is Python’s standard-library interface for manipulating and inspecting filesystem pathnames according to operating-system-specific conventions.
- glob moduleuses · The glob module is a Python standard-library module for finding filesystem pathnames that match shell-style wildcard patterns.
- file operationuses · A file operation is an action that accesses, reads, writes, or otherwise manages data in a file or filesystem.
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.

