Skip to content

A CRUD users REST API using Python3 Flask and FastAPI

Notifications You must be signed in to change notification settings

essien1990/RESTAPIs

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

19 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

RESTAPIs

CRUD REST API using Python3, Flask, FastAPI and PostgreSQL database

Task

  • Import Flask and FastAPI packages
  • Use In-memory list approach for REST API CRUD(GET,POST,PUT,DELETE) methods
  • Create Users API using FastAPI by creating a fake database using pydantic inheriting from BaseModel
  • Create Cars API using Flask and PostgreSQL database using SQLAlchemy ORM to have consistent data
  • Create Users API using FastAPI Async SQL (Relational Database) using PostgreSQL database and SQLAlchemy ORM to have consistent data
  • Download dummy data from https://www.mockaroo.com/ for testing an API
  • Use Postman or an extension on VScode called Thunder client or swagger UI to test the REST API

Technologies

  • Programming Language
    • Python3

Python Framework

  • Flask Framework
  • FastAPI Framework

Python Dependencies using pip

  • Flask-migrate
  • Flask-SQLAlchemy
  • Jsonify
  • Pydantic
  • Request
  • Uvicorn server
  • json
  • passlib
  • uuid
  • databases
  • typing
  • bcrypt

API Testing Tools

  • Postman
  • Thunder Client
  • Insomnia
  • Swagger UI

Code Editor

  • VSCode

Execute Flask & FastAPI

  • Flask

    • python app.py or flask run
    • locahost:5000/api
  • FastAPI

    • uvicorn main:app --reload
    • localhost:8000/api