Skip to main content

A small wrapper for flask app to ease the endpoints creation

Project description

A small wrapper for flask app to ease the endpoints creation

Motivation

We have been using Flask-RESTful for most of our project for the past couple of years, and when we mapped exactly what we need from it, it was mostly the way it allows the user to add routing.

This small module replace for us this functionality, so I’ve desided to share it with whoever want to give it a try :wink:

Getting Started

This wrapper helps davide the Flask App into modules and to use Class handlers instead of functions for views

Prerequisites

The only requirement for this project is Flask

Usage

from flask import Flask
from flask_api_handler import ApiHandler

form example import UserHandler
form example import PaymentHandler

app = Flask(__name__)

# Init the api handler
api = ApiHandler(app)

# Add the endpoints
api.add_handler('/user', UserHandler)
api.add_handler('/payment', PaymentHandler)

TODO

  • Make pip installable

  • Add tests

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

flask-api-handler-0.1.3.tar.gz (2.5 kB view hashes)

Uploaded Source

Built Distribution

flask_api_handler-0.1.3-py2-none-any.whl (4.3 kB view hashes)

Uploaded Python 2

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page