All Projects → grillazz → fastapi-redis

grillazz / fastapi-redis

Licence: MIT license
Showcase of Redis integration with Python FastAPI framework as API backend for RDKit: Open-Source Cheminformatics Software

Programming Languages

python
139335 projects - #7 most used programming language
Makefile
30231 projects
Dockerfile
14818 projects
shell
77523 projects

Projects that are alternatives of or similar to fastapi-redis

Coronavirus Tracker Api
🦠 A simple and fast (< 200ms) API for tracking the global coronavirus (COVID-19, SARS-CoV-2) outbreak. It's written in python using the 🔥 FastAPI framework. Supports multiple sources!
Stars: ✭ 1,577 (+3328.26%)
Mutual labels:  pipenv, fastapi
openapi-python-client
Generate modern Python clients from OpenAPI
Stars: ✭ 543 (+1080.43%)
Mutual labels:  fastapi
chembience
A Docker-based, cloudable platform for the development of chemoinformatics-centric web applications and microservices.
Stars: ✭ 41 (-10.87%)
Mutual labels:  rdkit
KivyMLApp
The repository host the API for the ML model via FastAPI, Flask and contains android app development files using KivyMD.
Stars: ✭ 54 (+17.39%)
Mutual labels:  fastapi
Jupyter Dock
Jupyter Dock is a set of Jupyter Notebooks for performing molecular docking protocols interactively, as well as visualizing, converting file formats and analyzing the results.
Stars: ✭ 179 (+289.13%)
Mutual labels:  rdkit
chitra
A multi-functional library for full-stack Deep Learning. Simplifies Model Building, API development, and Model Deployment.
Stars: ✭ 210 (+356.52%)
Mutual labels:  fastapi
fastapi-project
FastAPI application without global variables(almost) =)
Stars: ✭ 26 (-43.48%)
Mutual labels:  fastapi
ecce
ML Prediction of Bible Topics and Passages (Python / React)
Stars: ✭ 36 (-21.74%)
Mutual labels:  fastapi
Voice4Rural
A complete one stop solution for all the problems of Rural area people. 👩🏻‍🌾
Stars: ✭ 12 (-73.91%)
Mutual labels:  fastapi
fastapi-mysql-generator
FastAPI + MySQL Web项目生成器 ,个人认为较为合理的项目组织结构;基于apscheduler的定时任务。
Stars: ✭ 348 (+656.52%)
Mutual labels:  fastapi
ml gallery
This is a master project of some experiments with Neural Networks. Every project here is runnable, visualized and explained clearly.
Stars: ✭ 18 (-60.87%)
Mutual labels:  fastapi
mol frame
Chemical Structure Handling for Pandas DataFrames
Stars: ✭ 26 (-43.48%)
Mutual labels:  rdkit
fastapi-async-mongodb
Simple example with FastAPI + MongoDB
Stars: ✭ 49 (+6.52%)
Mutual labels:  fastapi
fastapi-project-template
DO NOT FORK, CLICK "Use this template" - The base to start an openapi project featuring: SQLModel, Typer, FastAPI, JWT Token Auth, Interactive Shell, Management Commands.
Stars: ✭ 262 (+469.57%)
Mutual labels:  fastapi
Python-Studies
All studies about python
Stars: ✭ 56 (+21.74%)
Mutual labels:  fastapi
pipfile-requirements
A CLI tool to covert Pipfile/Pipfile.lock to requirments.txt
Stars: ✭ 47 (+2.17%)
Mutual labels:  pipenv
image-background-remove-tool
✂️ Automated high-quality background removal framework for an image using neural networks. ✂️
Stars: ✭ 767 (+1567.39%)
Mutual labels:  fastapi
fastapi
基于Fastapi开发,集成Celery-redis分布式任务队列、JWT 用户系统、ElasticSearch和encode orm的基础项目模板,大家可以根据自己的需求在本模板上进行修改
Stars: ✭ 75 (+63.04%)
Mutual labels:  fastapi
fastapi-celery-redis-rabbitmq
A simple docker-compose app for orchestrating a fastapi application, a celery queue with rabbitmq(broker) and redis(backend)
Stars: ✭ 81 (+76.09%)
Mutual labels:  fastapi
Molecules Dataset Collection
Collection of data sets of molecules for a validation of properties inference
Stars: ✭ 69 (+50%)
Mutual labels:  rdkit

fastapi-redis

developer language license visitors CI

fastapi-redis

Project Description

