pathlib
Object-oriented filesystem paths
What it is and what it does
This package provides an object-oriented interface to filesystem paths, wrapping the cumbersome os and os.path functions into a cleaner API. It offers Path and PurePath classes that support operators (like `/` for path joining), method calls (like `.exists()`, `.is_dir()`, `.glob()`), and platform-aware semantics (e.g., case-insensitive path comparison on Windows). The package was originally a backport of Python 3.4's standard library pathlib module, designed to make path handling available on Python 2.6, 2.7, and early Python 3 versions.
Since Python 3.4, pathlib is built into the standard library, making this backport obsolete for any modern Python environment. The package is no longer maintained and has not been updated since 2014. The description itself recommends pathlib2 as the maintained alternative for users on older Python versions who need an actively supported backport.
Use it for:
- Handling filesystem paths in Python 2.7 or 3.2–3.3 codebases that predate standard library pathlib.
- Replacing string-based path manipulation (os.path.join, os.path.exists) with a cleaner object-oriented API in legacy projects.
- Cross-platform path operations where Windows and POSIX semantics differ (e.g., case sensitivity, slash direction).
- Globbing and directory traversal using methods like .glob() and .rglob() instead of os.walk().
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
Provides object-oriented filesystem path handling as a backport for Python versions before 3.4, when pathlib became part of the standard library.
No. For Python 3.4+, use the built-in pathlib from the standard library. For Python 2.7 or 3.2–3.3, the description explicitly recommends pathlib2 instead, which is maintained. This backport is abandoned and receives no updates or security attention.
Install
pathlib on PyPI
pip
pip install pathlibuv
uv add pathlibpoetry
poetry add pathlibInstalling pathlib
Before you install
Low install friction with no runtime dependencies. However, the package is abandoned and has not been maintained since 2014. For Python 3.4 and later, pathlib is built into the standard library; for earlier versions, the description recommends pathlib2 as the maintained alternative.
License in practice
MIT License (permissive) places no restrictions on use, modification, or distribution in commercial or private projects.
Quickstart
from pathlib import Path
p = Path('/etc')
q = p / 'init.d' / 'reboot'
print(q.exists())
print(q.is_dir())
This is a backport for Python 2.6, 2.7, and Python 3.2–3.3. For Python 3.4+, use the built-in pathlib from the standard library instead.
Verify before relying
- Whether this backport remains compatible with modern Python tooling and dependency resolvers despite its abandoned status.
- Whether pathlib2 is a drop-in replacement or requires code changes for projects currently using this package.
Package facts
| License | MIT License (permissive) |
| Python support | not specified |
| Install friction | low — pure-Python wheel |
| Runtime dependencies | none |
| Maintenance | abandoned — 4,363 days since the last release |
| First released | |
| Downloads | 6,510,315/month — #1,896 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: pathlib-1.0.1-py3-none-any.whl
Tags
More Libraries packages
urllib3 is an HTTP client library that provides…
permissive · top 100 on PyPI
requestsRequests is a Python HTTP library that…
permissive · top 100 on PyPI
pluggyPluggy provides a plugin system that lets you…
permissive · top 100 on PyPI
python-dateutilProvides parsing, arithmetic, and recurrence…
permissive · top 100 on PyPI
sixSix provides utility functions to write Python…
permissive · top 100 on PyPI
pytestpytest is a testing framework that lets you…
permissive · top 100 on PyPI
pathlib-abcProvides abstract base classes for implementing…
permissive · top 1,000 on PyPI
pathlib2Backport of Python's standard pathlib module…
permissive · top 5,000 on PyPI
pyProvides cross-platform path objects, INI file…
permissive · top 1,000 on PyPI
path.pyProvides Path objects that wrap filesystem…
permissive · top 15,000 on PyPI
UnipathUnipath provides an object-oriented interface…
permissive · top 15,000 on PyPI
pathProvides Path objects that wrap filesystem…
permissive · top 5,000 on PyPI
artifactoryProvides a pathlib-like Python interface for…
permissive · top 15,000 on PyPI
pathlib3xBackport of Python 3.11 pathlib to Python 3.8+…
permissive · top 15,000 on PyPI
zippProvides a pathlib-compatible wrapper around…
permissive · top 100 on PyPI
pathtoolsProvides pattern matching and utility functions…
permissive · top 15,000 on PyPI