Skip to content

Commit ed99ea4

Browse files
authored
Merge pull request #15 from AdCombo/rename-to-flask-combo-jsonapi
Rename to Flask-COMBO-JSONAPI
2 parents 8ee0c52 + b8bf4a9 commit ed99ea4

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

47 files changed

+266
-254
lines changed

.travis.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ install:
1010
- pip install pytest --upgrade
1111
script:
1212
- python setup.py install
13-
- coverage run --source flask_rest_jsonapi -m pytest -v
13+
- coverage run --source flask_combo_jsonapi -m pytest -v
1414
after_success:
1515
- coveralls
1616

README.rst

Lines changed: 27 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,32 @@
1-
.. image:: https://travis-ci.org/AdCombo/flask-rest-jsonapi.svg
2-
:target: https://travis-ci.org/AdCombo/flask-rest-jsonapi
3-
.. image:: https://coveralls.io/repos/github/AdCombo/flask-rest-jsonapi/badge.svg
4-
:target: https://coveralls.io/github/AdCombo/flask-rest-jsonapi
1+
.. image:: https://travis-ci.org/AdCombo/flask-combo-jsonapi.svg
2+
:target: https://travis-ci.org/AdCombo/flask-combo-jsonapi
3+
.. image:: https://coveralls.io/repos/github/AdCombo/flask-combo-jsonapi/badge.svg
4+
:target: https://coveralls.io/github/AdCombo/flask-combo-jsonapi
55

66

7-
Flask-REST-JSONAPI
8-
##################
7+
Flask-COMBO-JSONAPI
8+
###################
9+
10+
Flask-COMBO-JSONAPI is a flask extension for building REST APIs. It combines the power of `Flask-Restless <https://flask-restless.readthedocs.io/>`_ and the flexibility of `Flask-RESTful <https://flask-restful.readthedocs.io/>`_ around a strong specification `JSONAPI 1.0 <http://jsonapi.org/>`_. This framework is designed to quickly build REST APIs and fit the complexity of real life projects with legacy data and multiple data storages.
11+
12+
The main goal is to make it flexible using `plugin system <https://github.com/AdCombo/combojsonapi/blob/develop/docs/en/create_plugins.rst>`_
913

10-
Flask-REST-JSONAPI is a flask extension for building REST APIs. It combines the power of `Flask-Restless <https://flask-restless.readthedocs.io/>`_ and the flexibility of `Flask-RESTful <https://flask-restful.readthedocs.io/>`_ around a strong specification `JSONAPI 1.0 <http://jsonapi.org/>`_. This framework is designed to quickly build REST APIs and fit the complexity of real life projects with legacy data and multiple data storages.
1114

1215
Install
1316
=======
1417

15-
pip install Flask-REST-JSONAPI
18+
pip install Flask-COMBO-JSONAPI
19+
20+
Installation from pypi is not ready yet. Refer to the `installation manual <https://github.com/AdCombo/flask-combo-jsonapi/blob/develop/docs/installation.rst/>`_
21+
1622

1723
A minimal API
1824
=============
1925

2026
.. code-block:: python
2127
2228
from flask import Flask
23-
from flask_rest_jsonapi import Api, ResourceDetail, ResourceList
29+
from flask_combo_jsonapi import Api, ResourceDetail, ResourceList
2430
from flask_sqlalchemy import SQLAlchemy
2531
from marshmallow_jsonapi.flask import Schema
2632
from marshmallow_jsonapi import fields
@@ -82,28 +88,28 @@ URL method endpoint Usage
8288
/persons/<int:person_id> DELETE person_detail Delete a person
8389
======================== ====== ============= ===========================
8490

85-
Flask-REST-JSONAPI vs `Flask-RESTful <http://flask-restful-cn.readthedocs.io/en/0.3.5/a>`_
91+
Flask-COMBO-JSONAPI vs `Flask-RESTful <http://flask-restful-cn.readthedocs.io/en/0.3.5/a>`_
8692
==========================================================================================
8793

88-
* In contrast to Flask-RESTful, Flask-REST-JSONAPI provides a default implementation of get, post, patch and delete methods around a strong specification JSONAPI 1.0. Thanks to this you can build REST API very quickly.
89-
* Flask-REST-JSONAPI is as flexible as Flask-RESTful. You can rewrite every default method implementation to make custom work like distributing object creation.
94+
* In contrast to Flask-RESTful, Flask-COMBO-JSONAPI provides a default implementation of get, post, patch and delete methods around a strong specification JSONAPI 1.0. Thanks to this you can build REST API very quickly.
95+
* Flask-COMBO-JSONAPI is as flexible as Flask-RESTful. You can rewrite every default method implementation to make custom work like distributing object creation.
9096

91-
Flask-REST-JSONAPI vs `Flask-Restless <https://flask-restless.readthedocs.io/en/stable/>`_
97+
Flask-COMBO-JSONAPI vs `Flask-Restless <https://flask-restless.readthedocs.io/en/stable/>`_
9298
==========================================================================================
9399

94-
* Flask-REST-JSONAPI is a real implementation of JSONAPI 1.0 specification. So in contrast to Flask-Restless, Flask-REST-JSONAPI forces you to create a real logical abstration over your data models with `Marshmallow <https://marshmallow.readthedocs.io/en/latest/>`_. So you can create complex resource over your data.
95-
* In contrast to Flask-Restless, Flask-REST-JSONAPI can use any ORM or data storage through the data layer concept, not only `SQLAlchemy <http://www.sqlalchemy.org/>`_. A data layer is a CRUD interface between your resource and one or more data storage so you can fetch data from any data storage of your choice or create resource that use multiple data storages.
96-
* Like I said previously, Flask-REST-JSONAPI is a real implementation of JSONAPI 1.0 specification. So in contrast to Flask-Restless you can manage relationships via REST. You can create dedicated URL to create a CRUD API to manage relationships.
97-
* Plus Flask-REST-JSONAPI helps you to design your application with strong separation between resource definition (schemas), resource management (resource class) and route definition to get a great organization of your source code.
98-
* In contrast to Flask-Restless, Flask-REST-JSONAPI is highly customizable. For example you can entirely customize your URLs, define multiple URLs for the same resource manager, control serialization parameters of each method and lots of very useful parameters.
99-
* Finally in contrast to Flask-Restless, Flask-REST-JSONAPI provides a great error handling system according to JSONAPI 1.0. Plus the exception handling system really helps the API developer to quickly find missing resources requirements.
100+
* Flask-COMBO-JSONAPI is a real implementation of JSONAPI 1.0 specification. So in contrast to Flask-Restless, Flask-COMBO-JSONAPI forces you to create a real logical abstration over your data models with `Marshmallow <https://marshmallow.readthedocs.io/en/latest/>`_. So you can create complex resource over your data.
101+
* In contrast to Flask-Restless, Flask-COMBO-JSONAPI can use any ORM or data storage through the data layer concept, not only `SQLAlchemy <http://www.sqlalchemy.org/>`_. A data layer is a CRUD interface between your resource and one or more data storage so you can fetch data from any data storage of your choice or create resource that use multiple data storages.
102+
* Like I said previously, Flask-COMBO-JSONAPI is a real implementation of JSONAPI 1.0 specification. So in contrast to Flask-Restless you can manage relationships via REST. You can create dedicated URL to create a CRUD API to manage relationships.
103+
* Plus Flask-COMBO-JSONAPI helps you to design your application with strong separation between resource definition (schemas), resource management (resource class) and route definition to get a great organization of your source code.
104+
* In contrast to Flask-Restless, Flask-COMBO-JSONAPI is highly customizable. For example you can entirely customize your URLs, define multiple URLs for the same resource manager, control serialization parameters of each method and lots of very useful parameters.
105+
* Finally in contrast to Flask-Restless, Flask-COMBO-JSONAPI provides a great error handling system according to JSONAPI 1.0. Plus the exception handling system really helps the API developer to quickly find missing resources requirements.
100106

101107
Documentation
102108
=============
103109

104-
Documentation available here: http://flask-rest-jsonapi.readthedocs.io/en/latest/
110+
Documentation available here: http://Flask-COMBO-JSONAPI.readthedocs.io/en/latest/
105111

106112
Thanks
107113
======
108114

109-
Flask, marshmallow, marshmallow_jsonapi, sqlalchemy, Flask-RESTful and Flask-Restless are awesome projects. These libraries gave me inspiration to create Flask-REST-JSONAPI, so huge thanks to authors and contributors.
115+
Flask, marshmallow, marshmallow_jsonapi, sqlalchemy, Flask-RESTful and Flask-Restless are awesome projects. These libraries gave me inspiration to create Flask-COMBO-JSONAPI, so huge thanks to authors and contributors.

