Skip to content

Python & MongoDB To-Do App: A straightforward command-line tool for managing your daily tasks directly from the terminal.

Notifications You must be signed in to change notification settings

Anujit1/Todo_App

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 

Repository files navigation

CLI To-Do List with MongoDB

A simple, robust, and interactive Command-Line Interface (CLI) application for managing your daily tasks. This project uses Python and MongoDB to provide a persistent storage solution for your to-do items.

📋 Table of Contents

  • Features

  • Tech Stack

  • Prerequisites

  • Installation

  • Usage

  • Screenshots

  • Code Overview

✨ Features

  • Create: Add new tasks to your to-do list.

  • View: Display all your current tasks in a clean, numbered list.

  • Update: Modify an existing task by its number.

  • Delete: Remove a single task or wipe all tasks at once.

  • Persistent Storage: Your tasks are saved in a MongoDB database, so you'll never lose them.

  • User-Friendly Interface: Clear instructions and input validation for a smooth experience.

🛠️ Tech Stack

  • Backend: Python

  • Database: MongoDB

  • Driver: PyMongo

🛑 Prerequisites

Before you begin, ensure you have the following installed on your system:

  • Python 3.x: Make sure Python is installed and configured in your system's PATH.

  • MongoDB: A running instance of MongoDB is required. You can install it locally or use a cloud service like MongoDB Atlas.

  • PyMongo Driver: The official Python driver for MongoDB.

⚙️ Installation

  1. Clone the repository:
git clone https://github.com/your-username/your-repo-name.git
cd your-repo-name 
  1. Install the PyMongo library:
pip install pymongo
  1. Configure the MongoDB connection:

Open the script and ensure the uri variable points to your MongoDB instance. The default is set for a local instance. Python

uri = "mongodb://localhost:27017/"

▶️ Usage

To run the application, simply execute the Python script from your terminal:

python your_script_name.py

💻 Code Overview

Key Functions

  • fetch_tasks(): Retrieves all tasks from the MongoDB collection and stores them in a local list.

  • add_task(description): Creates a new task document and inserts it into the database.

  • view_tasks(): Prints the list of all current tasks to the console.

  • update_task(task_number, new_task): Finds a task by its list number and updates its description in the database.

  • delete_task(task_number): Deletes a specific task from the database.

  • delete_all_tasks(): Removes all documents from the tasks collection.

Main Loop

The application runs in a while True loop, clearing the screen and displaying the updated task list after each action. It uses a match statement to handle user choices for creating, updating, or deleting tasks. Input validation is included to ensure the program runs smoothly.

About

Python & MongoDB To-Do App: A straightforward command-line tool for managing your daily tasks directly from the terminal.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages