skillfed

path.py

A module wrapper for os.path

path-py v12.5.0 429.3K downloads/30d#6,741 on PyPI1,124
Permissive license Active released

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-py

uv

uv add path-py

poetry

poetry add path-py

Installing 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

Development Status :: 5 - Production/StableIntended Audience :: DevelopersLicense :: OSI Approved :: MIT LicenseOperating System :: OS IndependentProgramming Language :: Python :: 3Topic :: Software Development :: Libraries :: Python Modules

Tags

object-oriented filesystem pathspath manipulation libraryfile operations on path objectsos.path wrapperpathlib alternativechmod and glob on pathsfilesystem path abstraction
filesystem-abstractionpath-manipulation

More Python Modules packages