marshmallow-jsonapi
JSON API 1.0 (https://jsonapi.org) formatting with marshmallow
What it is and what it does
marshmallow-jsonapi extends marshmallow to serialize Python objects into JSON API 1.0-compliant responses. It handles the structural requirements of the JSON API spec—wrapping data in a top-level 'data' key, separating attributes from relationships, and generating proper resource linkage—so you don't have to manually construct the envelope. You define a schema with field types and relationship declarations, then call dump() to get a spec-compliant response ready to send from your web API.
The package is built on top of marshmallow and adds JSON API-specific field types (like Relationship) and a Meta configuration layer to declare resource types and relationship URLs. It works with any Python web framework and is designed for straightforward serialization workflows where you want JSON API compliance without building the response structure by hand.
Use it for:
- Serialize REST API responses to JSON API 1.0 format in Flask, Django, or FastAPI applications.
- Define relationships between resources (author, comments) and automatically generate proper linkage in the response.
- Validate and deserialize incoming JSON API requests back into Python objects using marshmallow's validation layer.
- Build a consistent API response structure across multiple endpoints without manually constructing the envelope.
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
Produces JSON API 1.0-compliant output from Python objects using marshmallow schemas, with built-in support for relationships, resource linkage, and typed resources.
No. The package is archived and abandoned since 2023-06-28, with no releases for over 5 years. While it has low install friction and permissive licensing, the lack of maintenance means it will not receive bug fixes, security updates, or compatibility patches for current Python and marshmallow versions. Use only if you have an existing codebase already depending on it and cannot migrate; for new projects, choose an actively maintained JSON API library.
Install
marshmallow-jsonapi on PyPI
pip
pip install marshmallow-jsonapiuv
uv add marshmallow-jsonapipoetry
poetry add marshmallow-jsonapiInstalling marshmallow-jsonapi
Before you install
Low install friction; depends only on marshmallow. However, the package is archived and unmaintained since 2023-06-28, with no releases in over 5 years. Use only if you are committed to maintaining compatibility yourself or have no active development planned.
License in practice
MIT licensed (permissive). You can use, modify, and distribute freely with minimal restrictions, though you must include the license notice.
Quickstart
pip install marshmallow-jsonapi
from marshmallow_jsonapi import Schema, fields
class PostSchema(Schema):
id = fields.Str(dump_only=True)
title = fields.Str()
class Meta:
type_ = "posts"
schema = PostSchema()
result = schema.dump(post_object)
Requires Python >= 3.6; the package is archived and receives no updates.
Verify before relying
- Whether the package remains compatible with current versions of marshmallow and modern Python 3.x releases.
- Whether JSON API 1.0 spec compliance is maintained across edge cases or has drifted since the last release.
Package facts
| License | MIT (permissive) |
| Python support | supports the current Python release (>=3.6) |
| Install friction | low — pure-Python wheel |
| Runtime dependencies | 1 — marshmallow |
| Maintenance | abandoned — 2,056 days since the last release |
| Last repo commit | (repository archived) |
| First released | |
| Downloads | 99,830/month — #13,010 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: marshmallow_jsonapi-0.24.0-py2.py3-none-any.whl
Keywords: marshmallow-jsonapi, marshmallow, marshalling, serialization, jsonapi, deserialization, validation
Tags
More WWW/HTTP packages
urllib3 is an HTTP client library that provides…
permissive · top 100 on PyPI
requestsRequests is a Python HTTP library that…
permissive · top 100 on PyPI
h11h11 is a pure-Python HTTP/1.1 protocol…
permissive · top 100 on PyPI
httpxHTTPX is a fully featured HTTP client library…
permissive · top 100 on PyPI
httpcoreA minimal low-level HTTP client library that…
permissive · top 100 on PyPI
aiohttpaiohttp is an async HTTP client and server…
permissive · top 100 on PyPI
flask-marshmallowFlask-Marshmallow integrates Flask and…
permissive · top 5,000 on PyPI
marshmallowMarshmallow converts complex Python objects to…
permissive · top 1,000 on PyPI
djangorestframework-jsonapiAdapts Django REST framework to output…
permissive · top 15,000 on PyPI
apispecGenerates OpenAPI specification documents from…
permissive · top 5,000 on PyPI
marshmallow-sqlalchemyGenerates marshmallow schemas from SQLAlchemy…
permissive · top 5,000 on PyPI
marshmallow-oneofschemaExtends marshmallow to handle polymorphic…
permissive · top 5,000 on PyPI
DeepFriedMarshmallowAccelerates Marshmallow schema serialization…
permissive · top 15,000 on PyPI
amundsen-commonAmundsen Common provides shared utilities and…
unclear · top 15,000 on PyPI
uplinkUplink turns HTTP APIs into declarative Python…
permissive · top 15,000 on PyPI
sqlalchemy-serializerAdds a `.to_dict()` method to SQLAlchemy model…
permissive · top 15,000 on PyPI