Python3 Flask RESTfull API Template

Job ID: 37112029

Budget: €8 – €30 EUR

Good morning,

I need help with a template for a Python3 Flask RESTful API.
I'm coding an API for a MySQL database and need a best practice template that uses flask_sqlalchemy to interact with the database. resource, schemas, and models should be used in the structure.

The structure needs to be as follows:
main.py
config.py
Models/m_store.py
Resources/r_store.py
Schemas/s_store.py

store fields:
id
name
location
Duplicate key is "name"

users:
id
name
api-key

An endpoint should be: api/v1/stores and api/v1/stores/<int:store_id>
The resource file should include a collection class with a get and put request. The get request will give all stores the put request will add a store. In addition, the put request needs the ability to take 1 store or multiple stores to be added at once. All this in json format.

When putting one or multiple stores to the database the use of "ON DUPLICATE KEY UPDATE" should be used with sqlAlchemie.

a class for a single resource should include get, patch and delete. The GET will fetch 1 store. The patch should only update the fields that are given and the delete should delete the store from the database.

There should also be proper error handling and the use of a RequestParser to provide info back in the API.

As a last, The API should use an API key for authentication and using the API.
Related categories: Python SQL MySQL Flask RESTful API