pathlib3x
backport of pathlib 3.10 to python 3.6, 3.7, 3.8, 3.9 with a few extensions
What it is and what it does
pathlib3x is a backport of Python 3.11's pathlib module to Python 3.8, 3.9, and 3.10, allowing you to use newer pathlib features (like the missing_ok parameter on unlink) on older Python versions without try-except boilerplate. It also adds convenience wrappers around shutil functions (copy, copy2, copyfile, rmtree, copytree) as methods on Path objects, and introduces new methods like append_suffix and replace_parts for path manipulation.
The package is fully typed (PEP 561) and actively maintained. It depends on click and cli-exit-tools at runtime. Use it when you need to support older Python versions but want to write modern pathlib code, or when you want shutil operations available as Path methods for cleaner syntax.
Use it for:
- Use modern pathlib features (missing_ok, etc.) in codebases that must support Python 3.8–3.10.
- Copy or move files using Path.copy() and Path.copy2() instead of importing shutil separately.
- Manipulate path strings with append_suffix() to add extensions without replacing existing ones.
- Replace path components with replace_parts() when copying directory trees to new locations.
- Check if an object is a Path instance across mixed pathlib and pathlib3x code using is_path_instance().
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
Backport of Python 3.11 pathlib to Python 3.8+ with extensions like shutil wrappers (copy, rmtree, copytree) and new methods (append_suffix, replace_parts).
Yes. Low install friction, permissive license, no known vulnerabilities, and active maintenance make it a safe choice. Install if you need modern pathlib on Python 3.8–3.10 or want shutil operations as Path methods; skip if you target only Python 3.11+.
Install
pathlib3x on PyPI
pip
pip install pathlib3xuv
uv add pathlib3xpoetry
poetry add pathlib3xInstalling pathlib3x
Before you install
Low install friction with only two runtime dependencies (click, cli-exit-tools). Actively maintained as of 2026-07-21 with production-stable status.
License in practice
MIT license (permissive) places no restrictions on use, modification, or distribution in proprietary or open-source projects.
Quickstart
pip install pathlib3x
import pathlib3x as pathlib
my_file = pathlib.Path('/etc/hosts')
my_file.unlink(missing_ok=True) # works on Python 3.8+
to_file = pathlib.Path('/tmp/backup')
my_file.copy(to_file)
Requires Python 3.8.0 or newer; package is a backport and does not add features to Python 3.11+.
Verify before relying
- Whether the package's own extensions (append_suffix, replace_parts, shutil wrappers) are tested to the same coverage standard as the backported pathlib methods.
- Performance characteristics compared to standard pathlib on Python 3.11+ where both are available.
Package facts
| License | MIT (permissive) |
| Python support | supports the current Python release (>=3.8.0) |
| Install friction | low — pure-Python wheel |
| Runtime dependencies | 2 — click, cli-exit-tools |
| Maintenance | actively maintained — 1,121 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 105,129/month — #12,719 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: pathlib3x-2.0.3-py3-none-any.whl
Tags
More Python Modules packages
Converts domain names between Unicode and…
permissive · top 100 on PyPI
setuptoolsSetuptools is a Python build backend and…
permissive · top 100 on PyPI
PyYAMLPyYAML parses and emits YAML 1.1 data format,…
permissive · top 100 on PyPI
pydanticPydantic validates Python data structures…
permissive · top 100 on PyPI
annotated-typesProvides reusable metadata objects for use with…
permissive · top 100 on PyPI
typing-inspectionProvides runtime tools to inspect and…
permissive · top 100 on PyPI
backports.shutil_get_terminal_sizeProvides the get_terminal_size() function for…
permissive · top 15,000 on PyPI
pathlib-mateExtends Python's pathlib.Path with convenience…
permissive · top 5,000 on PyPI
pathlib2Backport of Python's standard pathlib module…
permissive · top 5,000 on PyPI
pathlib-abcProvides abstract base classes for implementing…
permissive · top 1,000 on PyPI
pathlibProvides object-oriented filesystem path…
permissive · top 5,000 on PyPI
traceback2Provides a backport of Python's traceback…
permissive · top 5,000 on PyPI
zippProvides a pathlib-compatible wrapper around…
permissive · top 100 on PyPI
eval-type-backportEnables newer Python typing syntax (like `X |…
permissive · top 1,000 on PyPI
pkgutil_resolve_nameProvides a backport of Python 3.9's…
permissive · top 1,000 on PyPI
path.pyProvides Path objects that wrap filesystem…
permissive · top 15,000 on PyPI