--- id: pathlib2 version: "2.3.7.post1" license: MIT license_treatment: permissive maintenance: dormant --- # pathlib2 — Object-oriented filesystem paths License: permissive · Maintenance: dormant · Downloads: 4.4M/mo ## What it is and what it does pathlib2 is a backport of Python's standard pathlib module, designed to bring modern path-handling APIs to older Python versions that predate pathlib's inclusion in the standard library. It provides an object-oriented interface for working with filesystem paths across platforms, replacing string-based path manipulation with a cleaner, more intuitive API. The package depends on six, scandir, and typing to maintain compatibility across Python 2.7 and early Python 3 releases. The backport tracks the standard library's pathlib implementation, so features added to the standard module are eventually available through pathlib2 on older Python versions. However, it carries a known limitation: on Windows with Python 2.7, non-ASCII filename characters may be silently corrupted due to the platform's filesystem encoder having poor Unicode support. Development now occurs primarily in the Python standard library itself, making this package a maintenance-light compatibility shim rather than an actively developed project. Use it for: - Migrate legacy Python 2.7 codebases to use modern pathlib syntax before upgrading to Python 3. - Maintain a single codebase across Python 2.7 and early Python 3.x versions using consistent path APIs. - Use pathlib's object-oriented path interface in projects that must support Python 3.5 or 3.6. - Backport pathlib features to environments where the standard library version is unavailable or outdated. ## Worth the install? AI-flagged interpretation of the facts above — verify before relying. Backport of Python's standard pathlib module for older Python versions, providing object-oriented filesystem path manipulation. No, unless you are maintaining legacy Python 2.7 or very early Python 3 code. Modern Python versions include pathlib in the standard library; use that instead. The package is stable and permissively licensed, but dormant maintenance and the availability of built-in pathlib make it unnecessary for new projects. ## Install pip install pathlib2 uv add pathlib2 poetry add pathlib2 ## Installing pathlib2 Before you install: Low install friction with a pure-Python wheel. Dormant maintenance status—last release was 2022-02-10 and last commit 2023-09-29—but the package is stable and tracks the standard library, so updates are infrequent by design. License in practice: MIT license (permissive) allows use in commercial and open-source projects with minimal restrictions. Quickstart: pip install pathlib2 from pathlib2 import Path p = Path('/home/user/file.txt') print(p.exists()) Intended for Python 2.7 and early Python 3.x; modern Python versions include pathlib in the standard library and should use that instead. Verify before relying: - Whether the package is still actively maintained or if it is effectively superseded by the standard library pathlib. - Current compatibility with Python versions beyond 3.9 and whether the package is tested against modern releases. - Whether the Windows Python 2.7 unicode filename issue (issue #56) remains unfixed and affects current users. ## Package facts - License: MIT (permissive) - Python support: unspecified - Install friction: low - Maintenance: dormant - Downloads: 4.4M/month (top 5,000 on PyPI) - Known vulnerabilities: none known ## Tags pathlib backport, object-oriented file paths, filesystem path manipulation, python 2.7 pathlib, legacy python path handling, cross-platform path operations, pathlib older python versions, legacy-python, backport [View on SkillFed](https://skillfed.io/packages/pathlib2) · [View on PyPI](https://pypi.org/project/pathlib2/)