Create Google JSON Style response bodies
pip install google-json-style==0.1.1
The goal of this module is to automate creation JSON APIs consistent with Google JSON API Style Guide.
pip install google_json_style
To use sanic integration it's assumed that you have sanic installed:
pip install sanic
from sanic import Sanic
from google_json_style import set_api_version
from google_json_style.sanic import json_resp
set_api_version('0.1.0')
app = Sanic()
@app.route('/')
async def handle_request(request):
return json_resp({'test_field': 'test_value'})
This code is distributed under terms of MIT License.