Skip to content

Commit

Permalink
Merge branch 'develop': v1.0.0
Browse files Browse the repository at this point in the history
  • Loading branch information
mahenzon committed Apr 22, 2020
2 parents 725cf11 + ed99ea4 commit 23a3ecf
Show file tree
Hide file tree
Showing 48 changed files with 1,225 additions and 1,291 deletions.
12 changes: 6 additions & 6 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
dist: trusty
language: python
python:
- '2.7'
- '3.4'
- '3.5'
- 'pypy'
- "3.6"
- "3.7"
- "3.8"
install:
- pip install -r requirements.txt
- pip install coveralls coverage
- pip install -U setuptools
- pip install pytest --upgrade
script:
- python setup.py install
- coverage run --source flask_rest_jsonapi -m pytest -v
- coverage run --source flask_combo_jsonapi -m pytest -v
after_success:
- coveralls

# TODO: create separate jobs for tests and deploy
56 changes: 28 additions & 28 deletions README.rst
Original file line number Diff line number Diff line change
@@ -1,32 +1,32 @@
.. image:: https://badge.fury.io/py/Flask-REST-JSONAPI.svg
:target: https://badge.fury.io/py/Flask-REST-JSONAPI
.. image:: https://travis-ci.org/miLibris/flask-rest-jsonapi.svg
:target: https://travis-ci.org/miLibris/flask-rest-jsonapi
.. image:: https://coveralls.io/repos/github/miLibris/flask-rest-jsonapi/badge.svg
:target: https://coveralls.io/github/miLibris/flask-rest-jsonapi
.. image:: https://readthedocs.org/projects/flask-rest-jsonapi/badge/?version=latest
:target: http://flask-rest-jsonapi.readthedocs.io/en/latest/?badge=latest
:alt: Documentation Status
.. image:: https://travis-ci.org/AdCombo/flask-combo-jsonapi.svg
:target: https://travis-ci.org/AdCombo/flask-combo-jsonapi
.. image:: https://coveralls.io/repos/github/AdCombo/flask-combo-jsonapi/badge.svg
:target: https://coveralls.io/github/AdCombo/flask-combo-jsonapi

Flask-REST-JSONAPI
##################

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.
Flask-COMBO-JSONAPI
###################

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.

The main goal is to make it flexible using `plugin system <https://github.com/AdCombo/combojsonapi/blob/develop/docs/en/create_plugins.rst>`_


Install
=======

pip install Flask-REST-JSONAPI
pip install Flask-COMBO-JSONAPI

Installation from pypi is not ready yet. Refer to the `installation manual <https://github.com/AdCombo/flask-combo-jsonapi/blob/develop/docs/installation.rst/>`_


A minimal API
=============

.. code-block:: python
# -*- coding: utf-8 -*-
from flask import Flask
from flask_rest_jsonapi import Api, ResourceDetail, ResourceList
from flask_combo_jsonapi import Api, ResourceDetail, ResourceList
from flask_sqlalchemy import SQLAlchemy
from marshmallow_jsonapi.flask import Schema
from marshmallow_jsonapi import fields
Expand Down Expand Up @@ -88,28 +88,28 @@ URL method endpoint Usage
/persons/<int:person_id> DELETE person_detail Delete a person
======================== ====== ============= ===========================

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

* 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.
* Flask-REST-JSONAPI is as flexible as Flask-RESTful. You can rewrite every default method implementation to make custom work like distributing object creation.
* 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.
* Flask-COMBO-JSONAPI is as flexible as Flask-RESTful. You can rewrite every default method implementation to make custom work like distributing object creation.

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

* 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.
* 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.
* 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.
* 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.
* 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.
* 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.
* 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.
* 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.
* 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.
* 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.
* 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.
* 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.

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

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

Thanks
======

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.
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.
4 changes: 2 additions & 2 deletions docs/api.rst
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,15 @@
Api
===

.. currentmodule:: flask_rest_jsonapi
.. currentmodule:: flask_combo_jsonapi

You can provide global decorators as tuple to the Api.

Example:

.. code-block:: python
from flask_rest_jsonapi import Api
from flask_combo_jsonapi import Api
from your_project.security import login_required
api = Api(decorators=(login_required,))
97 changes: 49 additions & 48 deletions docs/conf.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/usr/bin/env python3
#
# flask-rest-jsonapi documentation build configuration file, created by
# flask-combo-jsonapi documentation build configuration file, created by
# sphinx-quickstart on Fri Oct 21 14:33:15 2016.
#
# This file is execfile()d with the current directory set to its
Expand All @@ -18,7 +18,8 @@
#
import os
import sys
sys.path.insert(0, os.path.abspath('..'))

sys.path.insert(0, os.path.abspath(".."))

