Writing web APIs in Python is fun! I wanted to write a small API with Flask & Flask-RESTX, and my DB was DynamoDB in AWS.
Unfortunately, I am not familiar with DynamoDB at all. What am I going to do? Research for the best solution for integrating with DynamoDB! The best solution would be an ORM-like solution for DynamoDB.
After searching a little bit on Google, I have found the following solutions:
1. Boto3: a Python SDK for AWS services, including DynamoDB! It looks like Amazon maintains it. However, the client is just a simple wrapper of the API: there is no abstraction. Also, there is no integration for Flask. For instance, we cannot configure the library through the application object.
2. Flask-Dynamo. this is better since it is a Flask extension. Yet, this is a simple wrapper for boto3, so we still do not have the desired abstraction.
3. PynamoDB: a Pythonic interface for DynamoDB. It is similar to SQLAlchemy and MongoEngine for DynamoDB. …
These days, it becomes popular to use web APIs to connect to the cloud, integrate a particular service inside your application, or automating a process based on information from another platform. Essentially, API is everywhere! But how can we use an API by ourselves?
Before jumping into code, we have to understand how we should interact with the API. Let’s read the docs!
In case we need to choose an API from a bunch of services, it might be a good idea to check the following: