diff --git a/README.rst b/README.rst index 371dba4..af50ef8 100644 --- a/README.rst +++ b/README.rst @@ -10,13 +10,24 @@ Description ----------- -- Clean and simple way of importing and managing blueprints -- Drop-in replacement for ``flask.Blueprint.route`` with support for ``marshmallow`` & ``marshmallow_sqlalchemy`` for all your (de)serialization and validation needs. +Extension for Flask focusing on three important areas for REST APIs: + +* validation +* (de)serialization +* blueprint/route management + + +Flask-journey makes the process of validating and (de)serializing data to/from python objects simple and elegant with the **Journey.route** decorator - a drop-in replacement for Flask's Blueprint.route, assisted by the fantastic **Marshmallow** library. + +The extension's other component, **BlueprintBundle**, helps segregate, group and register blueprints with ease while also providing methods for listing routes, either in simple or detailed JSON form. + Installing ---------- -$ pip install flask-journey +.. code-block:: + + pip install flask-journey Documentation @@ -24,7 +35,7 @@ Documentation The documentation can be found `here `_ -Quick taste +Quick taste ----------- Some examples of ``@route`` and ``BlueprintBundle`` + ``Journey`` @@ -33,9 +44,9 @@ Some examples of ``@route`` and ``BlueprintBundle`` + ``Journey`` ^^^^^^ .. code-block:: python - + # file: api/users/views.py - + from flask import Blueprint from flask_journey import route @@ -67,10 +78,12 @@ BlueprintBundle # file: api/bundles.py from flask_journey import BlueprintBundle - from .users.views import bp as users_bp + from .users.views import bp as users + from .groups.views import bp as groups v1 = BlueprintBundle(path='/api/v1') - v1.attach_bp(users_bp, description='Users API') + v1.attach_bp(users, description='Users API') + v1.attach_bp(groups, description='Groups API') Journey @@ -105,7 +118,7 @@ Working examples can be found `here = 2.7 or >= 3.4 - Flask > 0.7 Author diff --git a/docs/index.rst b/docs/index.rst index f0a74bb..7fcf7a5 100644 --- a/docs/index.rst +++ b/docs/index.rst @@ -22,18 +22,19 @@ Journey Usage *This step is only necessary if you plan on using the BlueprintBundle* The extension is managed through a ``Journey`` instance. -If you're utilizing application factories, then you probably want to go the init_app() route: +If utilizing application factories, then you probably want to go the init_app() route: .. code-block:: python from flask import Flask from flask_journey import Journey - from .bundles import bundle + from .bundles import bundle1, bundle2 app = Flask(__name__) journey = Journey() - journey.attach_bundle(bundle) + journey.attach_bundle(bundle1) + journey.attach_bundle(bundle2) journey.init_app(app)