skillfed

pathlib3x

backport of pathlib 3.10 to python 3.6, 3.7, 3.8, 3.9 with a few extensions

pathlib3x v2.0.3 105.1K downloads/30d#12,719 on PyPI14
Permissive license MIT Active released

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 pathlib3x

uv

uv add pathlib3x

poetry

poetry add pathlib3x

Installing 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

Development Status :: 5 - Production/StableIntended Audience :: DevelopersLicense :: OSI Approved :: MIT LicenseNatural Language :: EnglishOperating System :: OS IndependentProgramming Language :: PythonTopic :: Software Development :: Libraries :: Python Modules

Tags

pathlib backport older pythonpath manipulation 3.8 3.9 3.10file operations pathlib extensionsshutil wrapper path methodscross-version pathlib compatibilitypath copy move deletepathlib missing_ok unlink
backportfile-operationspathlib-extensions

More Python Modules packages