Skip to content

Commit

Permalink
Rename flask-rest-api to flask-smorest
Browse files Browse the repository at this point in the history
  • Loading branch information
lafrech committed Sep 20, 2019
1 parent fcf26d7 commit d56bea8
Show file tree
Hide file tree
Showing 41 changed files with 109 additions and 102 deletions.
2 changes: 1 addition & 1 deletion MANIFEST.in
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
include *.rst LICENSE

graft flask_rest_api
graft flask_smorest

graft docs
prune docs/_build
Expand Down
40 changes: 20 additions & 20 deletions README.rst
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
==============
flask-rest-api
flask-smorest
==============

.. image:: https://img.shields.io/pypi/v/flask-rest-api.svg
:target: https://pypi.org/project/flask-rest-api/
.. image:: https://img.shields.io/pypi/v/flask-smorest.svg
:target: https://pypi.org/project/flask-smorest/
:alt: Latest version

.. image:: https://img.shields.io/pypi/pyversions/flask-rest-api.svg
:target: https://pypi.org/project/flask-rest-api/
.. image:: https://img.shields.io/pypi/pyversions/flask-smorest.svg
:target: https://pypi.org/project/flask-smorest/
:alt: Python versions

.. image:: https://img.shields.io/badge/marshmallow-2%20|%203-blue.svg
Expand All @@ -18,25 +18,25 @@ flask-rest-api
:target: https://github.com/OAI/OpenAPI-Specification
:alt: OpenAPI Specification 2/3 compatible

.. image:: https://img.shields.io/pypi/l/flask-rest-api.svg
:target: https://flask-rest-api.readthedocs.io/en/latest/license.html
.. image:: https://img.shields.io/pypi/l/flask-smorest.svg
:target: https://flask-smorest.readthedocs.io/en/latest/license.html
:alt: License

.. image:: https://img.shields.io/travis/Nobatek/flask-rest-api/master.svg
:target: https://travis-ci.org/Nobatek/flask-rest-api
.. image:: https://img.shields.io/travis/marshmallow-code/flask-smorest/master.svg
:target: https://travis-ci.org/marshmallow-code/flask-smorest
:alt: Build status

.. image:: https://coveralls.io/repos/github/Nobatek/flask-rest-api/badge.svg?branch=master
:target: https://coveralls.io/github/Nobatek/flask-rest-api/?branch=master
.. image:: https://coveralls.io/repos/github/marshmallow-code/flask-smorest/badge.svg?branch=master
:target: https://coveralls.io/github/marshmallow-code/flask-smorest/?branch=master
:alt: Code coverage

.. image:: https://readthedocs.org/projects/flask-rest-api/badge/
:target: http://flask-rest-api.readthedocs.io/
.. image:: https://readthedocs.org/projects/flask-smorest/badge/
:target: http://flask-smorest.readthedocs.io/
:alt: Documentation

Build a REST API with Flask and marshmallow.

**flask-rest-api** relies on `marshmallow <https://github.com/marshmallow-code/marshmallow>`_, `webargs <https://github.com/sloria/webargs>`_ and `apispec <https://github.com/marshmallow-code/apispec/>`_ to provide a complete REST API framework.
**flask-smorest** relies on `marshmallow <https://github.com/marshmallow-code/marshmallow>`_, `webargs <https://github.com/sloria/webargs>`_ and `apispec <https://github.com/marshmallow-code/apispec/>`_ to provide a complete REST API framework.

Features
========
Expand All @@ -51,19 +51,19 @@ Install

::

pip install flask-rest-api
pip install flask-smorest

flask-rest-api supports Python >= 3.5.
flask-smorest supports Python >= 3.5.

Documentation
=============

Full documentation is available at http://flask-rest-api.readthedocs.io/.
Full documentation is available at http://flask-smorest.readthedocs.io/.

Support flask-rest-api
Support flask-smorest
======================

flask-rest-api is built on marshmallow, webargs and apispec.
flask-smorest is built on marshmallow, webargs and apispec.

If you'd like to support the future of the project, please consider
contributing to marshmallow's Open Collective:
Expand All @@ -76,4 +76,4 @@ contributing to marshmallow's Open Collective:
License
=======

MIT licensed. See the `LICENSE <https://github.com/Nobatek/flask-rest-api/blob/master/LICENSE>`_ file for more details.
MIT licensed. See the `LICENSE <https://github.com/marshmallow-code/flask-smorest/blob/master/LICENSE>`_ file for more details.
2 changes: 1 addition & 1 deletion docs/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
# You can set these variables from the command line.
SPHINXOPTS =
SPHINXBUILD = sphinx-build
SPHINXPROJ = flask-rest-api
SPHINXPROJ = flask-smorest
SOURCEDIR = .
BUILDDIR = _build

Expand Down
14 changes: 7 additions & 7 deletions docs/api_reference.rst
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,15 @@
API Reference
*************

.. module:: flask_rest_api
.. autofunction:: flask_rest_api.abort
.. module:: flask_smorest
.. autofunction:: flask_smorest.abort


Api
===


