Skip to main content

Tornado_jsonapi

Build Status Coverage Status Requirements Status PyPi version Documentation Status GitHub License

Tornado_jsonapi is a Python 3.3+ library for creating JSON API (as per jsonapi.org specification) using Tornado web framework. It features

  • semi-automatic API generation using provided JSON schema of resource;

  • support for arbitrary data sources, including SQLAlchemy and PostgreSQL (via DBAPI2 support layer);

  • support for asynchronous data source operations;

  • strict jsonapi.org specification conformance.

Usage

import sqlite3
import tornado.ioloop
import tornado.web
import tornado_jsonapi.handlers
import tornado_jsonapi.resource

schema = {
    "title": "post",
    "properties": {
        "text":
        {
            "type": "string"
        },
        "author":
        {
            "type": "string"
        }
    }
}

res = tornado_jsonapi.resource.DBAPI2Resource(
    schema, sqlite3, sqlite3.connect(':memory:'))
res._create_table()

application = tornado.web.Application([
    (
        r"/api/posts/([^/]*)",
        tornado_jsonapi.handlers.APIHandler,
        dict(resource=res)
    )
])
application.listen(8888)
tornado.ioloop.IOLoop.current().start()

Installation

$ pip install tornado_jsonapi

Documentation

https://tornado_jsonapi.readthedocs.org

Roadmap

a.k.a. TODO

  • improve documentation :pensive:

  • automatic API doc generation based on JSON schema;

  • MongoDB/Motor support;

  • support for API testing.

License

This project is licensed under the MIT License.

Changelog

0.1.4 (2020-01-24)

  • Added support for column blacklisting and pagination, thanks to Zachary Gorak.

0.1.3 (2016-04-07)

  • Fixed incompatibility with latest python-jsonschema-objects

  • Updated obsolete requirements

  • Adjusted supported Python versions

0.1.2 (2016-04-07)

  • Fixed dependencies issue preventing installation in environment with LANG=C

0.1.0 (2016-03-21)

  • First release.

Metadata

Release files for tornado-jsonapi 0.1.4

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for tornado-jsonapi 0.1.4
File Size Uploaded
tornado_jsonapi-0.1.4.tar.gz 16.1 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for tornado-jsonapi 0.1.4
File Interpreter ABI Platform
tornado_jsonapi-0.1.4-py3-none-any.whl Python 3 none any Details

Total release size: 28.4 kB

Release files / tornado_jsonapi-0.1.4.tar.gz

Download URL tornado_jsonapi-0.1.4.tar.gz
Size 16.1 kB
Tags Source
SHA-256 checksum
How to use checksums
6bd611038ac6cd7a8003b542bee574281823b5b6d1862f63b6c11bb3e31e6fa9
BLAKE2b-256 checksum
How to use checksums
ba33e9716c64e0d8b3f4f8750a1647817b2ab9d9198bd0deaa758615dca8db24
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.1.1 pkginfo/1.5.0.1 requests/2.22.0 setuptools/45.1.0 requests-toolbelt/0.9.1 tqdm/4.41.1 CPython/3.6.9

Release files / tornado_jsonapi-0.1.4-py3-none-any.whl

Download URL tornado_jsonapi-0.1.4-py3-none-any.whl
Size 12.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
8e37a1160fe26e95f7f21bb4b73512c91f0d9e757b85c07fd0f91ede02e90023
BLAKE2b-256 checksum
How to use checksums
c1135aff1f8f64744361305b18366321b9c88590236335c9a0c871b4aee485ce
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.1.1 pkginfo/1.5.0.1 requests/2.22.0 setuptools/45.1.0 requests-toolbelt/0.9.1 tqdm/4.41.1 CPython/3.6.9

Release history Release notifications | RSS feed

This release

0.1.4 This release

2 release files

0.1.3

1 release file

0.1.2

1 release file

0.1.1

1 release file

0.1

1 release file

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page