docs/api.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,15 +3,15 @@
33
Api
44
===
55

6-
.. currentmodule:: flask_rest_jsonapi
6+
.. currentmodule:: flask_combo_jsonapi
77

88
You can provide global decorators as tuple to the Api.
99

1010
Example:
1111

1212
.. code-block:: python
1313
14-
from flask_rest_jsonapi import Api
14+
from flask_combo_jsonapi import Api
1515
from your_project.security import login_required
1616
1717
api = Api(decorators=(login_required,))

docs/conf.py

Lines changed: 49 additions & 48 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#!/usr/bin/env python3
22
#
3-
# flask-rest-jsonapi documentation build configuration file, created by
3+
# flask-combo-jsonapi documentation build configuration file, created by
44
# sphinx-quickstart on Fri Oct 21 14:33:15 2016.
55
#
66
# This file is execfile()d with the current directory set to its
@@ -18,7 +18,8 @@
1818
#
1919
import os
2020
import sys
21-
sys.path.insert(0, os.path.abspath('..'))
21+
22+
sys.path.insert(0, os.path.abspath(".."))
2223

2324
# -- General configuration ------------------------------------------------
2425

@@ -30,38 +31,39 @@
3031
# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom
3132
# ones.
3233
extensions = [
33-
'sphinx.ext.autodoc',
34+
"sphinx.ext.autodoc",
35+
"sphinx.ext.autosummary",
3436
]
3537

3638
# Add any paths that contain templates here, relative to this directory.
37-
templates_path = ['_templates']
39+
templates_path = ["_templates"]
3840

3941
# The suffix(es) of source filenames.
4042
# You can specify multiple suffix as a list of string:
4143
#
4244
# source_suffix = ['.rst', '.md']
43-
source_suffix = '.rst'
45+
source_suffix = ".rst"
4446

4547
# The encoding of source files.
4648
#
4749
# source_encoding = 'utf-8-sig'
4850

4951
# The master toctree document.
50-
master_doc = 'index'
52+
master_doc = "index"
5153

5254
# General information about the project.
53-
project = 'flask-rest-jsonapi'
54-
copyright = '2016, miLibris'
55-
author = 'miLibris'
55+
project = "flask-combo-jsonapi"
56+
copyright = "2020, AdCombo"
57+
author = "AdCombo"
5658

5759
# The version info for the project you're documenting, acts as replacement for
5860
# |version| and |release|, also used in various other places throughout the
5961
# built documents.
6062
#
6163
# The short X.Y version.
62-
version = '0.1'
64+
version = "0.1"
6365
# The full version, including alpha/beta/rc tags.
64-
release = '0.1'
66+
release = "0.1"
6567

6668
# The language for content autogenerated by Sphinx. Refer to documentation
6769
# for a list of supported languages.
@@ -82,7 +84,7 @@
8284
# List of patterns, relative to source directory, that match files and
8385
# directories to ignore when looking for source files.
8486
# This patterns also effect to html_static_path and html_extra_path
85-
exclude_patterns = ['_build', 'Thumbs.db', '.DS_Store']
87+
exclude_patterns = ["_build", "Thumbs.db", ".DS_Store"]
8688

8789
# The reST default role (used for this markup: `text`) to use for all
8890
# documents.
@@ -104,7 +106,7 @@
104106
# show_authors = False
105107

106108
# The name of the Pygments (syntax highlighting) style to use.
107-
pygments_style = 'sphinx'
109+
pygments_style = "sphinx"
108110

109111
# A list of ignored prefixes for module index sorting.
110112
# modindex_common_prefix = []
@@ -121,21 +123,21 @@
121123
# The theme to use for HTML and HTML Help pages. See the documentation for
122124
# a list of builtin themes.
123125
#
124-
html_theme = 'alabaster'
126+
html_theme = "alabaster"
125127

126128
# Theme options are theme-specific and customize the look and feel of a theme
127129
# further. For a list of options available for each theme, see the
128130
# documentation.
129131
#
130132
html_theme_options = {
131-
'github_user': 'miLibris',
132-
'github_repo': 'flask-rest-jsonapi',
133-
'github_banner': True,
134-
'travis_button': True,
135-
'show_related': True,
136-
'page_width': '1080px',
137-
'fixed_sidebar': True,
138-
'code_font_size': '0.8em'
133+
"github_user": "AdCombo",
134+
"github_repo": "flask-combo-jsonapi",
135+
"github_banner": True,
136+
"travis_button": True,
137+
"show_related": True,
138+
"page_width": "1080px",
139+
"fixed_sidebar": True,
140+
"code_font_size": "0.8em",
139141
}
140142

