Using Elasticsearch with FastAPI
FastAPI (https://fastapi.tiangolo.com/) is a new Python web framework based on asyncio
(https://docs.python.org/3/library/asyncio.html) and Starlette (https://www.starlette.io/) that's powerful and enjoyable to use. The following features make FastAPI worth trying:
- FastAPI is one of the fastest Python web frameworks (https://www.techempower.com/benchmarks/#section=data-r20&hw=ph&test=query&l=yykm7z-cn&a=2).
- It has detailed and easy-to-use developer docs that can be found at https://fastapi.tiangolo.com/tutorial/.
- It creates an OpenAPI interface by default.
- You can type hint your code and get free data validation and conversion.
- You can create plugins easily using dependency injection.
Due to its async nature, FastAPI is very easy to integrate with AsyncElasicsearch.
Getting ready
You will need an up and running Elasticsearch installation, as we described in the Downloading and installing Elasticsearch...