A python jsend library
Project description
python jsend pypi: https://pypi.python.org/pypi/pyjsend/
About jsend
Install
pip install pyjsend
Usage
import module:
>>> import jsend
success:
>>> jsend.success({'key': 'value'}) {'status': 'success', 'data': {'key': 'value'}}
fail:
>>> jsend.fail({'key': 'value'}) {'status': 'fail', 'data': {'key': 'value'}}
error:
>>> jsend.error('message') {'status': 'error', 'message': 'message'}
is success:
>>> jsend.is_success({'status':'success'}) True
is fail:
>>> jsend.is_fail({'status':'fail'}) True
is error:
>>> jsend.is_error({'status':'error'}) True
to json string:
>>> jsend.success({'key': 'value'}).jsonify() '{"status": "success", "data": {"key": "value"}}'
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
pyjsend-0.1.0.tar.gz
(3.1 kB
view hashes)
Built Distribution
Close
Hashes for pyjsend-0.1.0-py2.py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | f9bd4ba67ed3e4afaf6b6b1909bc1d67df4f82ab6e608cb26a080f2eae5500ee |
|
MD5 | 63a8417253b960951a991f544a4a61a3 |
|
BLAKE2b-256 | 32d5aac7a76371a66145cb92696d8ea3014e391ebc6cf9e62a2b647340d63da4 |