How kalasjocke/hyp works
Hyp is a small Python library for building JSON:API-style response documents from models or primitives. An application supplies a responder and serializer, then calls build for a Python dictionary or respond for JSON text. The base responder constructs resource, relationship-link, linked-resource, and optional metadata sections; a selected Marshmallow or Schematics adapter serializes each resource. The graph shows the two documented adapter choices and their serializer dependencies. Runtime relationships are supported by the README or shown source excerpts.
Main entry points: base.py Base responder · marshmallow.py Marshmallow adapter · schematics.py Schematics adapter
Components 8
Response construction
- Base responder
hyp/base.py - Response document
hyp/base.py - JSON text
hyp/base.py
Serialization adapters
- Marshmallow adapter
hyp/marshmallow.py - Schematics adapter
hyp/schematics.py
Other components
- Application developer
- Marshmallow schema
- Schematics model
Connections 7
- Application developer → Base responder: calls
README.md - Base responder → Marshmallow adapter: selects adapter
hyp/marshmallow.py - Base responder → Schematics adapter: selects adapter
hyp/schematics.py - Base responder → Response document: builds
hyp/base.py - Base responder → JSON text: encodes
hyp/base.py - Marshmallow adapter → Marshmallow schema: dumps with
hyp/marshmallow.py - Schematics adapter → Schematics model: converts with
hyp/schematics.py