On this page
article
pathlib — Object-Oriented Paths
Modern path manipulation.
Overview
Modern path manipulation.
Quick Example
from pathlib import Path
Path('data').mkdir(exist_ok=True)
When to Use
Use this module when you need built-in support without adding third-party dependencies.
Common Tasks
- Read the official docs: docs.python.org/3/library/pathlib.html
- Combine with related modules in the Cookbook
- Prefer stdlib before reaching for PyPI packages