path.py
A module wrapper for os.path
What it is and what it does
path.py wraps filesystem operations into a Path object that inherits from str, letting you call methods like chmod(), walk(), and glob() directly on path instances. Unlike pathlib, Path objects are strings themselves, so they pass directly to APIs that expect text paths without casting. The package provides convenience methods like rmtree() and remove_p() (remove if exists), plus properties like .permissions, all while maintaining a single unified Path class that works across operating systems.
The package has been in active development since 2003 and aims to be a drop-in replacement for pathlib.Path where possible, while remaining faster to iterate than the standard library. It's suitable for scripts, system tools, and applications that need readable, object-oriented path manipulation without the friction of converting to strings for legacy APIs.
Use it for:
- Writing cleanup or file-management scripts where you want readable path operations and direct method calls like f.chmod(0o755).
- Building tools that work with filesystem hierarchies and need to pass paths to APIs that don't support PEP 519 PathLike objects.
- Creating subclasses of Path to add custom filesystem behavior without managing OS-specific variants.
- Migrating from os.path code to an object-oriented style while keeping paths compatible with existing string-based APIs.
- Temporary directory and file operations using TempDir and context managers for cleaner resource management.
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
Provides Path objects that wrap filesystem operations as methods, letting you call chmod, walk, and glob directly on path instances rather than using os.path functions.
Yes. path.py is stable, actively maintained, has no known vulnerabilities, and installs with minimal friction. It's worth installing if you prefer object-oriented path operations and need paths to work as strings in legacy APIs—a genuine advantage over pathlib. If you're already using pathlib and it meets your needs, there's no urgent reason to switch, but path.py is a solid alternative for new projects or codebases that value readability and string compatibility.
Install
path-py on PyPI
pip
pip install path-pyuv
uv add path-pypoetry
poetry add path-pyInstalling path.py
Before you install
Low friction: pure Python wheel, single lightweight dependency (path itself). Actively maintained with recent commits; marked Production/Stable since early releases.
License in practice
MIT license (permissive): you may use, modify, and distribute freely with minimal restrictions, making it suitable for both open-source and proprietary projects.
Quickstart
from path import Path
d = Path("/home/user/bin")
for f in d.files("*.py"):
f.chmod(0o755)
with Path("somewhere"):
# working directory is now `somewhere`
pass
Requires Python 3.5 or later.
Verify before relying
- Whether path.Path objects remain fully compatible with modern pathlib.Path APIs across all use cases.
- Performance characteristics when handling large directory trees compared to pathlib or os.path.
Package facts
| License | not declared (permissive) |
| Python support | supports the current Python release (>=3.5) |
| Install friction | low — pure-Python wheel |
| Runtime dependencies | 1 — path |
| Maintenance | actively maintained — 2,209 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 429,261/month — #6,741 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: path.py-12.5.0-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
fspathProvides a more intuitive Python API for…
agpl · top 15,000 on PyPI
oschmodSets file permissions consistently across…
permissive · top 15,000 on PyPI
pathProvides Path objects that wrap filesystem…
permissive · top 5,000 on PyPI
UnipathUnipath provides an object-oriented interface…
permissive · top 15,000 on PyPI
pathlibProvides object-oriented filesystem path…
permissive · top 5,000 on PyPI
pathmagicProvides File and Dir classes that wrap…
permissive · top 15,000 on PyPI
chialisp-stdlibProvides path access to Chialisp standard…
unclear · top 15,000 on PyPI
flake8-use-pathlibA flake8 plugin that detects uses of os and…
permissive · top 15,000 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