This project is part of Module 122: Automating Processes with a Scripting Language.
The goal of this project is to automate the organization of downloaded school files. The application scans a configured folder, extracts module identifiers from filenames (for example M122), categorizes files automatically, and moves them into the correct module folders.
The automation reduces repetitive manual work, improves organization, minimizes mistakes, and demonstrates software engineering concepts such as modular architecture, UML design, logging, error handling, configuration systems, graphical interfaces, and testing.
- Automatic file detection
- Filename parsing and module extraction
- Dynamic module-folder mapping
- Configurable subfolder naming
- Automatic folder creation
- Duplicate file handling (
_V2,_V3, ...) - Structured logging system
- Error handling and validation
- Environment variable configuration
- Modular Python architecture
- Configurable project setup
- Graphical User Interface (GUI)
- Progress bar with live status updates
- Custom executable (.exe) support
- Python 3
- Tkinter GUI
- Filesystem operations
- Python logging module
- Environment variables
- JSON configuration
- Git & GitHub
- python-dotenv
- PyInstaller
project-root/
│
├── assets/
│ └── icon.ico
│
├── docs/
│ ├── requirements/
│ ├── design/
│ │ ├── diagrams/
│ │ └── architecture/
│ │
│ └── testing/
│
├── src/
│ ├── main.py
│ ├── gui.py
│ ├── detector.py
│ ├── parser.py
│ ├── logger.py
│ ├── config.py
│ └── mover.py
│
├── config/
│ └── module_mapping.json
│
├── tests/
├── logs/
│
├── input/ (development/testing only)
├── output/ (development/testing only)
│
├── README.md
├── requirements.txt
├── .env.example
├── .gitignoreThe application uses environment variables and JSON configuration.
Example:
DOWNLOADS_PATH=./input
LOG_PATH=./logs
DEFAULT_UNKNOWN_PATH=./output/unknown
MAPPING_FILE=./config/module_mapping.jsonExample:
{
"modules": {
"M122":"./output/M122",
"M123":"./output/M123",
"M114":"./output/M114"
},
"subfolders": {
"exercise":"Exercises",
"theory":"Theory",
"code":"Code"
}
}git clone <repository-url>cd file-automation-scriptpip install -r requirements.txtCopy:
.env.exampleto:
.envAdjust the paths if necessary.
Run the application:
python src/main.pyRun:
python src/gui.pyThe GUI provides:
- Start sorting button
- File processing list
- Progress bar
- Status updates
- Error messages
- Sorting summary
Build executable:
pyinstaller --onefile --windowed --icon=assets/icon.ico --name="M122 File Organizer" src/gui.pyExecutable output:
dist/
└── M122 File Organizer.exe- Scan configured input directory
- Detect files
- Extract module identifier
- Resolve module destination
- Categorize files automatically
- Create folders if needed
- Handle duplicate filenames
- Move files
- Write logs
- Display results
M122/
├── Exercises/
│ └── LB01.docx
│
├── Theory/
│ └── Notes.pdf
│
├── Code/
│ └── project.py
│
└── random.zipProject documentation includes:
- Requirements analysis
- UML activity diagram
- UML component diagram
- Design documentation
- Parsing documentation
- Error handling strategy
- Logging architecture
- Configuration system
- Test protocol
Test cases and testing documentation:
tests/
docs/testing/Nikola
GIBZ Informatik Module 122 – Automating Processes with a Scripting Language