This project serves as a boilerplate for creating RESTful APIs using Flask and Swagger. It is specifically designed to integrate with databases and leverages Python's Pandas and NumPy for data processing. The API can be utilized in conjunction with other programming languages to streamline complex database queries or even multiple databases for data analysis and result rendering.
- Flask
- Flask-RESTx
- SQLAlchemy
- mysql.connector
- pymysql
- NumPy
- Pandas
- Gunicorn
- psutil
- cachetools
- Two sample namespaces (
sample_namespaceandutils_namespace) located insample.pyandutils.pywithin theapifolder. - Database connectivity to MySQL demonstrated in
database.py. - A
pandas_sample.pyfile that serves as a proof-of-concept for using Pandas to generate API responses. This can be thought of as a stand-in for a Jupyter Notebook with defined functions for API endpoints. - Function caching using
cachetoolsto avoid unnecessary queries. - Dockerized using Gunicorn with 4 workers, configurable via the Dockerfile.
To build the Docker image for this project, you can run the following command after copy .env.example to .env:
cp .env.example .env
make buildThe build process utilizes the Makefile located in the deploy folder.
To start the project, you can use:
make startAnd to stop it:
make stopThese commands also use the Makefile in the deploy folder.
The deploy folder contains a docker-compose.yml file and a sample .env file for database connections. Update the .env file as needed to connect to your own database instance.
This project is licensed under the GNU General Public License v3.0. For more information, see GNU GPLv3 License.
For more details, feel free to explore the codebase or reach out with questions.



