High-level utilities built on top of pathlib.
Project description
Pathplus
A modern Python library for file and directory management built on top of pathlib.
Goals
- Pythonic API
- Cross-platform
- Type-safe
- Well tested
Setup
pip install pathplus
Usage
from pathplus import FileManager, DirectoryManager
file = FileManager("example.txt")
print(file.hash())
print(file.hash("sha256"))
print(file.hashes())
print(file.size())
print(file.size_bytes())
print(file.read_text())
print(file.read_bytes()[:16])
print(file.preview(lines=3, max_chars=120))
print(file.info())
folder = DirectoryManager("project")
print(folder.tree())
print(folder.files())
print(folder.file_count())
print(folder.total_size())
print(folder.find("*.py"))
Features
- Compute file hashes with supported algorithms:
md5,sha256,sha512 - Compare files and verify known hash values
- Inspect file metadata including creation, modification, and access times
- List files in a directory recursively or non-recursively
- Count files and subdirectories
- Find files by glob pattern
- Report total directory size and largest files
Release Notes
V.0.2.0
- Added
FileManager.hashes()andFileManager.exists() - Added rich file metadata in
FileManager.info() - Added
FileManager.size_bytes()for raw byte size - Added
DirectoryManager.files(),file_count(),directory_count(),find(),largest_files(),total_size_bytes(), andis_empty() - Added
DirectoryManager.tree(include_empty_dirs=True) - Updated package metadata and tests
V.0.1.0
- File Hashing (SHA256, MD5, SHA512)
- File Information Helper
- Tree Information For Directories
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
pathplus-0.2.0.tar.gz
(6.6 kB
view details)
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file pathplus-0.2.0.tar.gz.
File metadata
- Download URL: pathplus-0.2.0.tar.gz
- Upload date:
- Size: 6.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
9d045caea40229148b5a28cee3ca95bc5cd13db1e557f4c082b7d696777ba3bf
|
|
| MD5 |
a33d0eebe7f3ab8be9cf7b8eb75d9296
|
|
| BLAKE2b-256 |
802d0f6ac462f445e9a75728e00f1b3c814ac6f3407ffd1d1798ae969a0b4c9c
|
File details
Details for the file pathplus-0.2.0-py3-none-any.whl.
File metadata
- Download URL: pathplus-0.2.0-py3-none-any.whl
- Upload date:
- Size: 6.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
5e3c485fb77c5c23dd0d0f2241ca4c1118a95dfdff7ac1437b193dacf3f5409d
|
|
| MD5 |
e3139dfd4348a2936cdadecff3254620
|
|
| BLAKE2b-256 |
c4e9fdf72bd467c13847f38e594ca3f12ba1a8262c8507e394324f16d8e1f2f2
|