Skip to content

Python RESTful Task API is a lightweight task management system built with FastAPI and SQLModel. It provides CRUD APIs for tasks with attributes like title, description, priority, due date, and status, includes a minimal web UI, and uses SQLite for easy local storage and rapid development.

Notifications You must be signed in to change notification settings

Prince9098/Python-Restful-Task-Api

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

1 Commit
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

🧩 Task Manager API

A simple yet powerful Task Management API built with FastAPI and SQLModel.
This project allows you to create, read, update, and delete tasks through RESTful APIs and includes a lightweight web-based UI for quick task management.


πŸš€ Features

  • πŸ—‚οΈ Create, Read, Update, and Delete (CRUD) tasks
  • πŸ” Filter tasks by status, priority, or search query
  • πŸ•’ Track due dates and creation timestamps
  • βœ… Mark tasks as complete or pending
  • πŸ’» Interactive built-in HTML UI
  • 🧠 Backed by SQLite for simplicity and portability
  • ⚑ Built with FastAPI for high performance

🧠 Tech Stack

  • Python 3.9+
  • FastAPI β€” Web Framework
  • SQLModel β€” ORM (by Tiangolo, combines Pydantic & SQLAlchemy)
  • SQLite β€” Database (default)
  • Uvicorn β€” ASGI server for development

πŸ“¦ Installation

Follow the steps below to run the project locally.

1. Clone the Repository

git clone https://github.com/your-username/task-manager-api.git
cd task-manager-api
python3 -m venv venv
source venv/bin/activate
pip install -r requirements.txt

🧱 Project Structure

File / Folder Description
main.py Main FastAPI application
tasks.db SQLite database file
requirements.txt Python dependencies
README.md Project documentation

🧭 API Endpoints

Method Endpoint Description
GET / Web UI for managing tasks
GET /tasks/ List all tasks
GET /tasks/{task_id} Get a specific task
POST /tasks/ Create a new task
PATCH /tasks/{task_id} Update an existing task
DELETE /tasks/{task_id} Delete a task
GET /health Health check endpoint

🧩 Example Request (Create Task)

POST /tasks/

Request Body:

{
  "title": "Prepare project presentation",
  "description": "Create slides and rehearse for the upcoming demo",
  "priority": 1,
  "due_date": "2025-10-12"
}

Response:

{
  "id": 5,
  "title": "Prepare project presentation",
  "description": "Create slides and rehearse for the upcoming demo",
  "done": false,
  "priority": 1,
  "due_date": "2025-10-12",
  "created_at": "2025-10-06T15:45:22Z"
}

πŸ§‘β€πŸ’» Usage (Web UI)

  1. Open your browser
  2. Add tasks using the input fields
  3. Mark tasks as done or edit them inline
  4. Tasks are automatically persisted to the SQLite database

πŸ§‘β€πŸ€β€πŸ§‘ Contributors

Prince Patel


πŸ›‘οΈ License

This project is licensed under the MIT License.
You are free to use, modify, and distribute this project with proper attribution.

About

Python RESTful Task API is a lightweight task management system built with FastAPI and SQLModel. It provides CRUD APIs for tasks with attributes like title, description, priority, due date, and status, includes a minimal web UI, and uses SQLite for easy local storage and rapid development.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 2

  •  
  •  

Languages