.. autoclass:: flask_rest_api.Api
.. autoclass:: flask_smorest.Api
:members:

.. automethod:: register_converter
Expand All @@ -22,7 +22,7 @@ Api
Blueprint
=========

.. autoclass:: flask_rest_api.Blueprint
.. autoclass:: flask_smorest.Blueprint
:members:

.. automethod:: arguments
Expand All @@ -35,14 +35,14 @@ Blueprint
Pagination
==========

.. autoclass:: flask_rest_api.Page
.. autoclass:: flask_smorest.Page
:members:
.. autoclass:: flask_rest_api.pagination.PaginationParameters
.. autoclass:: flask_smorest.pagination.PaginationParameters
:members:


Fields
======

.. automodule:: flask_rest_api.fields
.. automodule:: flask_smorest.fields
:members:
4 changes: 2 additions & 2 deletions docs/arguments.rst
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
.. _arguments:
.. currentmodule:: flask_rest_api
.. currentmodule:: flask_smorest

Arguments
=========
Expand Down Expand Up @@ -123,7 +123,7 @@ fields. The files are injected in the view function as a ``dict`` of werkzeug
.. code-block:: python
from werkzeug.utils import secure_filename
from flask_rest_api.fields import Upload
from flask_smorest.fields import Upload
class MultipartFileSchema(ma.Schema):
file_1 = Upload()
Expand Down
22 changes: 14 additions & 8 deletions docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,12 @@

from collections import OrderedDict

import flask_rest_api
import flask_smorest

project = 'flask-rest-api'
project = 'flask-smorest'
copyright = '2019, Nobatek/INEF4 and contributors'

version = release = flask_rest_api.__version__
version = release = flask_smorest.__version__


# -- General configuration ---------------------------------------------------
Expand Down Expand Up @@ -53,7 +53,7 @@
'mongoengine': ('http://docs.mongoengine.org/', None),
}

issues_github_path = 'Nobatek/flask-rest-api'
issues_github_path = 'marshmallow-code/flask-smorest'

# Add any paths that contain templates here, relative to this directory.
templates_path = ['_templates']
Expand Down Expand Up @@ -90,14 +90,20 @@
html_theme_options = {
'description': 'Build a REST API on Flask using Marshmallow',
'description_font_style': 'italic',
'github_user': 'Nobatek',
'github_repo': 'flask-rest-api',
'github_user': 'marshmallow-code',
'github_repo': 'flask-smorest',
'github_button': False,
'github_banner': True,
'travis_button': True,
'code_font_size': '0.8em',
'extra_nav_links': OrderedDict([
('flask-rest-api@PyPI', 'http://pypi.python.org/pypi/flask-rest-api'),
('flask-rest-api@GitHub', 'http://github.com/Nobatek/flask-rest-api'),
(
'flask-smorest@PyPI',
'http://pypi.python.org/pypi/flask-smorest'
),
(
'flask-smorest@GitHub',
'http://github.com/marshmallow-code/flask-smorest'
),
]),
}
4 changes: 2 additions & 2 deletions docs/etag.rst
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
.. _etag:
.. currentmodule:: flask_rest_api
.. currentmodule:: flask_smorest

ETag
====
Expand All @@ -18,7 +18,7 @@ The ETag featured is available through the
:meth:`Blueprint.etag <Blueprint.etag>` decorator. It can be disabled globally
with the `ETAG_DISABLED` application parameter.

`flask-rest-api` provides helpers to compute ETag, but ultimately, only the
`flask-smorest` provides helpers to compute ETag, but ultimately, only the
developer knows what data is relevant to use as ETag source, so there can be
manual work involved.

Expand Down
8 changes: 4 additions & 4 deletions docs/index.rst
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
flask-rest-api: build a REST API on Flask using Marshmallow
flask-smorest: build a REST API on Flask using Marshmallow
===========================================================

Release v\ |version|. (:ref:`Changelog <changelog>`)

**flask-rest-api** is a framework library for creating REST APIs.
**flask-smorest** is a framework library for creating REST APIs.

It uses Flask as a webserver, and marshmallow_ to serialize and deserialize data.
It relies extensively on the marshmallow ecosystem, using webargs_ to get arguments
Expand All @@ -14,11 +14,11 @@ automatically as possible.
Install
=======

flask-rest-api requires Python >= 3.5.
flask-smorest requires Python >= 3.5.

.. code-block:: bash
$ pip install flask-rest-api
$ pip install flask-smorest
Guide
Expand Down
2 changes: 1 addition & 1 deletion docs/make.bat
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ if "%SPHINXBUILD%" == "" (
)
set SOURCEDIR=.
set BUILDDIR=_build
set SPHINXPROJ=flask-rest-api
set SPHINXPROJ=flask-smorest

if "%1" == "" goto help

Expand Down
18 changes: 9 additions & 9 deletions docs/openapi.rst
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
.. _openapi:
.. currentmodule:: flask_rest_api
.. currentmodule:: flask_smorest

OpenAPI
=======

