JSONAPI implementation for use with SQLAlchemy
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
docs
sqlalchemy_jsonapi
.coveragerc
.gitignore
.travis.yml
CHANGES.md
LICENSE
MANIFEST.in
README.md
pytest.ini
requirements.in
requirements.txt
setup.py
test.py
tox.ini

README.md

SQLAlchemy-JSONAPI

Build Status

JSON API implementation for use with SQLAlchemy.

SQLAlchemy-JSONAPI aims to implement the JSON API spec and to make it as simple to use and implement as possible.

Installation

pip install sqlalchemy-jsonapi

Quick usage with Flask-SQLAlchemy

# Assuming FlaskSQLAlchemy is db and your Flask app is app:
from sqlalchemy_jsonapi import FlaskJSONAPI

api = FlaskJSONAPI(app, db)

# Or, for factory-style applications
api = FlaskJSONAPI()
api.init_app(app, db)

Quick usage without Flask

# Assuming declarative base is called Base
from sqlalchemy_jsonapi import JSONAPI
api = JSONAPI(Base)

# And assuming a SQLAlchemy session
print(api.get_collection(session, {}, 'resource-type'))