Purpose of this showcase is integrate modern NoSQL backend Redis with FastAPI Python ASGI Framework as API for chemical compounds extended analyze with RDKit Library.

Data set coming from pub chem database, and you can download example from COVID-19 Disease Map here on this link: https://pubchem.ncbi.nlm.nih.gov/#query=covid-19

Pydantic schema was created for PubChem Compounds. You can replace it with your own schema to accept other source of SMILES.

There is many chemical compound sets. Now we are all in days when COVID-19 Pandemic is out there. We all want to know as much as possible about best cure..., and it is my project background. Show power and robustness of Redis with speed of FastAPI and functionality of RDKit to deliver api which allow fast analyze chem molecules.

This showcase can be quickly integrated with other services via REST API and extended to deliver desired chem compound bakery.

Project as whole is build on FastAPI framework, Python 3.10, Redis.

How to Setup

To build, run and test and more... use magic of make.

make help

and you receive below list:

build                Build project with compose
clean                Reset project containers with compose
down                 Stop project containers with compose
format               Format project code.
help                 Show this help
lint                 Lint project code.
lock                 Refresh pipfile.lock
requirements         Refresh requirements.txt from pipfile.lock
safety               Check project and dependencies with safety https://github.com/pyupio/safety
test                 Run project unit tests with coverage
up                   Run project with compose

How to Play

  1. Download sample JSON from PubChem database i.e. COVID-19 Disease Map here on this link: https://pubchem.ncbi.nlm.nih.gov/#query=covid-19

  2. Add SMILES to Redis Hash with /smiles/add-to-hash endpoint

    curl --location --request POST 'http://0.0.0.0:8080/smiles/add-to-hash?redis_hash=covid-19-canonical' \
    --header 'Content-Type: application/json' \
    --data-binary '@/fastapi-redis/PubChem_compound_text_covid-19_records.json'

    and get response like below with 201 Created

    {
        "number_of_inserted_keys": 2364,
        "hash_name": "covid-19-canonical"
    }
  3. Compare SMILES code to list loaded in previous step on Redis Hash with /api/smiles/compare-to-hash endpoint

    curl --location --request GET 
    'http://0.0.0.0:8080/smiles/compare-to-hash?compound=CCC(CC)COC(=O)C(C)NP(=O)(OCC1C(C(C(O1)(C%23N)C2=CC=C3N2N=CN=C3N)O)O)OC4=CC=CC=C4&redis_hash=covid-19-canonical'

    and get response like below with 200 OK

    {
         "number_of_smiles_to_compare": 2364,
         "similarity": {
             "CCC(CC)COC(=O)[C@H](C)N[P@](=O)(OC[C@@H]1[C@H]([C@H]([C@](O1)(C#N)C2=CC=C3N2N=CN=C3N)O)O)OC4=CC=CC=C4": 1.0,
             "CCC(CC)COC(=O)C(C)NP(=O)(OCC1C(C(C(O1)(C#N)C2=CC=C3N2N=CN=C3N)O)O)OC4=CC=CC=C4": 1.0,
             "C1=C2C(=NC=NN2C(=C1)C3(C(C(C(O3)COP(=O)(O)O)O)O)C#N)N": 0.8964264082374318,
             "C1=C2C(=NC=NN2C(=C1)[C@]3([C@@H]([C@@H]([C@H](O3)COP(=O)(O)O)O)O)C#N)N": 0.8964264082374318,
             "C1=C2C(=NC=NN2C(=C1)[C@]3([C@@H]([C@@H]([C@H](O3)CO)O)O)C#N)N": 0.8740109555690809,
             "C1=C2C(=NC=NN2C(=C1)C3(C(C(C(O3)CO)O)O)C#N)N": 0.8740109555690809
        }
    }
  4. For REST API Documentation please use: http://0.0.0.0:8080/docs

  5. Finally, you can use postman collection here Postman Collection

Backbone

Beside of using latest and greatest version of Redis with it robustness, powerfulness and speed there is FastAPI (modern, fast (high-performance), web framework for building APIs with Python 3.10+ based on standard Python type hints.) already reviewed on thoughtworks and presented in Python Developers Survey 2021 Results as the fifth official annual Python Developers Survey, conducted as a collaborative effort between the Python Software Foundation and JetBrains.

redis-py is already implemented as Python interface to the Redis key-value store.

Special thanks going to maintainers of rdkit-pypi.

Hope you enjoy it.

Change Log

  • 16 APR 2022 aioredis replaced with redis.asyncio
  • 15 JUN 2022 re-implement api with redis-om
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].