https://github.com/rkstudio585/todo-list-python
A simple Python To-Do List application with an SQLite backend. It lets you add, view, and delete tasks via a command-line interface. Tasks are stored persistently in an SQLite database, ensuring they are saved between sessions for reliable task management.
https://github.com/rkstudio585/todo-list-python
pyside6 python python-project qml qtpy tasks-manager todo-list
Last synced: 2 months ago
JSON representation
A simple Python To-Do List application with an SQLite backend. It lets you add, view, and delete tasks via a command-line interface. Tasks are stored persistently in an SQLite database, ensuring they are saved between sessions for reliable task management.
- Host: GitHub
- URL: https://github.com/rkstudio585/todo-list-python
- Owner: rkstudio585
- License: mit
- Created: 2024-09-07T18:39:32.000Z (8 months ago)
- Default Branch: main
- Last Pushed: 2024-09-07T18:46:33.000Z (8 months ago)
- Last Synced: 2024-12-28T20:14:13.326Z (4 months ago)
- Topics: pyside6, python, python-project, qml, qtpy, tasks-manager, todo-list
- Language: Python
- Homepage: https://rkstudio.com
- Size: 6.84 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# π To-Do List Application
---
[In Python GUI](https://github.com/mdriyadkhan585/todo-list-GUI)[In C Script](https://github.com/mdriyadkhan585/todo-list)

---
Welcome to the Python To-Do List Application! This program allows you to manage your tasks using a simple command-line interface, with tasks stored in an SQLite database for persistence.## π Features
- **Add Tasks** π: Easily add tasks to your to-do list.
- **View Tasks** π: Display all tasks in a clear, formatted list.
- **Delete Tasks** ποΈ: Remove tasks from your list.
- **Persistent Storage** πΎ: Tasks are saved in an SQLite database to ensure data is retained between sessions.## π¦ Table of Contents
1. [Prerequisites](#prerequisites)
2. [Installation](#installation)
3. [Usage](#usage)
4. [Code Structure](#code-structure)
5. [Troubleshooting](#troubleshooting)
6. [License](#license)## π Prerequisites
Before running the application, ensure you have:
- **Python** (version 3.x recommended)
- **SQLite** (Pythonβs `sqlite3` module is included with standard Python distributions)## π Installation
1. **Clone the Repository** (or download the source code):
```sh
git clone https://github.com/mdriyadkhan585/todo-list-python.git
cd todo-list-python
```2. **No Additional Packages Needed**: The script uses built-in Python libraries.
## π Usage
Run the Python script with:
```sh
python todo_list.py
```### Main Menu Options
1. **Add Task** π
- Enter the task description when prompted.
- The task will be added to the list.2. **View Tasks** π
- Displays all current tasks with their respective IDs.3. **Delete Task** ποΈ
- First, view the tasks to get the ID of the task you want to delete.
- Enter the task ID to remove it from the list.4. **Exit** πͺ
- Exits the program.## π§ Code Structure
- **`todo_list.py`**: Contains the main program logic including database operations and user interface.
- `open_database()`: Opens the SQLite database.
- `create_table(conn)`: Creates the tasks table if it does not exist.
- `add_task(conn, task)`: Adds a new task to the database.
- `view_tasks(conn)`: Retrieves and displays all tasks.
- `delete_task(conn, task_id)`: Deletes a task based on its ID.
- `main()`: Manages user interaction and menu options.## π οΈ Troubleshooting
- **"No tasks to show"**: Indicates that no tasks are present in the database. Add tasks to see them listed.
- **"Invalid task number"**: Make sure to enter a valid task ID when deleting tasks. IDs are integers.
- **"Failed to add task"**: Check for issues in task input or database connection.## π License
This project is licensed under the MIT License. See the [LICENSE](LICENSE) file for details.
## π§βπ» Contributing
Feel free to contribute by submitting issues or pull requests on the [GitHub repository](https://github.com/mdriyadkhan585/todo-list-python).
---