A really simple app that allows you to write out your RESTful APIs spec in a logical form and automatically generate stub functions for each endpoint.
To install from source, you will need to first clone the repository from GitHub:
git clone https://github.com/Michael-F-Bryan/flask_api_builder.git
Then run the
python3 setup.py install
Or you can install directly from the Python Packaging Index:
pip install flask_api_builder
In order to generate your base API, you first need to write up a spec for it. The spec contains the definitions for each of your API’s end points, as well as some variables to customize the Blueprint each API endpoint is attached to.
The spec file is designed to be quite intuitive to use. It is set out in a table-like format, with each column being aligned with spaces. Any line starting with a “#” is interpreted as a comment and ignored by the parser.
Defining variables is really easy, just add a line with
The variable names currently supported are:
All variable names are not case sensitive.
API Endpoints are defined one per line, in a table-like format. Each line consists of 3 or 4 fields delimited by two or more whitespace characters. This means that you need to separate your columns by at least two spaces so the parser will read them correctly.
The fields correspond to an endpoint’s METHOD, URL, DESCRIPTION and (optionally) the NAME of the function generated. If no name is provided then one will be generated for you given the method and URL parameters (no guarantees that the generated name will be intelligible though).
Here is an example of a simple spec for a to-do list app:
blueprint-name: api #Method URL Description GET /tasks Retrieve list of tasks GET /tasks/<int:task_id> Retrieve task number <task_id> POST /tasks Create a new task
TODO: Figure out how to actually get changelog content.
Changelog content for this version goes here.
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
|File Name & Checksum SHA256 Checksum Help||Version||File Type||Upload Date|
|flask_api_builder-0.2.0-py2.py3-none-any.whl (10.1 kB) Copy SHA256 Checksum SHA256||py2.py3||Wheel||Jul 22, 2016|
|flask_api_builder-0.2.0.tar.gz (7.6 kB) Copy SHA256 Checksum SHA256||–||Source||Jul 22, 2016|