FileSystemPro is a powerful, cross-platform Python toolkit for file and directory management, system monitoring, compression, and enhanced console output. It provides seamless abstractions for OS-specific paths, resource tracking (CPU, disks, memory, network), archive handling (tar/zip), change detection, and colored terminal styling. Built for developers, it integrates standard library tools with optional psutil for hardware insights, ensuring portability across Linux, macOS, and Windows.
Key Pillars:
- FileSystem Abstraction: OS-agnostic paths to user folders (e.g., Desktop, Documents).
- Resource Monitoring: Track CPU/memory/disks/network via
devicesubmodule. - File/Directory Ops: Creation, manipulation, enumeration, and integrity checks.
- Compression & Watching: Tar/zip handling and real-time filesystem change detection.
- Console Enhancement: ANSI colors/styles with Windows compatibility.
Compatibility: Python 3.10+; cross-platform (Linux/macOS/Windows).
Please note that this project is released with a Contributor Code of Conduct. By participating in this project you agree to abide by its terms.
- Python 3.10+ (download).
- Optional:
psutilfordevicemodule (pip install psutil).
Upgrade pip first:
pip install --upgrade pipInstall FileSystemPro:
pip install FileSystemProClone the repo:
git clone https://github.com/hbisneto/FileSystemPro.git
cd FileSystemProUpgrade build tools:
pip install --upgrade setuptools wheelNote: Requires setuptools 69.5.1+; wheel for packaging.
Run tests or build: See CONTRIBUTING.md.
Jump to module documentation for detailed APIs, examples, and best practices:
- FileSystem Module: OS detection and standard folder paths (
desktop,documents, etc.). - Core Module: Config management, logging, performance tuning, and update checks.
- Compression Module: Tar/zip creation, extraction, and reading.
- Directory Module: Path operations, creation/deletion, enumeration, timestamps, and tree views.
- File Module: I/O, integrity (SHA-256), copy/move, splitting, and timestamps.
- Watcher Module: Polling-based filesystem change detection with callbacks.
- Wrapper Module: Unified metadata dicts (paths, sizes, timestamps).
- Console Module: ANSI colors, backgrounds, and styles (chainable, Windows-compatible).
- Device Module: CPU/disks/memory/network monitoring (requires
psutil).
Import core modules:
import filesystem as fs # Paths
from filesystem import file, directory, compression # Ops
from filesystem import device # Monitoring (needs psutil)
from filesystem import console # Colored outputExample: List Downloads files with colors:
from filesystem import fs, file, console
files = file.get_files(fs.downloads)
for f in files:
size = file.get_size(f, show_unit=True)
print(console.green()(f) + f" ({size})")Monitor CPU:
import time
from filesystem import device
while True:
usage = device.cpu.cpu_percent()
print(console.red() if usage > 80 else console.green()(f"CPU: {usage}%"))
time.sleep(1)FileSystemPro follows a modular design:
- Core (
__core__): Config/logging/updates. - FileSystem: Entry point for paths.
- Ops (
file/directory/compression): Manipulation. - Monitoring (
watcher/device): Changes/resources. - Utilities (
wrapper/console): Metadata/styling.
See submodule READMEs for internals.
- Fork/clone the repo.
- Install dev deps:
pip install -e .[dev]. - Add tests in
tests/. - Run:
pytest/black ./flake8. - PR to
main.
Guidelines: CONTRIBUTING.md.
MIT License. See LICENSE.