Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

1 Commit
Β 
Β 
Β 
Β 

Repository files navigation

πŸ“ Python To-Do List CLI

A command-line task manager with JSON file storage. Add, view, complete, and delete tasks β€” they persist between sessions. Built with Python 3 β€” no external dependencies.

✨ Features

  • Add tasks with timestamps
  • View pending and completed tasks separately
  • Mark tasks as completed
  • Delete individual tasks
  • Clear all completed tasks at once
  • JSON file storage (tasks survive program restart)
  • Progress tracking (X/Y done)
  • Auto ID re-numbering after deletion

πŸš€ How to Run

# Make sure Python 3.8+ is installed
python --version

# Clone this repository
git clone https://github.com/YOUR-USERNAME/python-todo-list.git
cd python-todo-list

# Run the program
python todo.py

πŸ“Έ Sample Output

==================================================
  πŸ“ PYTHON TO-DO LIST
  Beginnersly.com β€” Python Projects
==================================================

πŸ“‹ Menu: (0 pending)
  1. Add Task
  2. View All Tasks
  3. Complete Task
  4. Delete Task
  5. Clear Completed
  6. Exit

Choice (1-6): 1
πŸ“Œ Task title: Learn Python basics
βœ… Added: "Learn Python basics"

Choice (1-6): 2
───────────────────────────────────────────────────────
  πŸ“‹ YOUR TO-DO LIST (1 tasks)
───────────────────────────────────────────────────────

  πŸ”΄ Pending:
    [1] ⬜ Learn Python basics  (added 2026-06-15 14:30)

  πŸ“Š Progress: 0/1 done

πŸ“ Data Storage (tasks.json)

Tasks are saved automatically to tasks.json:

[
  {
    "id": 1,
    "title": "Learn Python basics",
    "done": true,
    "created": "2026-06-15 14:30",
    "completed": "2026-06-15 15:45"
  },
  {
    "id": 2,
    "title": "Build password generator",
    "done": false,
    "created": "2026-06-15 14:31",
    "completed": null
  }
]

🧠 Concepts Used

  • JSON file read/write (json.load(), json.dump())
  • CRUD operations (Create, Read, Update, Delete)
  • Lists and Dictionaries
  • datetime module for timestamps
  • Functions for code organization
  • List comprehensions for filtering
  • Error handling (try/except)

πŸ“ Project Structure

python-todo-list/
β”œβ”€β”€ todo.py           # Main source code
β”œβ”€β”€ tasks.json        # Auto-generated data file
β”œβ”€β”€ README.md         # This file
β”œβ”€β”€ .gitignore        # Git ignore rules
└── LICENSE           # MIT License

πŸ’‘ Ideas to Extend

  • Add task priorities (High/Medium/Low)
  • Add due dates with overdue alerts
  • Add categories/tags
  • Add search functionality
  • Build web version with Flask
  • Export to CSV/TXT

πŸ“š Tutorial

Full tutorial with explanation: Beginnersly.com β€” To-Do List CLI

πŸ“„ License

MIT License β€” free to use, modify, and share.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

Packages

Contributors

Languages