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.2.1.tar.gz
(3.4 kB
view hashes)
Built Distribution
Close
Hashes for pyjsend-0.2.1-py2.py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 76e82daad175266b8d995bcfa7cc7d32ea7ed0ffdef0630d5ef03ce9833afed8 |
|
MD5 | b9c40d73132905a4a553ce4018c5d71e |
|
BLAKE2b-256 | f43e5a3c3f5a04d702ba4144065dc6aa2c7491bfea00b96d8e3de59c928a641a |