Skip to main content

flask-ripozo

https://travis-ci.org/vertical-knowledge/flask-ripozo.svg?branch=master&style=flat https://coveralls.io/repos/vertical-knowledge/flask-ripozo/badge.svg?branch=master&style=flat Documentation Status https://pypip.in/version/flask-ripozo/badge.svg?style=flat Number of PyPI downloads https://pypip.in/py_versions/flask-ripozo/badge.svg?style=flat

This package provides a dispatcher for ripozo so that you can integrate ripozo with Flask. As with all dispatchers it is simply for getting the request arguments and appropriately routing them to the various resources for handling.

Example

This example describes a minimal flask-ripozo application.

from flask import Flask

from flask_ripozo import FlaskDispatcher

from ripozo.decorators import apimethod
from ripozo.dispatcher.adapters import SirenAdapter, HalAdapter
from ripozo.viewsets.resource_base import ResourceBase


class HelloWorldViewset(ResourceBase):
    _resource_name = 'myresource'     # The name of the resource.  This will be appended to
                                      # the _namespace to complete the url.

    # The decorator indicates that the base url will be used
    # and that it will be registered for GET requests
    # a GET request to /api/myresource would be dispatched to this
    # method and handled here
    @apimethod(methods=['GET'])
    def hello(cls, request, *args, **kwargs):
        faked_response_properties = {'content': 'hello world'}
        return cls(properties=filters)

# Create the flask application
app = Flask(__name__)

# Create the dispatcher
dispatcher = FlaskDispatcher(app, base_url='/api')

# Specify the valid response types
dispatcher.register_adapters(SirenAdapter, HalAdapter)

# This will register all of the apimethod decorated methods in
# this class specified.  In this case it adds the /api/myresource GET
# route to the application
dispatcher.register_class_routes(HelloWorldViewset)

if __name__ == '__main__':
    app.run() # Run the app

Metadata

Release files for flask-ripozo 0.1.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for flask-ripozo 0.1.2
File Size Uploaded
flask-ripozo-0.1.2.tar.gz 5.1 kB Details

Release files / flask-ripozo-0.1.2.tar.gz

Download URL flask-ripozo-0.1.2.tar.gz
Size 5.1 kB
Tags Source
SHA-256 checksum
How to use checksums
7c1cf05c7b66250b9502251359b7c3f55af6a67216470e406cfb2033524d956b
BLAKE2b-256 checksum
How to use checksums
6b4f396fce22089341a51d5825d7cb9a48d7c5ed6e81ee61c12efc713eb74a6c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Release history Release notifications | RSS feed

1.0.4

1 release file

1.0.3

1 release file

1.0.2

1 release file

1.0.1

1 release file

1.0.0

1 release file

0.1.4

1 release file

0.1.3

1 release file

This release

0.1.2 This release

1 release file

0.1.1

1 release file

0.1.0

1 release file

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page