Skip to content
OrionStats
← Project Lab
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

  1. Sample folder generator.
  2. Cleaner with CLI arguments.
  3. Logging to file.
  4. Tests for name collisions and permissions.
  5. Scheduling instructions (Task Scheduler / cron).

Deliverables

  • Python script
  • Log sample
  • README

Evaluation rubric

CriterionWeightExcellentProficientDevelopingInsufficient
Safety30%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.
Correctness25%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 & logging20%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.
Documentation15%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 quality10%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.