--- id: pathlib-mate version: "1.3.2" license: MIT license_treatment: permissive maintenance: active --- # pathlib-mate — An extended and more powerful pathlib. License: permissive · Maintenance: active · Downloads: 1.9M/mo ## What it is and what it does pathlib_mate augments Python's standard pathlib.Path class with additional attributes and methods that make common filesystem operations more convenient. It adds shorthand accessors like `.basename`, `.fname`, `.ext`, `.dirpath` for path components, plus computed properties like `.size`, `.size_in_text`, `.md5`, `.sha256`, and `.sha512` for file metadata. It also provides methods to search directories by file type, extension, size, or custom filter; mutate paths via `.change()` to alter extensions, filenames, or directories; and perform file operations like atomic writes that guarantee either complete success or no change. The package is designed for developers who work frequently with filesystem paths and want to avoid repetitive path construction and validation. It supports Python 3.7 through 3.12 and runs on macOS, Windows, and Unix without external dependencies. The atomic write feature is particularly useful when writing large amounts of data and you need to ensure the file is never left in a partial or corrupted state. Use it for: - Batch rename or reorganize files by extension, size, or custom criteria across directory trees. - Compute file hashes and metadata (size, creation time) without writing separate utility functions. - Safely write configuration or data files with atomic operations to prevent corruption on failure. - Generate directory statistics and identify large files or directories for cleanup or archival. - Create backup archives with automatic naming and recursive directory handling. ## Worth the install? AI-flagged interpretation of the facts above — verify before relying. Extends Python's pathlib.Path with convenience attributes and methods for file operations, path manipulation, searching, and atomic writes. Yes. The package has no dependencies, low install friction, an MIT license, active maintenance, and no known vulnerabilities. It provides genuine convenience for filesystem work—especially atomic writes and path attribute shortcuts—without forcing you to learn a new API. Install it if you work with paths frequently and want to reduce boilerplate. ## Install pip install pathlib-mate uv add pathlib-mate poetry add pathlib-mate ## Installing pathlib-mate Before you install: Low friction: pure Python wheel with no runtime dependencies. Actively maintained with recent commits; last release was January 2024. License in practice: MIT license permits commercial and private use with minimal restrictions; you may use, modify, and distribute freely as long as you include the license notice. Quickstart: pip install pathlib_mate from pathlib import Path from pathlib_mate import PathMate p = Path("/Users/username/test.py") print(p.basename) # test.py print(p.fname) # test print(p.ext) # .py print(p.size_in_text) # human-readable size Verify before relying: - Whether the atomic write implementation matches the boltons library's guarantees or has known edge cases. - Performance characteristics when recursively searching large directory trees with custom filters. ## Package facts - License: MIT (permissive) - Python support: supports_current - Install friction: low - Maintenance: active - Downloads: 1.9M/month (top 5,000 on PyPI) - Known vulnerabilities: none known ## Tags pathlib extensions, path manipulation utilities, file search and filtering, atomic file writing, path attribute helpers, filesystem-utilities, path-manipulation [View on SkillFed](https://skillfed.io/packages/pathlib-mate) · [View on PyPI](https://pypi.org/project/pathlib-mate/)