--- id: path version: "17.1.1" license: MIT license_treatment: permissive maintenance: active --- # path — A module wrapper for os.path License: permissive · Maintenance: active · Downloads: 1.3M/mo ## What it is and what it does Path is a wrapper around os.path that implements filesystem paths as first-class objects with methods for common file operations. Instead of calling separate functions like os.chmod(path, mode), you invoke methods directly on Path instances: Path(path).chmod(mode). Path objects inherit from str, so they can be passed directly to APIs that expect string paths without explicit casting, unlike pathlib.Path objects which require PEP 519 PathLike support or manual str() conversion. The package provides convenience methods beyond basic path operations—rmtree for recursive deletion, remove_p for conditional removal, permissions properties, and sophisticated walk and TempDir behaviors. It supports path concatenation with the / operator, context managers for temporary directory changes, and glob patterns. Path has been actively maintained since 2003 and aims to offer compatibility with pathlib where possible, while remaining freely iterable as a PyPI package rather than bound to Python's release cycle. Use it for: - Write cleanup scripts that recursively remove files matching patterns with chmod and rmtree in a single fluent chain. - Pass Path objects directly to legacy APIs expecting string paths without intermediate str() conversions. - Traverse directory trees with glob patterns and apply batch file operations (permissions, deletion) in loops. - Subclass Path to add custom filesystem methods without managing OS-specific variants. - Use context managers to temporarily change working directory for a block of operations. ## Worth the install? AI-flagged interpretation of the facts above — verify before relying. Provides Path objects that wrap filesystem operations as methods, allowing direct invocation of file operations on path instances with a str-compatible interface. Yes. Path is stable, actively maintained, has no vulnerabilities, and zero runtime dependencies. Install it if you prefer method-based path operations and need str-compatible path objects for legacy APIs. If you're already using pathlib and don't need str compatibility or custom subclassing, pathlib is the standard choice; otherwise, Path offers genuine advantages for filesystem scripting. ## Install pip install path uv add path poetry add path ## Installing path Before you install: Low friction installation with no runtime dependencies. Active maintenance as of 2026-04-13, last release 2025-07-27, and no known vulnerabilities. License in practice: MIT license permits commercial and private use with minimal restrictions; suitable for most projects. Quickstart: from path import Path d = Path("/home/user/bin") for f in d.files("*.py"): f.chmod(0o755) foo_txt = Path("bar") / "foo.txt" Requires Python 3.9 or later. Verify before relying: - Whether Path objects remain fully backward-compatible with pathlib.Path in all use cases. - Performance characteristics compared to pathlib for large directory traversals. ## Package facts - License: MIT (permissive) - Python support: supports_current - Install friction: low - Maintenance: active - Downloads: 1.3M/month (top 5,000 on PyPI) - Known vulnerabilities: none known ## Tags filesystem path objects, os.path wrapper, file operations on paths, path manipulation library, pathlib alternative, string-compatible path objects, file globbing and traversal, filesystem-operations, path-manipulation [View on SkillFed](https://skillfed.io/packages/path) · [View on PyPI](https://pypi.org/project/path/)