π¬ AI-powered video file organizer that makes your media library beautiful
Getting Started β’ Features β’ Documentation β’ Development
- π€ AI-Powered Naming: Intelligently renames files using LLM technology
- π Smart Organization: Automatically moves files to appropriate directories
- π― Media Player Compatible: Ensures compatibility with Infuse, Plex, and more
- π Preview Changes: Dry-run option to review changes before applying
- π Simple CLI: Plain-text output with readable tables and progress updates
- πΊ Universal Support: Works with anime, movies, TV shows, and more
- π¨ Interactive UX: Confirmation prompts and concise status updates that work in any terminal
# Install AnimeLibrarian
pip install git+https://github.com/laipz8200/anime-librarian.git
# Set up your environment
cp .env.example .env
# Edit .env with your Dify API credentials
# Run with default settings
anime-librarian
# Or specify custom paths
anime-librarian --source ~/Downloads --target ~/Media# Preview only
anime-librarian --dry-run --format table
# Machine-readable output (newline-delimited JSON for streaming)
anime-librarian --dry-run --format json- Dify account
- Language model access through Dify
- AnimeLibrarian workflow in your Dify account
# Install directly from GitHub
pip install git+https://github.com/laipz8200/anime-librarian.git# Install uv if not already installed
curl -LsSf https://astral.sh/uv/install.sh | sh
# Clone the repository
git clone https://github.com/laipz8200/anime-librarian.git
cd anime-librarian
# Install dependencies with uv
uv sync# Clone the repository
git clone https://github.com/laipz8200/anime-librarian.git
cd anime-librarian
# Create a virtual environment
python -m venv .venv
source .venv/bin/activate # On Windows: .venv\Scripts\activate
# Install dependencies
pip install .- Sign up at Dify
- Configure your language model
- Import the workflow:
- Use DSL import
- Import
Anime Librarian.ymlfromDify DSL File
- Create an API key
- Copy API key and endpoint URL
Tip
Add a TMDB API key to enhance media identification accuracy!
-
Copy and edit the environment file:
cp .env.example .env
-
Update
.envvalues per the comments
ANIMELIBRARIAN_TARGET_PATH for optimal AI organization.
# Preview changes (dry run)
anime-librarian --dry-run
# View all options
anime-librarian --help- π Scans source directory for videos
- ποΈ Identifies existing media categories
- π€ AI analyzes filenames via Dify (with progress indicator)
- β¨ Generates standardized names
- π Shows proposed changes in a formatted table
- β Moves and renames with real-time progress bar
AnimeLibrarian now features a straightforward terminal interface:
- Clear Status Messages: Highlights successes, warnings, and errors with simple text cues
- Readable Tables: File moves displayed with plain ASCII tables and lists
- Progress Updates: Lightweight textual progress notifications keep you informed
- Smart Prompts: Interactive confirmation dialogs with sensible defaults
- Summary Panels: Operation summaries rendered in easy-to-scan text blocks
- Terminal Compatibility: Looks the same in basic terminals, CI logs, and remote shells
# Install uv package manager (if not already installed)
curl -LsSf https://astral.sh/uv/install.sh | sh
# Clone and setup
git clone https://github.com/laipz8200/anime-librarian.git
cd anime-librarian
# Install dependencies with uv
uv sync
# Install prek hooks (pre-commit alternative)
prek install# Run linting and formatting
make lint # Format code and fix issues
make format # Just format code
make check # Check code without fixes
# Run tests
make test # Run all tests
make test-mock # Run mock server tests only
pytest --cov # Run with coverage report
# Clean up
make clean # Remove generated filesThe project includes a comprehensive mock Dify server for testing without API access:
# Run integration tests with mock server
uv run pytest tests/test_integration_with_mock_server.py -v
# Use mock server in your tests
from tests.fixtures.mock_server_fixtures import run_mock_server
with run_mock_server() as server_url:
# Your test code here
passSee tests/README_MOCK_SERVER.md for detailed mock server documentation.
-
Pre-commit Hooks: Automatic code quality checks
- Linting (ruff)
- Formatting (ruff)
- Type checking (ty)
-
CI/CD: GitHub Actions workflow
- Code quality checks
- Test suite execution (98+ tests)
- Automated PR validation
-
Make Commands: Quick development tasks
make help # Show all available commands make lint # Run full linting make test # Run all tests
Common solutions for:
- π API Issues: Verify Dify credentials in
.env - π Access Errors: Check directory permissions
- π€ AI Problems: Validate Dify workflow setup
- π Organization: Ensure target directories exist
- π Testing: Use
--dry-runto preview changes - π Output: The tool now runs without generating log files
Contributions are welcome! Feel free to:
- π Report bugs
- π‘ Suggest features
- π§ Submit pull requests