`flask-rest-api` automatically generates an OpenAPI documentation (formerly
`flask-smorest` automatically generates an OpenAPI documentation (formerly
known as Swagger) for the API.

That documentation can be made accessible as a JSON file, along with a nice web
Expand Down Expand Up @@ -37,7 +37,7 @@ Add Documentation Information to Resources
Add Summary and Description
^^^^^^^^^^^^^^^^^^^^^^^^^^^

`flask-rest-api` uses view functions docstrings to fill the `summary` and
`flask-smorest` uses view functions docstrings to fill the `summary` and
`description` attributes of an `operation object`.

.. code-block:: python
Expand Down Expand Up @@ -102,14 +102,14 @@ path parameters.
Pass Extra Documentation Information
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

`flask-rest-api` tries to document the API as automatically as possible and to
`flask-smorest` tries to document the API as automatically as possible and to
provide explicit means to pass extra-information that can't be inferred from
the code, such as descriptions, examples, etc.

The :meth:`Blueprint.doc <Blueprint.doc>` decorator provides a means to pass
extra documentation information. It comes in handy if an OpenAPI feature is not
supported, but it suffers from a few limitations, and it should be considered
a last resort solution until `flask-rest-api` is improved to fit the need.
a last resort solution until `flask-smorest` is improved to fit the need.

Known issues and alternatives are discussed in issue :issue:`71`.

Expand All @@ -132,7 +132,7 @@ Note that ``app.config`` overrides ``spec_kwargs``. The example above produces
{'host': 'example.com', 'x-internal-id': '2', ...}
.. note:: Again, flask-rest-api tries to provide as much information as
.. note:: Again, flask-smorest tries to provide as much information as
possible, but some values can only by provided by the user.

When using OpenAPI v2, `basePath` is automatically set from the value of the
Expand Down Expand Up @@ -231,7 +231,7 @@ Serve the OpenAPI Documentation
-------------------------------

Now that that the documentation is generated, it should be made available to
the clients. `flask-rest-api` can define routes to provide both the
the clients. `flask-smorest` can define routes to provide both the
documentation as a JSON file and a nice web interface to browse it
interactively. This feature is accessible through Flask app parameters.

Expand All @@ -250,7 +250,7 @@ interactively. This feature is accessible through Flask app parameters.

Both ReDoc_ and `Swagger UI`_ interfaces are available to present the API.

Their configuration logics are similar. If a path is set, then `flask-rest-api`
Their configuration logics are similar. If a path is set, then `flask-smorest`
creates a route in the application to serve the interface page, using the JS
script from a user defined URL, if any, or from a CDN URL built with the version
number.
Expand Down Expand Up @@ -309,7 +309,7 @@ number.

Default: ``['get', 'put', 'post', 'delete', 'options', 'head', 'patch', 'trace']``

.. warning:: The version strings are not checked by `flask-rest-api`. They are
.. warning:: The version strings are not checked by `flask-smorest`. They are
used as is to build the URL pointing to the UI script. Typos won't be caught.

.. _ReDoc: https://github.com/Rebilly/ReDoc
Expand Down
8 changes: 4 additions & 4 deletions docs/pagination.rst
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
.. _pagination:
.. currentmodule:: flask_rest_api
.. currentmodule:: flask_smorest

Pagination
==========
Expand Down Expand Up @@ -29,7 +29,7 @@ as ``item_count`` attribute of the `PaginationParameters` object.
.. code-block:: python
:emphasize-lines: 7,8,9,10,11,12
from flask_rest_api import set_item_count
from flask_smorest import set_item_count
@blp.route('/')
class Pets(MethodView):
Expand Down Expand Up @@ -62,7 +62,7 @@ Cursor Pager
^^^^^^^^^^^^

In this case, :meth:`Blueprint.paginate <Blueprint.paginate>` must be passed a
pager class to take care of the pagination. `flask-rest-api` provides a pager
pager class to take care of the pagination. `flask-smorest` provides a pager
for `list`-like objects: :class:`Page <Page>`. For other types, a custom pager
may have to be defined.

Expand All @@ -74,7 +74,7 @@ Mongoengine's :class:`QuerySet <mongoengine.queryset.QuerySet>`,...

.. code-block:: python
from flask_rest_api import Page
from flask_smorest import Page
class CursorPage(Page):
@property
Expand Down
6 changes: 3 additions & 3 deletions docs/quickstart.rst
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
.. _quickstart:
.. currentmodule:: flask_rest_api
.. currentmodule:: flask_smorest

Quickstart
==========

Introduction
------------

``flask-rest-api`` makes a few assumptions about how the code should be structured.
``flask-smorest`` makes a few assumptions about how the code should be structured.

The application should be split in :class:`Blueprint <Blueprint>`.
It is possible to use basic Flask view functions but it is generally a good idea
Expand Down Expand Up @@ -35,7 +35,7 @@ First instantiate an :class:`Api <Api>` with a :class:`Flask <flask.Flask>` appl
from flask import Flask
from flask.views import MethodView
import marshmallow as ma
from flask_rest_api import Api, Blueprint, abort
from flask_smorest import Api, Blueprint, abort
from .model import Pet
Expand Down
Loading

0 comments on commit d56bea8

Please sign in to comment.