PROJECT 32Beginner
Desktop Cleaner Automation
Business scenario
Analysts' Downloads and Desktop folders fill with exports. Files get lost and old reports are reused by mistake.
Problem statement
Write a safe Python script that organises files into dated folders by type, never deletes, and logs every action.
Learning objectives
- Use pathlib and shutil safely
- Implement a dry-run mode
- Log and handle errors
Instructions
Rules: move files older than N days into Archive/YYYY-MM/<type>/; type from extension map; skip open/locked files; never overwrite (append suffix); --dry-run prints actions only. Test on a generated sample folder, not your real Desktop.
Tasks
- Sample folder generator.
- Cleaner with CLI arguments.
- Logging to file.
- Tests for name collisions and permissions.
- Scheduling instructions (Task Scheduler / cron).
Deliverables
- Python script
- Log sample
- README
Evaluation rubric
| Criterion | Weight | Excellent | Proficient | Developing | Insufficient |
|---|---|---|---|---|---|
| Safety | 30% | Dry run, no deletion, no overwrite, tested. | Correct and complete with minor gaps in rigour or presentation. | Partly correct; important steps missing, unvalidated or unclear. | Missing, incorrect, or not supported by the data. |
| Correctness | 25% | Rules implemented exactly. | Correct and complete with minor gaps in rigour or presentation. | Partly correct; important steps missing, unvalidated or unclear. | Missing, incorrect, or not supported by the data. |
| Error handling & logging | 20% | Comprehensive. | Correct and complete with minor gaps in rigour or presentation. | Partly correct; important steps missing, unvalidated or unclear. | Missing, incorrect, or not supported by the data. |
| Documentation | 15% | Clear. | Correct and complete with minor gaps in rigour or presentation. | Partly correct; important steps missing, unvalidated or unclear. | Missing, incorrect, or not supported by the data. |
| Code quality | 10% | Readable, structured. | Correct and complete with minor gaps in rigour or presentation. | Partly correct; important steps missing, unvalidated or unclear. | Missing, incorrect, or not supported by the data. |