Skip to content

hardik0001/FastAPI

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

FastAPI Patient Management API

A FastAPI application to manage patient data. Supports viewing, creating, updating, and sorting patients, with automatic BMI calculation and health verdict. Data is stored in a JSON file (patients.json).


Features

  • View all patients
  • View a specific patient by ID
  • Create a new patient
  • Update existing patient information
  • Sort patients by height, weight, or BMI
  • Automatic BMI and health verdict calculation

Installation

# Clone the repository
git clone https://github.com/your-username/patient-management-api.git
cd patient-management-api

# Create a virtual environment
python -m venv venv

# Activate the environment
# Windows
venv\Scripts\activate
# Mac/Linux
source venv/bin/activate

# Install dependencies
pip install fastapi uvicorn pydantic

#Running the API
uvicorn main:app --reload

#API Endpoints

GET / - Home message

GET /about - About message

GET /view - View all patients

GET /patient/{patient_id} - View a specific patient

POST /create - Create a new patient

PUT /edit/{patient_id} - Update patient details

GET /sort?sort_by=height|weight|bmi&order=asc|desc - Sort patients

About

A FastAPI application to manage patient data. Supports viewing, creating, updating, and sorting patients. Automatically calculates BMI and health verdict. Data is stored in a JSON file.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages