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.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.2.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.2-py2.py3-none-any.whl (3.6 kB view details)

Uploaded Python 2Python 3

File details

Details for the file jsonapi-orm-0.1.2.tar.gz.

File metadata

  • Download URL: jsonapi-orm-0.1.2.tar.gz
  • Upload date:
  • Size: 15.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for jsonapi-orm-0.1.2.tar.gz
Algorithm Hash digest
SHA256 dd0c1b0395bd6443333af905e66a3c12b66ded34deeb7ab36350e28c9aa68c42
MD5 1cc4f8ad81c1b8d65cca013d94ba89a1
BLAKE2b-256 7a56084d6be0703cced9a304229f1f794e8ecf8d67fe1c200ef191a0ee76326a

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for jsonapi_orm-0.1.2-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 65ef19658d7f1cf75c272884d2f1f7829d04550a3249ee0b167ddb490f2e96fa
MD5 0c4201d9b6ad7d0d5bd548266e06249f
BLAKE2b-256 cb8aada72144817a3b62ee4301b4330be32372aa9b3d293d6e13606118b84fb2

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

0.1.3

2 files

This release

0.1.2 This release

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