Skip to content

Mazzya/CRUD-API-Generator

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

49 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

CRUD-API-Generator

Feel free to check the CHANGELOG

🎥 To see CAG in action, click here

GitHub release (latest by date) Maintenance

Generate CRUD APIs with this powerful and simple CLI program. Currently, this program allows to generate APIs with the following microframeworks :

This program uses a specific file organization for API generation when using Flask :

MyAPI/
        └── app/
            ├── routes.py
            ├── app.py
            └── run.py

Explanation of the different files for API generation with Flask :

app : This file allows you to configure the global Flask object

routes : This file contains all the API logic (routes, etc...)

run : This file allows you to run the API

How to generate an CRUD API ?

Generating an API with this program is really easy. Let's see how to do it !

Requirements

Python 3

It is assumed that you have already installed the framework for which you are going to generate the API.

Clone the repository

$ git clone https://github.com/Mazzya/CRUD-API-Generator-DEV.git

If you wish, you can download the project directly here

Optional arguments

-h, --help            show this help message and exit
--flask               Generate a CRUD API with Flask
--fastapi             Generate a CRUD API with FastAPI
-v, --version         Check current version
-p PATH, --path PATH  Path where the API will be generated

Examples

Let's see how to generate an API with Flask and FastAPI.

Generate an API with Flask

If you wish to generate an API without specifying the directory :

$ generator.py --flask

If you want to generate an API in a specific directory :

$ generator.py --flask -p "C:\Users\HP\Documents"

Generate an API with FastAPI

If you wish to generate an API without specifying the directory :

$ generator.py --fastapi

If you want to generate an API in a specific directory :

$ generator.py --fastapi -p "C:\Users\HP\Documents"

The functions are already available, the only thing left for you to do is to implement the logic and eventually add a database if you need to.

Issues

If you find a problem with the program, feel free to report it.

Contribute

Any contribution is welcome ! If you wish, do not hesitate to fork the project and apply your changes there, when the changes are published create a pull request so that we can review it.

Important note

Currently, this program only generates APIs with Flask and FastAPI. It is possible that more frameworks will be added in the next versions.

Discord Server

We have a discord server in case you have any questions or want to be informed about the project news. Do not hesitate to join us, we are waiting for you.