# -- General configuration ------------------------------------------------

Expand All @@ -30,38 +31,39 @@
# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom
# ones.
extensions = [
'sphinx.ext.autodoc',
"sphinx.ext.autodoc",
"sphinx.ext.autosummary",
]

# Add any paths that contain templates here, relative to this directory.
templates_path = ['_templates']
templates_path = ["_templates"]

# The suffix(es) of source filenames.
# You can specify multiple suffix as a list of string:
#
# source_suffix = ['.rst', '.md']
source_suffix = '.rst'
source_suffix = ".rst"

# The encoding of source files.
#
# source_encoding = 'utf-8-sig'

# The master toctree document.
master_doc = 'index'
master_doc = "index"

# General information about the project.
project = 'flask-rest-jsonapi'
copyright = '2016, miLibris'
author = 'miLibris'
project = "flask-combo-jsonapi"
copyright = "2020, AdCombo"
author = "AdCombo"

# The version info for the project you're documenting, acts as replacement for
# |version| and |release|, also used in various other places throughout the
# built documents.
#
# The short X.Y version.
version = '0.1'
version = "0.1"
# The full version, including alpha/beta/rc tags.
release = '0.1'
release = "0.1"

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

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

# The name of the Pygments (syntax highlighting) style to use.
pygments_style = 'sphinx'
pygments_style = "sphinx"

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

# Theme options are theme-specific and customize the look and feel of a theme
# further. For a list of options available for each theme, see the
# documentation.
#
html_theme_options = {
'github_user': 'miLibris',
'github_repo': 'flask-rest-jsonapi',
'github_banner': True,
'travis_button': True,
'show_related': True,
'page_width': '1080px',
'fixed_sidebar': True,
'code_font_size': '0.8em'
"github_user": "AdCombo",
"github_repo": "flask-combo-jsonapi",
"github_banner": True,
"travis_button": True,
"show_related": True,
"page_width": "1080px",
"fixed_sidebar": True,
"code_font_size": "0.8em",
}

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

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

# Output file base name for HTML help builder.
htmlhelp_basename = 'flask-rest-jsonapidoc'
htmlhelp_basename = "flask-combo-jsonapidoc"

# -- Options for LaTeX output ---------------------------------------------

latex_elements = {
# The paper size ('letterpaper' or 'a4paper').
#
# 'papersize': 'letterpaper',

# The font size ('10pt', '11pt' or '12pt').
#
# 'pointsize': '10pt',

# Additional stuff for the LaTeX preamble.
#
# 'preamble': '',

# Latex figure (float) alignment
#
# 'figure_align': 'htbp',
# The paper size ('letterpaper' or 'a4paper').
#
# 'papersize': 'letterpaper',
# The font size ('10pt', '11pt' or '12pt').
#
# 'pointsize': '10pt',
# Additional stuff for the LaTeX preamble.
#
# 'preamble': '',
# Latex figure (float) alignment
#
# 'figure_align': 'htbp',
}

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

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

# One entry per manual page. List of tuples
# (source start file, name, description, authors, manual section).
man_pages = [
(master_doc, 'flask-rest-jsonapi', 'flask-rest-jsonapi Documentation',
[author], 1)
]
man_pages = [(master_doc, "flask-combo-jsonapi", "flask-combo-jsonapi Documentation", [author], 1)]

# If true, show URL addresses after external links.
#
Expand All @@ -327,9 +322,15 @@
# (source start file, target name, title, author,
# dir menu entry, description, category)
texinfo_documents = [
(master_doc, 'flask-rest-jsonapi', 'flask-rest-jsonapi Documentation',
author, 'flask-rest-jsonapi', 'One line description of project.',
'Miscellaneous'),
(
master_doc,
"flask-combo-jsonapi",
"flask-combo-jsonapi Documentation",
author,
"flask-combo-jsonapi",
"One line description of project.",
"Miscellaneous",
),
]

# Documents to append as an appendix to all manuals.
Expand Down
2 changes: 1 addition & 1 deletion docs/configuration.rst
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,4 @@ You have access to 5 configration keys:
* MAX_PAGE_SIZE: the maximum page size. If you specify a page size greater than this value you will receive 400 Bad Request response.
* MAX_INCLUDE_DEPTH: the maximum length of an include through schema relationships
* ALLOW_DISABLE_PAGINATION: if you want to disallow to disable pagination you can set this configuration key to False
* CATCH_EXCEPTIONS: if you want flask_rest_jsonapi to catch all exceptions and return as JsonApiException (default is True)
* CATCH_EXCEPTIONS: if you want flask_combo_jsonapi to catch all exceptions and return as JsonApiException (default is True)
Loading

0 comments on commit 23a3ecf

Please sign in to comment.