Skip to content

PoriaJalalvandi/todo-list-python

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 

Repository files navigation

Python To-Do List

A command-line To-Do List application built with Python using object-oriented programming and CSV file storage. The project supports adding, removing, viewing, saving, and loading tasks, with a priority field for each task.

Features

  • Add a new task with name, description, and priority.
  • Remove an existing task by name.
  • View all saved tasks in a numbered list.
  • Automatically save tasks to a CSV file.
  • Automatically load tasks from a CSV file when the program starts.
  • Simple text-based menu for interacting with the program.

Technologies

  • Python 3
  • Built-in csv module
  • Object-Oriented Programming (OOP)
  • Command-line interface (CLI)

Project Structure

todo-list-python/
├── todo.py
├── README.md
├── .gitignore
├── tasks.csv
└── venv/

How It Works

The project uses two main classes:

  • Task: Represents a single task with name, description, and priority.
  • ToDoList: Manages the collection of tasks, including adding, removing, displaying, saving, and loading tasks.

Tasks are stored in tasks.csv, and the file is read automatically when the application starts. New changes are saved automatically after adding or removing a task.

Getting Started

1. Clone the repository

git clone https://github.com/PoriaJalalvandi/todo-list-python.git
cd todo-list-python

2. Create and activate a virtual environment

Windows

python -m venv venv
venv\Scripts\activate

Linux / macOS / WSL

python3 -m venv venv
source venv/bin/activate

3. Run the program

python todo.py

If python does not work on your system, use:

python3 todo.py

Usage

When the program starts, the following menu is shown:

=== To-Do List Menu ===
1. Add Task
2. Remove Task
3. View Tasks
4. Exit

Example flow

  1. Choose 1 to add a task.
  2. Enter task name, description, and priority (high, medium, or low).
  3. Choose 3 to view saved tasks.
  4. Choose 2 to remove a task by name.
  5. Choose 4 to exit the program.

Example CSV Format

Each row in tasks.csv stores one task:

Study Python,Practice OOP concepts,high
Buy groceries,Milk and bread,medium
Go to gym,Leg day workout,low

Future Improvements

  • Validate user input for task priority.
  • Add task editing support.
  • Sort tasks by priority.
  • Add due dates and task status.
  • Write unit tests for core methods.

Author

Name: Ali
GitHub: PoriaJalalvandi
Email: pouriyajalalvandi@gmail.com

License

This project is for educational and portfolio purposes.

About

No description or website provided.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages