Skip to content

Repository files navigation

Todo In-Memory Python Console App

A command-line todo application that stores tasks in memory, enabling users to manage tasks efficiently without boilerplate coding. This is Phase I of a hackathon project evolving from CLI to distributed cloud-native AI systems.

Features

  • Add tasks with title and optional description
  • View all tasks with ID, title, description, and status (complete/incomplete)
  • View individual task details by ID
  • Update task title and/or description
  • Delete tasks by ID with validation
  • Mark tasks as complete or incomplete
  • Help command listing all available options
  • Clear, user-friendly error messages for invalid inputs

Commands

Interactive Mode (NEW!)

Run the application without any arguments to start the interactive menu:

todo-cli

This will present a menu with options to:

  • Add a new task
  • View all tasks
  • View a specific task
  • Update a task
  • Delete a task
  • Mark task as complete
  • Mark task as incomplete
  • Exit the application

Add a Task

todo-cli add "Task Title" "Optional Description"
  • Creates a new task with a unique ID
  • Title is required, description is optional
  • New task status defaults to "incomplete"

View All Tasks

todo-cli view
  • Displays all tasks with ID, title, description, and status indicator

View Individual Task

todo-cli view <id>
  • Displays details of a single task by ID

Update Task

todo-cli update <id> "New Title" "New Description"
  • Updates the title and/or description of an existing task
  • Both title and description are optional, but at least one must be provided

Delete Task

todo-cli delete <id>
  • Permanently removes a task by ID

Mark Task Complete

todo-cli complete <id>
  • Sets the status of the task to "complete"

Mark Task Incomplete

todo-cli incomplete <id>
  • Sets the status of the task back to "incomplete"

Help

todo-cli help
  • Displays all available commands with usage examples

Setup

  1. Clone or navigate to the project directory

  2. Install the package in development mode:

    pip install -e .
  3. Run the application using the console script:

    todo-cli

Alternatively, you can run the application directly without installing:

python -m todo_cli_app.cli.main

Example Workflow

# Add a new task
python -m src.cli.main add "Buy groceries" "Milk, eggs, bread"

# View all tasks
python -m src.cli.main view

# Mark task #1 as complete
python -m src.cli.main complete 1

# Update task #1
python -m src.cli.main update 1 "Buy groceries - done" "Milk, eggs, bread - bought"

# Delete task #1
python -m src.cli.main delete 1

Architecture

The application follows a clean architecture pattern with separation of concerns:

  • src/models/ - Data models (Task)
  • src/services/ - Business logic (TodoService)
  • src/cli/ - Command-line interface
  • src/lib/ - Utilities and shared components
  • tests/ - Unit and integration tests

Contributing

  1. Fork the repository
  2. Create a feature branch (git checkout -b feature/amazing-feature)
  3. Make your changes
  4. Run tests (pytest)
  5. Commit your changes (git commit -m 'Add amazing feature')
  6. Push to the branch (git push origin feature/amazing-feature)
  7. Open a Pull Request

About

No description, website, or topics provided.

Resources

Stars

1 star

Watchers

1 watching

Forks

Releases

Packages

Contributors

Languages