skillfed

pathlib-mate

An extended and more powerful pathlib.

pathlib-mate v1.3.2 1.9M downloads/30d#3,462 on PyPI9
Permissive license MIT Active released

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

uv

uv add pathlib-mate

poetry

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

Development Status :: 4 - BetaIntended Audience :: DevelopersLicense :: OSI Approved :: MIT LicenseNatural Language :: EnglishOperating System :: MacOSOperating System :: Microsoft :: WindowsOperating System :: UnixProgramming Language :: PythonProgramming Language :: Python :: 3 :: OnlyProgramming Language :: Python :: 3.10Programming Language :: Python :: 3.11Programming Language :: Python :: 3.12Programming Language :: Python :: 3.7Programming Language :: Python :: 3.8Programming Language :: Python :: 3.9

Tags

pathlib extensionspath manipulation utilitiesfile search and filteringatomic file writingpath attribute helpers
filesystem-utilitiespath-manipulation

More Utilities packages