Skip to main content
Pre-release

This release is a pre-release and may not be stable for production use.

JSON:APy - Loading and Dumping JSON:API in Python

WIP: this library is still in early development phase.

jsonapy is a Python library for dumping models into JSON:API-compliant JSON.

PyPi Python Version Tests & coverage codecov

Installation

With pip:

pip install jsonapy

Basic usage overview

This package lets you define models and dump them into dict with the JSON:API structure. First, define a resource:

import jsonapy

class PersonResource(jsonapy.BaseResource):
    id: int
    first_name: str
    last_name: str

    class Meta:
        resource_name = "person"

You can now dump an instance of this resource into JSON:API-structured dictionary:

guido = PersonResource(id=1, first_name="Guido", last_name="Van Rossum")
data = guido.jsonapi_dict(required_attributes="__all__")

The resulting data dictionary can be represented by:

{
    'type': 'person',
    'id': 1,
    'attributes': {
        'firstName': 'Guido', 
        'lastName': 'Van Rossum'
    }
}

Documentation

The complete documentation can be found here. It is built with pdoc.

Roadmap

Refer to the project to view the roadmap-related issues.

Metadata

Release files for jsonapy 0.1.5.dev1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for jsonapy 0.1.5.dev1
File Size Uploaded Provenance
jsonapy-0.1.5.dev1.tar.gz 14.2 kB Without provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for jsonapy 0.1.5.dev1
File Interpreter ABI Platform
jsonapy-0.1.5.dev1-py3-none-any.whl Python 3 none any Details

Total release size: 30.2 kB

Release files / jsonapy-0.1.5.dev1.tar.gz

Download URL jsonapy-0.1.5.dev1.tar.gz
Size 14.2 kB
Tags Source
SHA-256 checksum
How to use checksums
b7a807a4f1e295322fe31bf07b74e6f6775e4f1952541ab27bd7174af8cf2b3c
BLAKE2b-256 checksum
How to use checksums
0997957df3d83583577f2b223d6d20e5bc28428ef1dadb55e5f18a253e362edf
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.1.6 CPython/3.8.9 Windows/10

Release files / jsonapy-0.1.5.dev1-py3-none-any.whl

Download URL jsonapy-0.1.5.dev1-py3-none-any.whl
Size 16.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
8c91c99ecd099f9062b154382bb162366396daf8d35287f46b62b505af7be000
BLAKE2b-256 checksum
How to use checksums
713800e79351bc94900b9c9bc2bda388d08d15f3f11cbf0c0b1c4b68553b309c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.1.6 CPython/3.8.9 Windows/10

Security for jsonapy 0.1.5.dev1

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

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