Skip to main content

marshmallow-jsonapi

⚠️ I still need this package in some of my projects. This for is minimal work required to keep it working

  • with newer Pythons and tooling (uv)

  • new marshmallow v4.x

⚠️ To allow integrating it in my projects, it is published on PyPI as marshmallow-jsonapi-minfork.

PyPI version Documentation code style: black

Homepage: http://marshmallow-jsonapi.readthedocs.io/

JSON API 1.0 (https://jsonapi.org) formatting with marshmallow.

marshmallow-jsonapi provides a simple way to produce JSON API-compliant data in any Python web framework.

from marshmallow_jsonapi import Schema, fields


class PostSchema(Schema):
    id = fields.Str(dump_only=True)
    title = fields.Str()

    author = fields.Relationship(
        "/authors/{author_id}", related_url_kwargs={"author_id": "<author.id>"}
    )

    comments = fields.Relationship(
        "/posts/{post_id}/comments",
        related_url_kwargs={"post_id": "<id>"},
        # Include resource linkage
        many=True,
        include_resource_linkage=True,
        type_="comments",
    )

    class Meta:
        type_ = "posts"


post_schema = PostSchema()
post_schema.dump(post)
# {
#     "data": {
#         "id": "1",
#         "type": "posts"
#         "attributes": {
#             "title": "JSON API paints my bikeshed!"
#         },
#         "relationships": {
#             "author": {
#                 "links": {
#                     "related": "/authors/9"
#                 }
#             },
#             "comments": {
#                 "links": {
#                     "related": "/posts/1/comments/"
#                 }
#                 "data": [
#                     {"id": 5, "type": "comments"},
#                     {"id": 12, "type": "comments"}
#                 ],
#             }
#         },
#     }
# }

Installation

pip install marshmallow-jsonapi

Documentation

Full documentation is available at https://marshmallow-jsonapi.readthedocs.io/.

Requirements

  • Python >= 3.6

License

MIT licensed. See the bundled LICENSE file for more details.

Metadata

Release files for marshmallow-jsonapi-minfork 0.26.0

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

Source distribution (sdist)

Source distribution for marshmallow-jsonapi-minfork 0.26.0
File Size Uploaded Provenance Actions
marshmallow_jsonapi_minfork-0.26.0.tar.gz 35.8 kB With provenance Details for marshmallow_jsonapi_minfork-0.26.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for marshmallow-jsonapi-minfork 0.26.0
File Interpreter ABI Platform Actions
marshmallow_jsonapi_minfork-0.26.0-py3-none-any.whl Python 3 none any Details for marshmallow_jsonapi_minfork-0.26.0-py3-none-any.whl

Total release size: 51.1 kB

Release files / marshmallow_jsonapi_minfork-0.26.0.tar.gz

Download URL marshmallow_jsonapi_minfork-0.26.0.tar.gz
Size 35.8 kB
Tags Source
SHA-256 checksum
How to use checksums
e56fc3978ae1c855dd3f47b2879a58662255b38e55b11f10ea8cadb8879fb60b
BLAKE2b-256 checksum
How to use checksums
22901b998dd32424acee0338cda059a96c0ab1a9559017ddad55702ef1965fdd
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.7

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Dec 17, 2025.

Transparency log

Release files / marshmallow_jsonapi_minfork-0.26.0-py3-none-any.whl

Download URL marshmallow_jsonapi_minfork-0.26.0-py3-none-any.whl
Size 15.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
74c87b44d66bdca4dfee9608915dd53c8a59e3e179adf89a0afbf200938442bd
BLAKE2b-256 checksum
How to use checksums
68658a78480c052bac6dca9c87e46daf4515bb0c4dcc5136f46b4789dcb6fb7d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.7

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Dec 17, 2025.

Transparency log

Security for marshmallow-jsonapi-minfork 0.26.0

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.

Full provenance

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for marshmallow_jsonapi_minfork-0.26.0.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Dec 17, 2025.

Transparency log

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.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.26.0 This release

2 release files Full provenance

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