Skip to main content

JSON:API ORM

https://img.shields.io/pypi/v/jsonapi_orm.svg https://img.shields.io/travis/mislavcimpersak/jsonapi_orm.svg Documentation Status

Quick and dirty ORM that maps JSON:API responses to object attributes.

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

jsonapi-orm-0.1.3.tar.gz (15.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

jsonapi_orm-0.1.3-py2.py3-none-any.whl (3.6 kB view details)

Uploaded Python 2Python 3

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

Hashes for jsonapi-orm-0.1.3.tar.gz
Algorithm Hash digest
SHA256 ee9c0d15031ba3e9bcb6ff3384b8b4687ed85cb36f0dd6946d8dd912422b8125
MD5 2dff4ea96d67f1b280fbe419d348224d
BLAKE2b-256 6e456e8207b6b46a133cc776843c32603618f6c2850cab8ca9dce01fc679cfb2

See more details on using hashes here.

File details

Details for the file jsonapi_orm-0.1.3-py2.py3-none-any.whl.

File metadata

File hashes

Hashes for jsonapi_orm-0.1.3-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 47fbc24bdd9ebc4c949456ea457b96a63d412e199c4669725a9f464b49a2fcbd
MD5 ce0d1c1af47754a44ad77e49a13401c6
BLAKE2b-256 05f101f16b927db1d47190b9f51dcaf077cf5d56f4762a6dbbace67442e4b177

See more details on using hashes here.

Release history Release notifications | RSS feed

0.1.8

2 files

0.1.7

2 files

0.1.6

2 files

0.1.5

2 files

0.1.4

2 files

This release

0.1.3 This release

2 files

0.1.2

2 files

0.1.0

2 files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page