pathlib-mate
An extended and more powerful pathlib.
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 on this page — 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
pathlib-mate on PyPI
pip
pip install pathlib-mateuv
uv add pathlib-matepoetry
poetry add pathlib-mateInstalling 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 the current Python release (>=3.7) |
| Install friction | low — pure-Python wheel |
| Runtime dependencies | none |
| Maintenance | actively maintained — 935 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 1,887,696/month — #3,462 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: pathlib_mate-1.3.2-py3-none-any.whl
Tags
More Utilities packages
Converts domain names between Unicode and…
permissive · top 100 on PyPI
charset-normalizerDetects and normalizes text encoding from…
permissive · top 100 on PyPI
setuptoolsSetuptools is a Python build backend and…
permissive · top 100 on PyPI
pluggyPluggy provides a plugin system that lets you…
permissive · top 100 on PyPI
PygmentsPygments is a syntax highlighter that colorizes…
permissive · top 100 on PyPI
sixSix provides utility functions to write Python…
permissive · top 100 on PyPI
pathlib3xBackport of Python 3.11 pathlib to Python 3.8+…
permissive · top 15,000 on PyPI
pathmagicProvides File and Dir classes that wrap…
permissive · top 15,000 on PyPI
provide-dirCreates a directory and all its parent…
permissive · top 15,000 on PyPI
pathlib-abcProvides abstract base classes for implementing…
permissive · top 1,000 on PyPI
artifactoryProvides a pathlib-like Python interface for…
permissive · top 15,000 on PyPI
atomicwritesProvides a context manager for writing files…
permissive · top 5,000 on PyPI
atomicwrites-homeassistantProvides atomic file writes that ensure a file…
permissive · top 15,000 on PyPI
handy-archivesProvides utility functions for working with…
permissive · top 15,000 on PyPI
pathProvides Path objects that wrap filesystem…
permissive · top 5,000 on PyPI
pathlib2Backport of Python's standard pathlib module…
permissive · top 5,000 on PyPI