JSON:API ORM
Quick and dirty ORM that maps JSON:API responses to object attributes.
Free software: BSD license
Documentation: https://jsonapi-orm.readthedocs.io.
How To
Use Requests or (if you are a masochist) Python’s built-in urllib modules to make the request to your JSON:API service and from there pass the response to JSON:API ORM.
So, first install requests and this lib:
pip install requests
pip install jsonapi-orm
Switch to your Python code and use the magic!
import requests
from jsonapi_orm import response_to_obj
# list of items
r = requests.get('http://jsonapiplayground.reyesoft.com/v2/authors')
obj = response_to_obj(r.json())
print('LIST OF ITEMS:')
for item in obj.data:
print(item.name)
# single item
r = requests.get('http://jsonapiplayground.reyesoft.com/v2/authors/1')
obj = response_to_obj(r.json())
print('SINGLE ITEM')
print(obj.data.name)
History
0.1.3 (2018-03-25)
Fixed a bug when child data is non-existent.
0.1.2 (2018-03-25)
Fixed a bug when included is not present in response.
0.1.0 (2018-03-24)
First release on PyPI.
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 jsonapi-orm-0.1.3.tar.gz.
File metadata
- Download URL: jsonapi-orm-0.1.3.tar.gz
- Upload date:
- Size: 15.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
ee9c0d15031ba3e9bcb6ff3384b8b4687ed85cb36f0dd6946d8dd912422b8125
|
|
| MD5 |
2dff4ea96d67f1b280fbe419d348224d
|
|
| BLAKE2b-256 |
6e456e8207b6b46a133cc776843c32603618f6c2850cab8ca9dce01fc679cfb2
|
File details
Details for the file jsonapi_orm-0.1.3-py2.py3-none-any.whl.
File metadata
- Download URL: jsonapi_orm-0.1.3-py2.py3-none-any.whl
- Upload date:
- Size: 3.6 kB
- Tags: Python 2, Python 3
- Uploaded using Trusted Publishing? No
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
47fbc24bdd9ebc4c949456ea457b96a63d412e199c4669725a9f464b49a2fcbd
|
|
| MD5 |
ce0d1c1af47754a44ad77e49a13401c6
|
|
| BLAKE2b-256 |
05f101f16b927db1d47190b9f51dcaf077cf5d56f4762a6dbbace67442e4b177
|