A modern Python implementation of the Yandex Disk file manager integration with enhanced error handling, batch processing, and multi-platform support.
📚 Documentation: For installation examples and troubleshooting, see Usage Guide. For project overview, see Main README.
- Batch Operations: Intelligent batch processing with two strategies:
- One-by-One: Publish/save operations with progress notifications and link collection
- All-at-Once: Optimized file copy/move operations for maximum efficiency
- Error Recovery: Continue processing remaining items when some fail
- Rollback Support: Automatic rollback of operations when errors occur
- Conflict Resolution: Smart auto-renaming with
_numbersuffix pattern
- Type Safety: Full type hints for better IDE support and reliability
- Modular Design: Clean separation of concerns with dedicated classes
- Configuration Management:
.envfile-based configuration with dotenv - CLI Framework: Built on Click for robust command-line interface
- Cross-Platform: Automatic X11/Wayland clipboard detection via pyclip
- Comprehensive Logging: Detailed operation tracking with verbose mode
- Service Readiness: Waits for yandex-disk daemon before operations
- Input Validation: Robust file path and parameter validation
- Graceful Degradation: Fallback mechanisms for missing dependencies
- Desktop Environment:
- KDE with Dolphin file manager (primary support)
- GNOME/GTK [Beta] with Files/Nautilus, Nemo, Caja, or Thunar
- yandex-disk daemon installed and running
- Notifications: kdialog (KDE) or notify-send (GNOME and others)
- Clipboard utilities:
- xclip - For X11 environments
- wl-clipboard - For Wayland environments
- Python 3.8+
- Python venv - python3-venv package (naming varies by distribution)
- Python 3.8+ with type hints support
- Virtual Environment: Isolated dependency management
- Platform: Linux (X11/Wayland session support)
click >= 8.0.0 # CLI framework with decorators
pyclip >= 0.7.0 # Cross-platform clipboard (X11/Wayland auto-detect)
python-dotenv >= 1.0.0 # Environment variable management- yandex-disk daemon: Core cloud storage functionality
- Notifications: Desktop-aware (kdialog/notify-send)
- File Managers: See file manager support matrix
📦 Installation: See Usage Guide for complete installation examples and file manager-specific setup.
Main Script (ydmenu.py)
- CLI entry point with Click decorators
- Command routing and parameter validation
- Error handling and logging coordination
YandexDiskMenu Class
- Core business logic and file operations
- yandex-disk daemon interaction
- Clipboard and notification management
Environment Wrapper (ydmenu-py-env)
- Virtual environment activation
- Production deployment wrapper
- PATH resolution and error handling
Setup Script (setup.py)
- Installation and configuration management
- Desktop file generation from templates
- Environment variable setup
File Manager → ydmenu-py-env → venv/bin/python ydmenu.py → YandexDiskMenu Class
↓
yandex-disk daemon
↓
Yandex Cloud Storage
Environment Variables (via .env)
YA_DISK_ROOT="~/Public" # Parent directory for Yandex Disk
YADISK_MENU_VERSION="1.6.4" # Version trackingRuntime Configuration
- Auto-discovery of yandex-disk paths
- Desktop environment detection
- Session type detection (X11/Wayland)
Developer-facing details have moved to the dedicated Developer Guide: see doc/DEVELOPMENT.md.
# Direct Python usage (development)
./ydmenu.py --help
./ydmenu.py --verbose PublishToYandexCom file.txt
# Production usage (via wrapper)
ydmenu-py-env PublishToYandex file.txt
ydmenu-py-env ClipboardToStream# Multiple file publishing
ydmenu-py-env PublishToYandexCom file1.txt file2.txt file3.txt
# Directory operations
ydmenu-py-env FileAddToStream /path/to/directory
# Mixed operations with error recovery
ydmenu-py-env FileMoveToStream file1.txt missing_file.txt file3.txt
# → Continues with file3.txt even if missing_file.txt fails# Enable verbose output
ydmenu-py-env --verbose PublishToYandex file.txt
# Check logs
tail -f $YA_DISK_ROOT/yaMedia-python.log| Feature | Shell Version | Python Version |
|---|---|---|
| Error Handling | Basic | Comprehensive with recovery |
| Batch Processing | Limited | Full support with strategies |
| Logging | Simple | Detailed with levels |
| Configuration | Environment vars | .env + environment vars |
| Testing | None | 112 unit tests |
| Type Safety | None | Full type hints |
- Install Python version:
make install && make configure-skip-env - Test functionality: Verify both versions work
- Gradual transition: Use Python for new workflows
- Remove shell version: When satisfied with Python version
- Shared configuration: Both versions use same environment variables
- Shared logging directory: Different log files, same location
- Shared menu structure: Similar user experience
For full testing, CI/CD, and quality control details, see doc/DEVELOPMENT.md.
- Main README - Project overview and file manager support matrix
- Usage Guide - Installation examples and troubleshooting
- Additional Documentation - Technical implementation details:
💡 Contributing: When modifying Python code, always run
make testto ensure compatibility and maintain test coverage. See development workflow guidelines in project documentation.