{"id":28072688,"url":"https://github.com/laipz8200/anime-librarian","last_synced_at":"2025-11-03T16:06:55.969Z","repository":{"id":292054553,"uuid":"979676601","full_name":"laipz8200/anime-librarian","owner":"laipz8200","description":"A command-line tool that uses AI to rename and organize video files.","archived":false,"fork":false,"pushed_at":"2025-06-10T23:28:49.000Z","size":154,"stargazers_count":13,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-06-11T00:28:31.411Z","etag":null,"topics":["ai","anime","dify","rename","video"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/laipz8200.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":".github/CODEOWNERS","security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2025-05-07T22:29:55.000Z","updated_at":"2025-06-10T23:28:52.000Z","dependencies_parsed_at":"2025-05-12T21:17:45.590Z","dependency_job_id":null,"html_url":"https://github.com/laipz8200/anime-librarian","commit_stats":null,"previous_names":["laipz8200/anime-librarian"],"tags_count":3,"template":false,"template_full_name":null,"purl":"pkg:github/laipz8200/anime-librarian","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/laipz8200%2Fanime-librarian","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/laipz8200%2Fanime-librarian/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/laipz8200%2Fanime-librarian/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/laipz8200%2Fanime-librarian/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/laipz8200","download_url":"https://codeload.github.com/laipz8200/anime-librarian/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/laipz8200%2Fanime-librarian/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":261984644,"owners_count":23240302,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["ai","anime","dify","rename","video"],"created_at":"2025-05-12T21:17:39.062Z","updated_at":"2025-11-03T16:06:55.957Z","avatar_url":"https://github.com/laipz8200.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003cdiv align=\"center\"\u003e\n\n# AnimeLibrarian\n\n[![Code Quality](https://github.com/laipz8200/anime-librarian/actions/workflows/code-quality.yml/badge.svg)](https://github.com/laipz8200/anime-librarian/actions/workflows/code-quality.yml)\n[![Python 3.13](https://img.shields.io/badge/python-3.13-blue.svg)](https://www.python.org/downloads/release/python-3130/)\n[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)\n\n🎬 AI-powered video file organizer that makes your media library beautiful\n\n[Getting Started](#-quick-start) • [Features](#-key-features) • [Documentation](#-documentation) • [Development](#-development)\n\n![anime-librarian-preview](https://github.com/user-attachments/assets/8e7cd70f-bf70-4dd4-8c05-745287e368e1)\n\n\u003c/div\u003e\n\n______________________________________________________________________\n\n## ✨ Key Features\n\n- 🤖 **AI-Powered Naming**: Intelligently renames files using LLM technology\n- 📁 **Smart Organization**: Automatically moves files to appropriate directories\n- 🎯 **Media Player Compatible**: Ensures compatibility with Infuse, Plex, and more\n- 🔍 **Preview Changes**: Dry-run option to review changes before applying\n- 🚀 **Simple CLI**: Plain-text output with readable tables and progress updates\n- 📺 **Universal Support**: Works with anime, movies, TV shows, and more\n- 🎨 **Interactive UX**: Confirmation prompts and concise status updates that work in any terminal\n\n## 🚀 Quick Start\n\n```bash\n# Install AnimeLibrarian\npip install git+https://github.com/laipz8200/anime-librarian.git\n\n# Set up your environment\ncp .env.example .env\n# Edit .env with your Dify API credentials\n\n# Run with default settings\nanime-librarian\n\n# Or specify custom paths\nanime-librarian --source ~/Downloads --target ~/Media\n```\n\n### UNIX-Friendly Modes\n\n```bash\n# Preview only\nanime-librarian --dry-run --format table\n\n# Machine-readable output (newline-delimited JSON for streaming)\nanime-librarian --dry-run --format json\n```\n\n## 📋 Prerequisites\n\n- [Dify](https://cloud.dify.ai) account\n- Language model access through Dify\n- AnimeLibrarian workflow in your Dify account\n\n## 🛠️ Installation\n\n### Using pip (for users)\n\n```bash\n# Install directly from GitHub\npip install git+https://github.com/laipz8200/anime-librarian.git\n```\n\n### Using uv (recommended for development)\n\n```bash\n# Install uv if not already installed\ncurl -LsSf https://astral.sh/uv/install.sh | sh\n\n# Clone the repository\ngit clone https://github.com/laipz8200/anime-librarian.git\ncd anime-librarian\n\n# Install dependencies with uv\nuv sync\n```\n\n### Traditional pip setup\n\n```bash\n# Clone the repository\ngit clone https://github.com/laipz8200/anime-librarian.git\ncd anime-librarian\n\n# Create a virtual environment\npython -m venv .venv\nsource .venv/bin/activate  # On Windows: .venv\\Scripts\\activate\n\n# Install dependencies\npip install .\n```\n\n## 📖 Documentation\n\n### Dify Workflow Setup\n\n1. Sign up at [Dify](https://cloud.dify.ai)\n1. Configure your language model\n1. Import the workflow:\n   - Use DSL import\n   - Import `Anime Librarian.yml` from `Dify DSL File`\n1. Create an API key\n1. Copy API key and endpoint URL\n\n\u003e [!TIP]\n\u003e Add a TMDB API key to enhance media identification accuracy!\n\n### Configuration\n\n1. Copy and edit the environment file:\n\n   ```bash\n   cp .env.example .env\n   ```\n\n1. Update `.env` values per the comments\n\n⚠️ **Important**: Create media category subdirectories in your `ANIMELIBRARIAN_TARGET_PATH` for optimal AI organization.\n\n### Advanced Usage\n\n```bash\n# Preview changes (dry run)\nanime-librarian --dry-run\n\n# View all options\nanime-librarian --help\n```\n\n## 🔄 How It Works\n\n1. 📂 Scans source directory for videos\n1. 🗂️ Identifies existing media categories\n1. 🤖 AI analyzes filenames via Dify (with progress indicator)\n1. ✨ Generates standardized names\n1. 📝 Shows proposed changes in a formatted table\n1. ✅ Moves and renames with real-time progress bar\n\n## 🎨 Enhanced User Experience\n\nAnimeLibrarian now features a straightforward terminal interface:\n\n- **Clear Status Messages**: Highlights successes, warnings, and errors with simple text cues\n- **Readable Tables**: File moves displayed with plain ASCII tables and lists\n- **Progress Updates**: Lightweight textual progress notifications keep you informed\n- **Smart Prompts**: Interactive confirmation dialogs with sensible defaults\n- **Summary Panels**: Operation summaries rendered in easy-to-scan text blocks\n- **Terminal Compatibility**: Looks the same in basic terminals, CI logs, and remote shells\n\n## 👩‍💻 Development\n\n### Setup Development Environment\n\n```bash\n# Install uv package manager (if not already installed)\ncurl -LsSf https://astral.sh/uv/install.sh | sh\n\n# Clone and setup\ngit clone https://github.com/laipz8200/anime-librarian.git\ncd anime-librarian\n\n# Install dependencies with uv\nuv sync\n\n# Install prek hooks (pre-commit alternative)\nprek install\n```\n\n### Development Workflow\n\n```bash\n# Run linting and formatting\nmake lint                 # Format code and fix issues\nmake format              # Just format code\nmake check               # Check code without fixes\n\n# Run tests\nmake test                # Run all tests\nmake test-mock           # Run mock server tests only\npytest --cov             # Run with coverage report\n\n# Clean up\nmake clean               # Remove generated files\n```\n\n### Testing with Mock Server\n\nThe project includes a comprehensive mock Dify server for testing without API access:\n\n```bash\n# Run integration tests with mock server\nuv run pytest tests/test_integration_with_mock_server.py -v\n\n# Use mock server in your tests\nfrom tests.fixtures.mock_server_fixtures import run_mock_server\n\nwith run_mock_server() as server_url:\n    # Your test code here\n    pass\n```\n\nSee `tests/README_MOCK_SERVER.md` for detailed mock server documentation.\n\n### Quality Assurance\n\n- **Pre-commit Hooks**: Automatic code quality checks\n\n  - Linting (ruff)\n  - Formatting (ruff)\n  - Type checking (ty)\n\n- **CI/CD**: GitHub Actions workflow\n\n  - Code quality checks\n  - Test suite execution (98+ tests)\n  - Automated PR validation\n\n- **Make Commands**: Quick development tasks\n\n  ```bash\n  make help     # Show all available commands\n  make lint     # Run full linting\n  make test     # Run all tests\n  ```\n\n## 🔍 Troubleshooting\n\nCommon solutions for:\n\n- 🔑 **API Issues**: Verify Dify credentials in `.env`\n- 📁 **Access Errors**: Check directory permissions\n- 🤖 **AI Problems**: Validate Dify workflow setup\n- 📂 **Organization**: Ensure target directories exist\n- 🔍 **Testing**: Use `--dry-run` to preview changes\n- 📝 **Output**: The tool now runs without generating log files\n\n## 🤝 Contributing\n\nContributions are welcome! Feel free to:\n\n- 🐛 Report bugs\n- 💡 Suggest features\n- 🔧 Submit pull requests\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flaipz8200%2Fanime-librarian","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flaipz8200%2Fanime-librarian","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flaipz8200%2Fanime-librarian/lists"}