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 and load jsend string:
>>> jsend.success({'key': 'value'}).stringify() '{"status": "success", "data": {"key": "value"}}' >>> jsend.loads(jsend.success({'key': 'value'}).stringify()) {u'status': u'success', u'data': {u'key': u'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.1.tar.gz
(3.2 kB
view hashes)
Built Distribution
Close
Hashes for pyjsend-0.1.1-py2.py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 3ae8cdff179740eb735209e6b4d50ca347a6aaf24c033e83ca756dccdba140ef |
|
MD5 | f5413cab50588e24eb55fb52527b239a |
|
BLAKE2b-256 | 713043f115a788d635513e1b136a49505553c4a0c5187e1829f86c4801d0ac0d |