• Getting started with FastAPI and MySQL
    Learn how to create Db driven Rest APIs in FastAPI

    This post is part of the FastAPI series. In the first post, I introduced you to FastAPI and how you can create high-performance Python-based applications in it. In this post, we are going to work on Rest APIs that interact with a MySQL DB. We will also be looking at how we can organize routers and models in multiple files to make them maintainable and easier to read. FastAPI does not strict you to use a certain database framework. You may use SQLAlchemy or any other you want. I’d prefer to use peewee since it’s more expressible and easier to use. Installing Peewee and MySQL Drivers Before start using MySQL…

  • Create your first REST API in FastAPI
    A step by step guide creating high performance APIs in Python

    This post is part of the FastAPI series. In this post, I am going to introduce FastAPI: A Python-based framework to create Rest APIs. I will briefly introduce you to some basic features of this framework and then we will create a simple set of APIs for a contact management system. Knowledge of Python is very necessary to use this framework. Before we discuss the FastAPI framework, let’s talk a bit about REST itself. From Wikipedia: Representational state transfer (REST) is a software architectural style that defines a set of constraints to be used for creating Web services. Web services that conform to the REST architectural style, called RESTful Web services,…