Framework providing REST JSON API to Tornado web server
Project description
Tornado_jsonapi
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
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.
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file tornado_jsonapi-0.1.4.tar.gz
.
File metadata
- Download URL: tornado_jsonapi-0.1.4.tar.gz
- Upload date:
- Size: 16.1 kB
- Tags: Source
- Uploaded using 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
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 6bd611038ac6cd7a8003b542bee574281823b5b6d1862f63b6c11bb3e31e6fa9 |
|
MD5 | 67cc453689527c7f9bbf038d1c0dd7f8 |
|
BLAKE2b-256 | ba33e9716c64e0d8b3f4f8750a1647817b2ab9d9198bd0deaa758615dca8db24 |
File details
Details for the file tornado_jsonapi-0.1.4-py3-none-any.whl
.
File metadata
- Download URL: tornado_jsonapi-0.1.4-py3-none-any.whl
- Upload date:
- Size: 12.3 kB
- Tags: Python 3
- Uploaded using 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
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 8e37a1160fe26e95f7f21bb4b73512c91f0d9e757b85c07fd0f91ede02e90023 |
|
MD5 | 2bfbda2ddfb357bfc35dea1fd9cc64ab |
|
BLAKE2b-256 | c1135aff1f8f64744361305b18366321b9c88590236335c9a0c871b4aee485ce |