Skip to content
This repository has been archived by the owner on Jan 5, 2019. It is now read-only.

Commit

Permalink
Documentation fixes, more specific python reqs
Browse files Browse the repository at this point in the history
  • Loading branch information
rbw committed Mar 15, 2018
1 parent e6c45b6 commit fedc29b
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 12 deletions.
31 changes: 22 additions & 9 deletions README.rst
Expand Up @@ -10,21 +10,32 @@
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
-------------
The documentation can be found `here <http://flask-journey.readthedocs.org/>`_


Quick taste
Quick taste
-----------

Some examples of ``@route`` and ``BlueprintBundle`` + ``Journey``
Expand All @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -105,7 +118,7 @@ Working examples can be found `here <https://github.com/rbw0/flask-journey/tree/

Compatibility
-------------
- Python 2 and 3
- Python >= 2.7 or >= 3.4
- Flask > 0.7

Author
Expand Down
7 changes: 4 additions & 3 deletions docs/index.rst
Expand Up @@ -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)
Expand Down

0 comments on commit fedc29b

Please sign in to comment.