# Tornado-JSON
[](https://gitter.im/hfaran/Tornado-JSON?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)
[](https://travis-ci.org/hfaran/Tornado-JSON)
[](https://coveralls.io/r/hfaran/Tornado-JSON?branch=master)
[](https://readthedocs.org/projects/tornado-json/?badge=latest)
[](http://waffle.io/hfaran/Tornado-JSON)
[](https://pypi.python.org/pypi/Tornado-JSON/)
[](https://pypi.python.org/pypi/Tornado-JSON/)
[](https://pypi.python.org/pypi/Tornado-JSON/)
[](https://pypi.python.org/pypi/Tornado-JSON/)
[](https://pypi.python.org/pypi/Tornado-JSON/)
## Overview
Tornado-JSON is a small extension of [Tornado](http://www.tornadoweb.org/en/stable/) with the intent of providing the tools necessary to get a JSON API up and running quickly.
Some of the key features the included modules provide:
* Input and output **[JSON Schema](http://json-schema.org/) validation** by decorating RequestHandlers with `@schema.validate`
* **Automated route generation** with `routes.get_routes(package)`
* **Automated [GFM](https://help.github.com/articles/github-flavored-markdown)-formatted API documentation** using schemas and provided descriptions
* **Standardized JSON output** using the **[JSend](http://labs.omniti.com/labs/jsend)** specification
## Usage
Check out the [Hello World demo](https://github.com/hfaran/Tornado-JSON/tree/master/demos/helloworld) for a quick example and the [accompanying walkthrough](http://tornado-json.readthedocs.org/en/latest/using_tornado_json.html) in the documentation. And then [**explore Tornado-JSON on readthedocs for the rest!**](http://tornado-json.readthedocs.org/en/latest/index.html#)
```python
import tornado.ioloop
from tornado_json.routes import get_routes
from tornado_json.application import Application
import mywebapp
# Automatically generate routes for your webapp
routes = get_routes(mywebapp)
# Create and start application
application = Application(routes=routes, settings={})
application.listen(8888)
tornado.ioloop.IOLoop.instance().start()
```
### Example Projects That Use Tornado-JSON
* https://github.com/hfaran/CitySportsLeague-Server
* https://github.com/hfaran/LivesPool
## Installation
* For the possibly stable
```bash
pip install Tornado-JSON
```
* For the latest and greatest
```bash
git clone https://github.com/hfaran/Tornado-JSON.git
cd Tornado-JSON
python setup.py develop
```
## Contributing
If there is something you would like to see improved, you would be awesome for [opening an issue about it](https://github.com/hfaran/Tornado-JSON/issues/new), and I'll promise my best to take a look.
Pull requests are absolutely welcome as well!
## License
This project is licensed under the MIT License.
## Running Tests
```bash
sudo pip2 install tox
sudo pip3 install tox
tox # Will run test matrix
```
[](https://gitter.im/hfaran/Tornado-JSON?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)
[](https://travis-ci.org/hfaran/Tornado-JSON)
[](https://coveralls.io/r/hfaran/Tornado-JSON?branch=master)
[](https://readthedocs.org/projects/tornado-json/?badge=latest)
[](http://waffle.io/hfaran/Tornado-JSON)
[](https://pypi.python.org/pypi/Tornado-JSON/)
[](https://pypi.python.org/pypi/Tornado-JSON/)
[](https://pypi.python.org/pypi/Tornado-JSON/)
[](https://pypi.python.org/pypi/Tornado-JSON/)
[](https://pypi.python.org/pypi/Tornado-JSON/)
## Overview
Tornado-JSON is a small extension of [Tornado](http://www.tornadoweb.org/en/stable/) with the intent of providing the tools necessary to get a JSON API up and running quickly.
Some of the key features the included modules provide:
* Input and output **[JSON Schema](http://json-schema.org/) validation** by decorating RequestHandlers with `@schema.validate`
* **Automated route generation** with `routes.get_routes(package)`
* **Automated [GFM](https://help.github.com/articles/github-flavored-markdown)-formatted API documentation** using schemas and provided descriptions
* **Standardized JSON output** using the **[JSend](http://labs.omniti.com/labs/jsend)** specification
## Usage
Check out the [Hello World demo](https://github.com/hfaran/Tornado-JSON/tree/master/demos/helloworld) for a quick example and the [accompanying walkthrough](http://tornado-json.readthedocs.org/en/latest/using_tornado_json.html) in the documentation. And then [**explore Tornado-JSON on readthedocs for the rest!**](http://tornado-json.readthedocs.org/en/latest/index.html#)
```python
import tornado.ioloop
from tornado_json.routes import get_routes
from tornado_json.application import Application
import mywebapp
# Automatically generate routes for your webapp
routes = get_routes(mywebapp)
# Create and start application
application = Application(routes=routes, settings={})
application.listen(8888)
tornado.ioloop.IOLoop.instance().start()
```
### Example Projects That Use Tornado-JSON
* https://github.com/hfaran/CitySportsLeague-Server
* https://github.com/hfaran/LivesPool
## Installation
* For the possibly stable
```bash
pip install Tornado-JSON
```
* For the latest and greatest
```bash
git clone https://github.com/hfaran/Tornado-JSON.git
cd Tornado-JSON
python setup.py develop
```
## Contributing
If there is something you would like to see improved, you would be awesome for [opening an issue about it](https://github.com/hfaran/Tornado-JSON/issues/new), and I'll promise my best to take a look.
Pull requests are absolutely welcome as well!
## License
This project is licensed under the MIT License.
## Running Tests
```bash
sudo pip2 install tox
sudo pip3 install tox
tox # Will run test matrix
```
Release files for Tornado-JSON 1.3.4
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| Tornado-JSON-1.3.4.tar.gz | 15.7 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| Tornado_JSON-1.3.4-py2-none-any.whl | Python 2 | none | any | Details |
Total release size: 32.1 kB
Release files / Tornado-JSON-1.3.4.tar.gz
| Download URL | Tornado-JSON-1.3.4.tar.gz |
|---|---|
| Size | 15.7 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
079f55ee3cecbbbe0d71c0fd50c7f2bac474d5bb744ead1e1d3891650632ffc0
|
|
BLAKE2b-256 checksum How to use checksums |
0ae48885d884b9d099d1a5d5e7a98e6428b80d1cf24dceda18cbb558133fac8e
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
Python-urllib/2.7
|
Release files / Tornado_JSON-1.3.4-py2-none-any.whl
| Download URL | Tornado_JSON-1.3.4-py2-none-any.whl |
|---|---|
| Size | 16.4 kB |
| Tags | Python 2 |
|
SHA-256 checksum How to use checksums |
888b41a01516706cd083596c6cb2c1d5885c06e5b003f0ac8b65e8edf02ece55
|
|
BLAKE2b-256 checksum How to use checksums |
9714a113e3572bec942c0fc68dfb8ca7f16d6d9011dfa651ca13d98908e709ba
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
Python-urllib/2.7
|