Giter Site home page Giter Site logo

d-wysocki / flask-resty Goto Github PK

View Code? Open in Web Editor NEW

This project forked from 4catalyzer/flask-resty

0.0 1.0 0.0 912 KB

Building blocks for REST APIs for Flask

Home Page: https://flask-resty.readthedocs.io/en/latest/

License: MIT License

Python 100.00%

flask-resty's Introduction

Flask-RESTy Travis Codecov PyPI marshmallow 3 compatible

Flask-RESTy provides building blocks for creating REST APIs with Flask, SQLAlchemy, and marshmallow.

from flask_resty import Api, GenericModelView

from . import app, models, schemas


class WidgetViewBase(GenericModelView):
    model = models.Widget
    schema = schemas.WidgetSchema()


class WidgetListView(WidgetViewBase):
    def get(self):
        return self.list()

    def post(self):
        return self.create()


class WidgetView(WidgetViewBase):
    def get(self, id):
        return self.retrieve(id)

    def patch(self, id):
        return self.update(id, partial=True)

    def delete(self, id):
        return self.destroy(id)


api = Api(app, "/api")
api.add_resource("/widgets", WidgetListView, WidgetView)

Documentation

Documentation is available at https://flask-resty.readthedocs.io/.

License

MIT Licensed. See the bundled LICENSE file for more details.

flask-resty's People

Contributors

aaronbuxbaum avatar c0state avatar cancan101 avatar gnottobfly avatar hugovk avatar itajaja avatar jquense avatar manon-pilaud avatar peterschutt avatar r1b avatar renovate[bot] avatar sloria avatar stanley98yu avatar taion avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.