CLI tool to organize files by extension, fuzzy filename similarity, and semantic grouping
Project description
fileman
smartfileman is a powerful command-line tool that intelligently organizes files in your directories using multiple strategies:
- 📁 Extension-based grouping - Organize files by type (Images, Documents, Videos, etc.)
- 🔍 Fuzzy filename clustering - Group similar filenames using intelligent string matching
- 🧠 Semantic clustering - Use AI embeddings (via Ollama) to group files by content meaning
Installation
From PyPI (Recommended)
pip install smartfileman
Local development install
pip install .
Then run:
fileman --help
Requirements
- Python 3.9, 3.10, 3.11, or 3.12
- For semantic mode: Ollama must be installed and running
Usage
Basic Usage
Organize files in a directory by extension:
fileman organize-files --dir /path/to/folder
Common Options
| Option | Short | Description |
|---|---|---|
--dir |
-d |
Source directory to organize (default: current directory) |
--interactive |
-i |
Prompt for custom folder names |
--raw |
-R |
Use fuzzy filename clustering |
--semantic |
-s |
Use AI-powered semantic grouping |
--preview |
-p |
Preview grouping without moving files |
--recursive |
-r |
Organize files in subdirectories |
--eliminate-duplicates |
--ed |
Remove duplicate files |
Examples
Preview before organizing:
fileman organize-files --dir ~/Downloads --preview
Organize with fuzzy clustering:
fileman organize-files --dir ~/Documents --raw
AI-powered semantic organization:
fileman organize-files --dir ~/Projects --semantic
Interactive mode with custom folder names:
fileman organize-files --dir ~/Desktop --interactive
Semantic Mode
Semantic mode uses Ollama to generate embeddings from file content and cluster files by meaning. It automatically:
- Checks for required models (
embeddinggemma,llama3.2) - Prompts to download missing models
- Extracts text from PDFs, DOCX, PPTX, TXT, MD, and more
- Clusters files using K-Means on combined title + content embeddings
Installing Ollama
- Download from ollama.ai
- Install and start the Ollama service
- Run
filemanwith--semanticflag - missing models will be auto-downloaded
Supported File Types
| Category | Extensions |
|---|---|
| Images | jpg, png, webp |
| Videos | mp4, mkv |
| Audio | mp3, wav |
| Archives | tar, zip, xz |
| Documents | pdf, docx, pptx, md |
Development
# Clone the repository
git clone https://github.com/yourusername/smartfileman.git
cd smartfileman
# Create virtual environment
python -m venv .venv
source .venv/bin/activate # On Windows: .venv\Scripts\activate
# Install with dev dependencies
pip install -e ".[dev]"
# Run the CLI
fileman --help
Publishing
# Build distribution
python -m build
# Upload to PyPI
twine upload dist/*
License
MIT License - see LICENSE for details.
Contributing
Contributions welcome! Please open an issue or submit a PR.
Project details
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 smartfileman-0.1.2.tar.gz.
File metadata
- Download URL: smartfileman-0.1.2.tar.gz
- Upload date:
- Size: 11.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.10.12 {"installer":{"name":"uv","version":"0.10.12","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Fedora Linux","version":"43","id":"","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
c9b78e4fa2df2cd3c647a996556bf3782a5e1f57da7c69b4562320bb692e4b1d
|
|
| MD5 |
ff6d8966a73cc64cd49c5ee70b2a7d00
|
|
| BLAKE2b-256 |
20664f40c3d37f1721cdccea3687930c564a9fbe3227d7791892c959c1fb85b7
|
File details
Details for the file smartfileman-0.1.2-py3-none-any.whl.
File metadata
- Download URL: smartfileman-0.1.2-py3-none-any.whl
- Upload date:
- Size: 11.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.10.12 {"installer":{"name":"uv","version":"0.10.12","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Fedora Linux","version":"43","id":"","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
87c8af09eeb60d1d609e8bcfa1c159284034b051e95b44f7ee11c56f00738b02
|
|
| MD5 |
15f288fa2a69ae02f9193d5e8787add1
|
|
| BLAKE2b-256 |
c3f728b912dae395909049af3ca9b4747ff6b97c8d8218ae8b0faf85ffd4173e
|