skillfed

pathlib

Object-oriented filesystem paths

pathlib v1.0.1 6.5M downloads/30d#1,896 on PyPI
Permissive license MIT License Abandoned released

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 pathlib

uv

uv add pathlib

poetry

poetry add pathlib

Installing 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

Development Status :: 5 - Production/StableIntended Audience :: DevelopersLicense :: OSI Approved :: MIT LicenseOperating System :: OS IndependentProgramming Language :: Python :: 2.6Programming Language :: Python :: 2.7Programming Language :: Python :: 3Programming Language :: Python :: 3.2Programming Language :: Python :: 3.3Programming Language :: Python :: 3.4Topic :: Software Development :: LibrariesTopic :: System :: Filesystems

Tags

filesystem path handlingobject-oriented pathspathlib backportpath manipulationcross-platform path operationspath objects instead of stringsdirectory traversalfile path utilities
legacy-backportabandoned

More Libraries packages