How sukitsubaki/nomino works
Project Type and Its Core Purpose
• Nomino is a command-line utility tool focused on file renaming with multiple strategies. It’s not a full-stack web app but rather a utility that manipulates files based on user-selected strategies.
• The README highlights multiple renaming strategies (e.g., numbering, text addition/removal, regex, EXIF-based, restructuring, sorting) along with features like preview and undo.
Understand the File Structure
• The top-level directories and files include:
• LICENSE & README.md: Project documentation.
• src: The main source directory containing all code.
• Within src, key files include:
• main.py: The application’s entry point.
• cli.py: Handles menu-driven user interaction.
• file_utils.py: Manages file operations (renaming, filtering).
• log_utils.py: Manages logging of file operations and supports undo functionality.
• progress.py: Displays a progress indicator during file operations.
• exif_utils.py: Extracts EXIF data, crucial for photo renaming.
• The directory src/rename_strategies contains various modules:
• exif_rename.py, numbering.py, regex_rename.py, restructuring.py, sorting.py, strategy_handler.py, text_addition.py, text_removal.py – each implementing a different renaming strategy.
Main Components
• User Interface Layer: Represented by the CLI component (cli.py) which interacts directly with the user.
• Application Core:
• Main entry point (main.py) that orchestrates operations.
• Strategy Handler (strategy_handler.py) within the rename_strategies folder, which likely acts as a mediator dispatching to the appropriate renaming module.
• File Operations and Utilities:
• file_utils.py for core file handling.
• log_utils.py to record operations and manage undo functionality.
• progress.py to provide real-time feedback during operations.
• exif_utils.py specifically for handling image file metadata.
• Renaming Strategies:
• Them under a “Renaming Strategies” component, listing each strategy (e.g., numbering, regex, text addition/removal, EXIF, restructuring, sorting) as sub-components.
Visualizing Relationships and Data Flow
• From main.py, show connections to:
• The appropriate renaming strategy module based on user input (via the strategy handler).
• Utility modules that support file operations (file_utils.py) and logging (log_utils.py).
• Progress.py as an auxiliary component that receives updates from main.py during long-running operations.
Architectural Patterns
• Modularity: Each renaming strategy is implemented in isolation within its own file.
• Separation of Concerns: The CLI handles user interactions, main.py coordinates overall flow, while file operations, logging, and progress tracking are delegated to specific utility modules.
• Extendability: The strategy_handler and separate modules allow easy addition of new renaming strategies.
Including Relevant Technologies and Design Principles
• Use technologies/libraries as mentioned in the README (Python 3.x, and Pillow for EXIF-related functions).