141143
# Add any paths that contain custom themes here, relative to this directory.
@@ -164,7 +166,7 @@
164166
# Add any paths that contain custom static files (such as style sheets) here,
165167
# relative to this directory. They are copied after the builtin static files,
166168
# so a file named "default.css" will overwrite the builtin "default.css".
167-
html_static_path = ['_static']
169+
html_static_path = ["_static"]
168170

169171
# Add any extra paths that contain custom files (such as robots.txt or
170172
# .htaccess) here, relative to this directory. These files are copied
@@ -244,34 +246,30 @@
244246
# html_search_scorer = 'scorer.js'
245247

246248
# Output file base name for HTML help builder.
247-
htmlhelp_basename = 'flask-rest-jsonapidoc'
249+
htmlhelp_basename = "flask-combo-jsonapidoc"
248250

249251
# -- Options for LaTeX output ---------------------------------------------
250252

251253
latex_elements = {
252-
# The paper size ('letterpaper' or 'a4paper').
253-
#
254-
# 'papersize': 'letterpaper',
255-
256-
# The font size ('10pt', '11pt' or '12pt').
257-
#
258-
# 'pointsize': '10pt',
259-
260-
# Additional stuff for the LaTeX preamble.
261-
#
262-
# 'preamble': '',
263-
264-
# Latex figure (float) alignment
265-
#
266-
# 'figure_align': 'htbp',
254+
# The paper size ('letterpaper' or 'a4paper').
255+
#
256+
# 'papersize': 'letterpaper',
257+
# The font size ('10pt', '11pt' or '12pt').
258+
#
259+
# 'pointsize': '10pt',
260+
# Additional stuff for the LaTeX preamble.
261+
#
262+
# 'preamble': '',
263+
# Latex figure (float) alignment
264+
#
265+
# 'figure_align': 'htbp',
267266
}
268267

269268
# Grouping the document tree into LaTeX files. List of tuples
270269
# (source start file, target name, title,
271270
# author, documentclass [howto, manual, or own class]).
272271
latex_documents = [
273-
(master_doc, 'flask-rest-jsonapi.tex', 'flask-rest-jsonapi Documentation',
274-
'miLibris', 'manual'),
272+
(master_doc, "flask-combo-jsonapi.tex", "flask-combo-jsonapi Documentation", "AdCombo", "manual"),
275273
]
276274

277275
# The name of an image file (relative to this directory) to place at the top of
@@ -311,10 +309,7 @@
311309

312310
# One entry per manual page. List of tuples
313311
# (source start file, name, description, authors, manual section).
314-
man_pages = [
315-
(master_doc, 'flask-rest-jsonapi', 'flask-rest-jsonapi Documentation',
316-
[author], 1)
317-
]
312+
man_pages = [(master_doc, "flask-combo-jsonapi", "flask-combo-jsonapi Documentation", [author], 1)]
318313

319314
# If true, show URL addresses after external links.
320315
#
@@ -327,9 +322,15 @@
327322
# (source start file, target name, title, author,
328323
# dir menu entry, description, category)
329324
texinfo_documents = [
330-
(master_doc, 'flask-rest-jsonapi', 'flask-rest-jsonapi Documentation',
331-
author, 'flask-rest-jsonapi', 'One line description of project.',
332-
'Miscellaneous'),
325+
(
326+
master_doc,
327+
"flask-combo-jsonapi",
328+
"flask-combo-jsonapi Documentation",
329+
author,
330+
"flask-combo-jsonapi",
331+
"One line description of project.",
332+
"Miscellaneous",
333+
),
333334
]
334335

335336
# Documents to append as an appendix to all manuals.

docs/configuration.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,4 +9,4 @@ You have access to 5 configration keys:
99
* MAX_PAGE_SIZE: the maximum page size. If you specify a page size greater than this value you will receive 400 Bad Request response.
1010
* MAX_INCLUDE_DEPTH: the maximum length of an include through schema relationships
1111
* ALLOW_DISABLE_PAGINATION: if you want to disallow to disable pagination you can set this configuration key to False
12-
* CATCH_EXCEPTIONS: if you want flask_rest_jsonapi to catch all exceptions and return as JsonApiException (default is True)
12+
* CATCH_EXCEPTIONS: if you want flask_combo_jsonapi to catch all exceptions and return as JsonApiException (default is True)

