Project Overview
Build a professional command-line To-Do application that demonstrates your Python skills with file handling, data structures, object-oriented programming, and working with real dataset for productivity analytics. Your app will store tasks persistently in JSON format and include features like categories, priorities, due dates, and task statistics.
What You Will Build
A fully functional CLI task manager that runs in the terminal:
$ python todo.py
==============================================
TASKMASTER - CLI To-Do Application
==============================================
[1] Add New Task [5] Mark Complete
[2] View All Tasks [6] Delete Task
[3] View by Category [7] Task Statistics
[4] View by Priority [8] Import Tasks
[9] Export Tasks [0] Exit
Choose an option: 1
--- Add New Task ---
Title: Complete Python project
Category (work/personal/study/health): study
Priority (high/medium/low): high
Due date (YYYY-MM-DD or leave blank): 2025-01-20
Task added successfully! ID: #0015
Skills You Will Apply
Python Core
Functions, classes, decorators, and error handling
Data Storage
JSON file handling, CRUD operations, persistence
OOP Design
Classes, inheritance, encapsulation patterns
Analytics
Statistics, data analysis, CSV processing
Learning Objectives
Technical Skills
- Build modular Python applications with multiple files
- Implement persistent data storage using JSON
- Create reusable classes with proper OOP design
- Handle user input validation and error cases
- Process and analyze CSV data from real datasets
Professional Skills
- Structure code following best practices
- Write clean, documented, maintainable code
- Use Git for version control and collaboration
- Create comprehensive README documentation
- Test edge cases and handle exceptions gracefully
Project Scenario
ProductivityHub Inc.
You have been hired as a Python Developer at ProductivityHub, a startup building productivity tools. The company wants to create a lightweight, terminal-based task management tool that their developer users can run directly from the command line without needing a browser or GUI. The tool should integrate with existing task data and provide productivity insights.
"We need a simple but powerful CLI tool that developers will love. It should support categories, priorities, due dates, and most importantly - let users import their existing tasks from CSV files. Can you also add some cool statistics so users can track their productivity over time?"
Core Features Required
- Create tasks with title, description, category
- Set priority levels (high, medium, low)
- Add optional due dates
- Mark tasks as complete or pending
- Persist all tasks to JSON file
- Import tasks from CSV files
- Export tasks to CSV format
- Search and filter tasks
- Categorize tasks (work, personal, study, health)
- View tasks by category or priority
- List overdue tasks
- Sort by date, priority, or status
- Show completion rate statistics
- Display tasks per category breakdown
- Track productivity trends
- Analyze imported dataset for insights
The Dataset
You will use a real-world productivity dataset from Kaggle to implement the import feature and analyze task completion patterns. Your app should be able to import this data and provide analytics based on it.
Dataset Download
Download the sample task datasets and save them to your project data folder. These files will help you test import functionality and analyze productivity patterns.
Original Data Source
This project uses task data inspired by the FitBit Fitness Tracker Data from Kaggle - one of the most popular datasets for learning daily activity tracking and personal productivity analysis. The dataset demonstrates real-world time tracking patterns that inspire our task management structure with categories, status tracking, and completion analytics.
Dataset Schema
| Column | Type | Description |
|---|---|---|
task_id | Integer | Unique task identifier (1-500) |
title | String | Task title (max 100 chars) |
description | String | Detailed task description |
category | String | work, personal, study, health |
priority | String | high, medium, low |
status | String | pending, completed, overdue |
due_date | Date | Task deadline (YYYY-MM-DD) |
created_date | Date | When task was created |
completed_date | Date | When task was completed (nullable) |
time_spent | Integer | Minutes spent on task |
| Column | Type | Description |
|---|---|---|
date | Date | Summary date (YYYY-MM-DD) |
tasks_created | Integer | New tasks created that day |
tasks_completed | Integer | Tasks completed that day |
total_time_spent | Integer | Total minutes spent on tasks |
completion_rate | Float | Percentage of tasks completed (0-100) |
most_productive_hour | Integer | Hour with most completions (0-23) |
Sample Data Preview
Here is what a typical task record looks like:
| task_id | title | category | priority | status | due_date |
|---|---|---|---|---|---|
| 1 | Complete Python project | study | high | pending | 2025-01-20 |
| 2 | Review team meeting notes | work | medium | completed | 2025-01-15 |
| 3 | Morning workout routine | health | high | completed | 2025-01-14 |
tasks.json should look:
{
"tasks": [
{
"id": 1,
"title": "Complete Python project",
"description": "Build CLI todo app with JSON storage",
"category": "study",
"priority": "high",
"status": "pending",
"due_date": "2025-01-20",
"created_date": "2025-01-10",
"completed_date": null
}
],
"metadata": {
"total_tasks": 1,
"last_updated": "2025-01-10T14:30:00"
}
}
Project Requirements
Your project must include all of the following components. Structure your code with clear organization, proper documentation, and follow Python best practices.
Project Structure
Organize your code into the following structure:
todo-app/
├── todo.py # Main entry point
├── task.py # Task class definition
├── task_manager.py # TaskManager class for CRUD operations
├── storage.py # JSON file handling
├── analytics.py # Statistics and reporting
├── utils.py # Helper functions (validation, formatting)
├── data/
│ ├── tasks.json # User tasks storage (auto-created)
│ ├── sample_tasks.csv # Sample data for import testing
│ └── productivity_data.csv
├── tests/
│ ├── test_task.py
│ └── test_manager.py
├── requirements.txt # Dependencies (if any)
└── README.md # Project documentation
Task Class (OOP)
Create a Task class with the following:
- Attributes: id, title, description, category, priority, status, due_date, created_date, completed_date
- Methods: mark_complete(), mark_pending(), to_dict(), from_dict()
- Properties: is_overdue (computed), days_until_due (computed)
- Validation: Validate category and priority values on assignment
- Representation: Implement __str__ and __repr__ methods
class Task:
CATEGORIES = ['work', 'personal', 'study', 'health']
PRIORITIES = ['high', 'medium', 'low']
def __init__(self, title, category='personal', priority='medium',
due_date=None, description=''):
self.id = None # Set by TaskManager
self.title = title
self.category = category
self.priority = priority
self.status = 'pending'
self.due_date = due_date
self.created_date = datetime.now().isoformat()
self.completed_date = None
self.description = description
@property
def is_overdue(self):
# Return True if past due date and not completed
pass
def mark_complete(self):
self.status = 'completed'
self.completed_date = datetime.now().isoformat()
TaskManager Class
Implement CRUD operations:
- add_task(task): Add new task, assign ID, save to storage
- get_task(id): Retrieve task by ID
- get_all_tasks(): Return all tasks
- update_task(id, **kwargs): Update task attributes
- delete_task(id): Remove task from storage
- filter_tasks(category=None, priority=None, status=None): Filter tasks
- search_tasks(query): Search by title or description
Storage Module
Handle JSON file operations:
- load_tasks(filepath): Load tasks from JSON file
- save_tasks(tasks, filepath): Save tasks to JSON file
- import_csv(filepath): Import tasks from CSV file
- export_csv(tasks, filepath): Export tasks to CSV
- backup_data(): Create timestamped backup
import json
import csv
from datetime import datetime
def load_tasks(filepath='data/tasks.json'):
"""Load tasks from JSON file. Create if not exists."""
try:
with open(filepath, 'r') as f:
data = json.load(f)
return data.get('tasks', [])
except FileNotFoundError:
return []
def save_tasks(tasks, filepath='data/tasks.json'):
"""Save tasks to JSON file with metadata."""
data = {
'tasks': [task.to_dict() for task in tasks],
'metadata': {
'total_tasks': len(tasks),
'last_updated': datetime.now().isoformat()
}
}
with open(filepath, 'w') as f:
json.dump(data, f, indent=2)
Analytics Module
Implement productivity statistics:
- get_completion_rate(): Percentage of completed tasks
- get_category_breakdown(): Tasks per category
- get_priority_breakdown(): Tasks per priority level
- get_overdue_tasks(): List of overdue tasks
- get_productivity_summary(): Overall statistics
- analyze_csv_data(filepath): Analyze imported dataset
CLI Interface
Interactive menu-driven interface:
- Main menu with numbered options
- Clear screen and header for each view
- Input validation with helpful error messages
- Confirmation prompts for destructive actions
- Color-coded output (optional but recommended)
- Graceful exit with save confirmation
Feature Specifications
Implement the following features with proper validation. Each feature should be accessible from the main menu.
- Prompt for title (required, 1-100 chars)
- Optional description
- Select category from list
- Select priority level
- Optional due date (validate format)
- Show confirmation with task ID
- View all tasks in table format
- Filter by category
- Filter by priority
- Filter by status (pending/completed)
- Show overdue tasks highlighted
- Sort by date, priority, or status
- Search/select task by ID
- Show current values
- Allow editing any field
- Press Enter to keep current value
- Validate new values
- Save and confirm changes
- List pending tasks
- Select by ID or multiple IDs
- Set completed_date to now
- Update status to completed
- Show completion message
- Option to undo (mark pending)
- Search/select task by ID
- Show task details
- Confirm deletion (yes/no)
- Remove from storage
- Option to delete completed tasks
- Cannot be undone warning
- Total tasks (pending/completed)
- Completion rate percentage
- Tasks per category chart
- Tasks per priority level
- Overdue tasks count
- Average completion time
Sample Output: Task Statistics
================== TASK STATISTICS ==================
Total Tasks: 45
- Pending: 18 (40%)
- Completed: 27 (60%)
- Overdue: 3
Category Breakdown:
Work : ████████████████ 16 (35.6%)
Study : ████████████ 12 (26.7%)
Personal : ████████ 8 (17.8%)
Health : ████████████████ 9 (20.0%)
Priority Breakdown:
High : ████████ 8 (17.8%)
Medium : ████████████████████ 20 (44.4%)
Low : ████████████████ 17 (37.8%)
Average Completion Time: 2.3 days
Most Productive Day: Monday (8 completions)
=========================================================
Data Storage
Your application must persist data using JSON files. This ensures tasks are saved between sessions and can be backed up easily.
Storage Location
data/tasks.json
Auto-Save Behavior
- Save after every add/update/delete
- Load on application start
- Create file if not exists
Metadata Tracking
- Total task count
- Last updated timestamp
- Next available ID
Import Feature
- Read sample_tasks.csv
- Map CSV columns to Task fields
- Handle missing/invalid values
- Report success/error counts
Export Feature
- Export all or filtered tasks
- Include all task fields
- Proper CSV formatting
- Timestamped filename
JSON Storage Format
{
"tasks": [
{
"id": 1,
"title": "Complete Python project",
"description": "Build CLI todo app with all required features",
"category": "study",
"priority": "high",
"status": "pending",
"due_date": "2025-01-20",
"created_date": "2025-01-10T10:30:00",
"completed_date": null
},
{
"id": 2,
"title": "Morning jog",
"description": "30 minutes cardio",
"category": "health",
"priority": "medium",
"status": "completed",
"due_date": "2025-01-14",
"created_date": "2025-01-13T08:00:00",
"completed_date": "2025-01-14T07:45:00"
}
],
"metadata": {
"total_tasks": 2,
"next_id": 3,
"last_updated": "2025-01-14T10:00:00",
"version": "1.0"
}
}
Submission Requirements
Create a public GitHub repository with the exact name shown below:
Required Repository Name
python-todo-cli
Required Project Structure
python-todo-cli/
├── todo.py # Main entry point (run this)
├── task.py # Task class
├── task_manager.py # TaskManager class
├── storage.py # JSON/CSV handling
├── analytics.py # Statistics module
├── utils.py # Helper functions
├── data/
│ ├── tasks.json # Sample tasks (for testing)
│ └── sample_tasks.csv # Import test data
├── tests/
│ ├── test_task.py # Unit tests for Task
│ └── test_manager.py # Unit tests for TaskManager
├── screenshots/
│ ├── main_menu.png # Screenshot of main menu
│ ├── add_task.png # Screenshot of adding task
│ └── statistics.png # Screenshot of statistics
├── requirements.txt # Dependencies (if any)
└── README.md # Project documentation
README.md Required Sections
1. Project Header
- Project title and badges
- Brief description
- Your name and submission date
2. Features
- List all implemented features
- Highlight any bonus features
3. Installation
- Clone command
- Python version requirement
- pip install requirements
4. Usage
- How to run the app
- Example commands
- Screenshots
5. Project Structure
- Explain each file's purpose
- Module relationships
6. Data Format
- JSON schema explanation
- Example task object
7. Testing
- How to run tests
- Test coverage info
8. License and Contact
- MIT License recommended
- GitHub profile link
Do Include
- All Python modules with docstrings
- Sample tasks.json with test data
- Unit tests for core functionality
- Screenshots of app in action
- Clear README with examples
- requirements.txt (even if empty)
Do Not Include
- __pycache__ folders
- .pyc compiled files
- Virtual environment folder
- IDE configuration files
- Personal/sensitive data in JSON
.gitignore file to exclude __pycache__, *.pyc, venv/, and .env files.
Enter your GitHub username - we will verify your repository automatically
Grading Rubric
Your project will be graded on the following criteria. Total: 400 points.
| Criteria | Points | Description |
|---|---|---|
| Task Class (OOP) | 60 | Proper class design, attributes, methods, validation, properties |
| TaskManager (CRUD) | 80 | All CRUD operations, filtering, searching, proper error handling |
| Storage Module | 60 | JSON persistence, CSV import/export, error handling |
| Analytics Module | 50 | Statistics calculations, formatted output, CSV analysis |
| CLI Interface | 60 | User-friendly menu, input validation, clear prompts |
| Code Quality | 40 | Clean code, docstrings, proper naming, PEP 8 style |
| Documentation | 30 | README quality, screenshots, clear instructions |
| Testing | 20 | Unit tests for core functionality |
| Total | 400 |
Grading Levels
Excellent
Exceeds all requirements
Good
Meets all requirements
Satisfactory
Meets minimum requirements
Needs Work
Missing key requirements
Bonus Points (up to 50 extra)
Colored Output
+15 points for using colorama
Due Date Reminders
+15 points for notification system
Fuzzy Search
+20 points for advanced search
Ready to Submit?
Make sure you have completed all requirements and reviewed the grading rubric above.
Submit Your Project