GithubHelp home page GithubHelp logo

cosmosdb-python-fastapi's Introduction

Simple Python web backend with Cosmos DB and Fast API

This python project creates a very simple three-tiered ToDo web app backend using Cosmos DB as the database and FastAPI as the python web framework to expose API endpoints for performing CRUD operations.

Features

This project demonstrates the use of the Cosmos DB python SDK with FastAPI . It covers the following aspects:

  • Create Azure Cosmos DB Resource in Azure Portal
  • Setup the dev environment and install requisite client-side libraries
  • Store Cosmos DB Resource connection credentials on our server
  • Connect to Cosmos DB Resource through python client
  • Define ToDoItem data model
  • Create the required database and container to store ToDo Items
  • Setup for API implementation
  • Write functions to interact with the database
  • Expose the API endpoints with FastAPI
  • Test the endpoints

Getting Started

Prerequisites

  • Python 3.6+

Installation

Install the required libraries

  • pip install fastapi
  • pip install fastapi uvicorn
  • pip install python-dotenv
  • pip install aiohttp
  • pip install azure-cosmos

Quickstart

  1. git clone [repository clone url]
  2. cd [repository name]

Demo

Test out the API endpoints:

  1. cd [repository name]
  2. uvicorn main:app –reload
  3. In your browser, go to http://localhost:8000/docs

Resources

cosmosdb-python-fastapi's People

Contributors

abhinavtrips avatar microsoft-github-operations[bot] avatar microsoftopensource avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.