docs/data_layer.rst

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,11 @@
33
Data layer
44
==========
55

6-
.. currentmodule:: flask_rest_jsonapi
6+
.. currentmodule:: flask_combo_jsonapi
77

88
| The data layer is a CRUD interface between resource manager and data. It is a very flexible system to use any ORM or data storage. You can even create a data layer that use multiple ORMs and data storage to manage your own objects. The data layer implements a CRUD interface for objects and relationships. It also manage pagination, filtering and sorting.
99
|
10-
| Flask-REST-JSONAPI has a full featured data layer that use the popular ORM `SQLAlchemy <https://www.sqlalchemy.org/>`_.
10+
| Flask-COMBO-JSONAPI has a full featured data layer that use the popular ORM `SQLAlchemy <https://www.sqlalchemy.org/>`_.
1111
1212
.. note::
1313

@@ -19,7 +19,7 @@ Example:
1919

2020
.. code-block:: python
2121
22-
from flask_rest_jsonapi import ResourceList
22+
from flask_combo_jsonapi import ResourceList
2323
from your_project.schemas import PersonSchema
2424
from your_project.models import Person
2525
@@ -32,15 +32,15 @@ You can also plug additional methods to your data layer in the resource manager.
3232

3333
* query: the "query" additional method takes view_kwargs as parameter and return an alternative query to retrieve the collection of objects in the GET method of the ResourceList manager.
3434

35-
* pre / post process methods: all CRUD and relationship(s) operations have a pre / post process methods. Thanks to it you can make additional work before and after each operations of the data layer. Parameters of each pre / post process methods are available in the `flask_rest_jsonapi.data_layers.base.Base <https://github.com/miLibris/flask-rest-jsonapi/blob/master/flask_rest_jsonapi/data_layers/base.py>`_ base class.
35+
* pre / post process methods: all CRUD and relationship(s) operations have a pre / post process methods. Thanks to it you can make additional work before and after each operations of the data layer. Parameters of each pre / post process methods are available in the `flask_combo_jsonapi.data_layers.base.Base <https://github.com/AdCombo/flask-combo-jsonapi/blob/master/flask_combo_jsonapi/data_layers/base.py>`_ base class.
3636

3737
Example:
3838

3939
.. code-block:: python
4040
4141
from sqlalchemy.orm.exc import NoResultFound
42-
from flask_rest_jsonapi import ResourceList
43-
from flask_rest_jsonapi.exceptions import ObjectNotFound
42+
from flask_combo_jsonapi import ResourceList
43+
from flask_combo_jsonapi.exceptions import ObjectNotFound
4444
from your_project.models import Computer, Person
4545
4646
class ComputerList(ResourceList):
@@ -75,8 +75,8 @@ Example:
7575
.. code-block:: python
7676
7777
from sqlalchemy.orm.exc import NoResultFound
78-
from flask_rest_jsonapi import ResourceList
79-
from flask_rest_jsonapi.exceptions import ObjectNotFound
78+
from flask_combo_jsonapi import ResourceList
79+
from flask_combo_jsonapi.exceptions import ObjectNotFound
8080
from your_project.models import Computer, Person
8181
from your_project.additional_methods.computer import before_create_object
8282
@@ -105,13 +105,13 @@ By default SQLAlchemy eagerload related data specified in include querystring pa
105105
Custom data layer
106106
-----------------
107107

108-
Like I said previously you can create and use your own data layer. A custom data layer must inherit from `flask_rest_jsonapi.data_layers.base.Base <https://github.com/miLibris/flask-rest-jsonapi/blob/master/flask_rest_jsonapi/data_layers/base.py>`_. You can see the full scope of possibilities of a data layer in this base class.
108+
Like I said previously you can create and use your own data layer. A custom data layer must inherit from `flask_combo_jsonapi.data_layers.base.Base <https://github.com/AdCombo/flask-combo-jsonapi/blob/master/flask_combo_jsonapi/data_layers/base.py>`_. You can see the full scope of possibilities of a data layer in this base class.
109109

110110
Usage example:
111111

112112
.. code-block:: python
113113
114-
from flask_rest_jsonapi import ResourceList
114+
from flask_combo_jsonapi import ResourceList
115115
from your_project.schemas import PersonSchema
116116
from your_project.data_layers import MyCustomDataLayer
117117

0 commit comments

Comments
 (0)