A fast, intelligent file copier/mover with hashing, filters, conflict resolution, and backup support — built for power users.
Project description
Fylex: Your Intelligent File & Directory Orchestrator
Fylex is a fast, reliable, and intelligent file management tool written in Python.
It goes beyond cp, mv, or rsync by offering smart conflict resolution, data integrity verification, undo support, and detailed logging — all in one package.
📊 Comparison with Other Tools
| Feature / Tool | cp / mv (Unix) |
rsync (Unix) |
Robocopy (Windows) | Fylex |
|---|---|---|---|---|
| Conflict resolution | ❌ Overwrites only | ⚠️ Basic (--ignore-existing, --update) |
⚠️ Some options | ✅ Multiple modes (rename, skip, replace, newer, larger, etc.) |
| Atomic operations | ❌ | ❌ | ❌ | ✅ Safe temp + replace |
| Undo support | ❌ | ❌ | ❌ | ✅ Rollback via process ID |
| Duplicate detection | ❌ | ❌ | ❌ | ✅ By size/extension + hash |
| Hash verification | ❌ | ✅ (with --checksum) |
❌ | ✅ (xxhash, blake3, sha256, etc.) |
| Metadata preservation | ✅ (basic: mtime) | ✅ (mtime, perms, owner, xattrs) | ✅ (NTFS ACLs) | ✅ (mtime, ownership, xattrs, ACLs) |
| Logging | ❌ | ✅ (basic logs) | ✅ (detailed logs) | ✅ Detailed JSON/JSONL + summaries |
| Dry run mode | ❌ | ✅ | ✅ | ✅ |
| Performance | ✅ Very fast | ✅ Optimized for sync | ✅ Multi-threaded | ✅ Optimized with adaptive buffer + fast hash |
Table of Contents
Introduction
Managing files is often more complex than it looks. Simple copy/move commands can quickly become dangerous when conflicts, duplicates, or errors occur.
Fylex provides a safe, intelligent alternative with:
- atomic operations,
- duplicate detection,
- metadata preservation,
- flexible conflict handling, and
- undo functionality for peace of mind.
It’s designed for developers, sysadmins, and power users who demand speed, safety, and reliability.
Key Features
-
⚡ Atomic File Operations Files are written to a temporary path and only moved into place after a successful transfer.
-
🧠 Smart Conflict Resolution Choose from strategies like
rename,skip,replace,larger,newer, etc. -
🧬 Duplicate Detection Detect duplicates by size/extension, then confirm with fast hashing (
xxhash,blake3,md5,sha256,sha512). -
🔒 Data Integrity Verification Optional
--verifymode ensures source and destination files are bit-for-bit identical. -
📂 Metadata Preservation Preserves timestamps, ownership, extended attributes, and ACLs when supported.
-
↩️ Undo Support Every operation is logged to JSON. You can roll back with a simple
undo(process_id). -
📊 Rich Logging JSONL and human-readable logs capture every operation for audit and rollback.
Installation
Requirements
-
Python 3.8+
-
Optional hash libraries:
pip install blake3 xxhash
-
Linux users:
attrandaclpackages for xattr/ACL preservation.
Install via pip
pip install fylex
Usage
You can use Fylex as a Python library or via its CLI (fylex copy, fylex move, fylex undo).
Core Functions
filecopy
fylex.filecopy(src, dest, resolve="rename", verify=False, dry_run=False, ...)
Copies files/directories with intelligent conflict handling.
src: Source file or directorydest: Destination directoryresolve: Conflict mode (see below)verify: Verify integrity via hash comparisondry_run: Simulate without making changes
filemove
fylex.filemove(src, dest, resolve="rename", verify=False, dry_run=False, ...)
Moves files safely with rollback protection.
undo
fylex.undo(p_id, force=False)
Reverts a previous operation using its process ID.
Common Parameters
resolve: How to handle conflicts (rename,skip,replace, etc.)algo: Hashing algorithm (xxhash,blake3,md5,sha256,sha512)recurse: Traverse subdirectoriessummary: Write a copy offylex.logto a summary fileverbose: Stream logs to console
Conflict Resolution Modes
larger: Keep the larger filesmaller: Keep the smaller filenewer: Keep the newer fileolder: Keep the older filerename: Rename with suffix (file (1).txt)skip: Skip operationreplace: Replace destination fileprompt: Ask user
Examples
from pathlib import Path
import fylex
src = Path("docs")
dest = Path("backup")
# Copy files with renaming and verification
fylex.filecopy(src, dest, resolve="rename", verify=True, recurse=True, verbose=True)
# Move only text files, keep newer versions
fylex.filemove(src, dest, match_names="notes.txt", resolve="newer", verify=True)
# Undo an operation
fylex.undo("1001")
Comparison with Other Tools
cp/mv: Fast but no safety, conflict handling, or undo.rsync: Great for remote sync, but Fylex is better for local integrity + undo.- Robocopy: Windows-only, no cross-platform undo.
Fylex advantage: atomic safety, undo, hash verification, cross-platform support.
Error Handling & Robustness
- Automatic retries (up to 5) on hash mismatches
- Logging of every failure, warning, or skipped file
- Safeguards prevent source/destination mix-ups
Logging
- Logs to
fylex.log+ per-process JSONL/JSON - Includes operations, hashes, timestamps, dry-run info
verbose=True: streams logs to consolesummary="logfile.log": export a clean copy of log
Development & Contributing
- Fork the repo
- Create a branch (
feature/my-feature) - Commit with clear messages
- Submit PR
Contributions welcome — from bug fixes to feature requests!
License
Released under MIT License. xxHash is under BSD License.
Author
Sivaprasad Murali 📧 sivaprasad.off@gmail.com
✨ With Fylex, file management becomes safe, reversible, and intelligent.
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
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 fylex-0.8.1.tar.gz.
File metadata
- Download URL: fylex-0.8.1.tar.gz
- Upload date:
- Size: 19.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.12.4
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
6a1855691f36014b9e223b3b3c18a6aff02d081dedfd0974e4b7f043e176cd6b
|
|
| MD5 |
b14fb14b0b0b002a02e7d2e44a7e817c
|
|
| BLAKE2b-256 |
a8c825899cd2981c5654dae5589907cf7a3b4a1def87b5a56c2b42e69185449e
|
File details
Details for the file fylex-0.8.1-py3-none-any.whl.
File metadata
- Download URL: fylex-0.8.1-py3-none-any.whl
- Upload date:
- Size: 16.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.12.4
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
854f9aa073b02bfd4f8a6a8db76d7a684bef23a4be5e66e08140ed5bce47ca37
|
|
| MD5 |
05beff2514cbe959f9f33c995c0dde3d
|
|
| BLAKE2b-256 |
5c229bc6e7e02e8731bd820bda88f22a5a9d358f957ae4e204f1a806e86d5e11
|