Return pretty JSON responses from the Bottle Web Framework.
Project description
bottle-json-pretty
A plugin for the Bottle Web Framework that returns pretty formatted JSON.
The plugin extends the default JSON formatter's behavior by adding the indent keyword argument to each call.
This is supported by at least the standard library json, ujson, and simplejson (1, 2, 3).
Indent level and formatting during production can be controlled via the initializer.
from bottle import Bottle
from bottle_json_pretty import JSONPrettyPlugin
app = Bottle(autojson=False)
app.install(JSONPrettyPlugin(indent=2, pretty_production=True))
@app.get('/')
def bottle_test():
return {
'status': 'ok',
'code': 200,
'messages': [],
'result': {
'test': {
'working': True
}
}
}
app.run()
Project details
Release history Release notifications | RSS feed
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
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file bottle_json_pretty-0.1.2.tar.gz.
File metadata
- Download URL: bottle_json_pretty-0.1.2.tar.gz
- Upload date:
- Size: 3.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/50.3.0 requests-toolbelt/0.9.1 tqdm/4.48.2 CPython/3.6.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
5e14c8c3166fb3fb54e3b0ddd32230c5ee845d3412f020f2b3bd70925b180c9a
|
|
| MD5 |
6a547b420ad9db8c083b9da1ce0c6289
|
|
| BLAKE2b-256 |
d6aed623a94227f124a1ef9db3507e7314e9383a68756879c743c1039a4a1877
|
File details
Details for the file bottle_json_pretty-0.1.2-py2.py3-none-any.whl.
File metadata
- Download URL: bottle_json_pretty-0.1.2-py2.py3-none-any.whl
- Upload date:
- Size: 3.3 kB
- Tags: Python 2, Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/50.3.0 requests-toolbelt/0.9.1 tqdm/4.48.2 CPython/3.6.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
04d11cb58717d5aa69c8b64f4943a3c8ee60f19b4dbed81af4b630dd61b2bab3
|
|
| MD5 |
4c8e35a9c1537da23c8f676fa0a3b2d7
|
|
| BLAKE2b-256 |
8d49b1507975dda98019b4650e2a206574c73a76486995674446d22b6b2aa227
|