serdechko is a lightweight, type-safe JSON serializer and deserializer for Python NamedTuple models that uses type annotations as the schema and returns Result values instead of raising exceptions.

Stars

6

7-day growth

No data

Forks

0

Open issues

0

License

MIT

Last updated

2026-07-29

AI repository intelligence
FR-AI / ANALYSIS

Why it is worth attention

It requires no base classes, decorators, or DSL—plain NamedTuples with type hints define the schema—and it embraces the Result pattern from Rust for explicit error handling, making failure paths visible in function signatures.

Who it is for

  • Python developers who prefer immutable data models (NamedTuple) for JSON processing
  • Teams wanting a minimal, dependency-light alternative to heavy serialization frameworks like pydantic or marshmallow
  • Developers familiar with Rust's Result type who want similar error handling in Python
  • Projects that need quick, type-safe JSON parsing in Python 3.12+ environments

Use cases

  • Parsing JSON API responses into typed, immutable data structures
  • Deserializing configuration files with validation and clear error messages
  • Building command-line tools that consume JSON input and produce typed objects
  • Prototyping where low overhead and simple setup are critical

Strengths

  • Single-file, single-dependency (rustypie) design makes it easy to vendor or integrate
  • Full coverage of common types: datetime, UUID, Enum, nested models, Optional, Union
  • Errors are returned as rusty.Result values, enabling composable error handling without try/except
  • 100% test coverage and MIT license provide reliability and freedom

Considerations

  • Only supports typing.NamedTuple models, excluding dataclasses, attrs, or Pydantic models
  • Requires Python 3.12 or later due to type hint features
  • Boolean deserialization is strict—only native JSON booleans are accepted; truthy strings/numbers rejected

README quick start

Installation

Description

A lightweight, type-safe JSON (de)serializer for NamedTuple-based models.

Related repositories

Similar projects matched by category, topics, and programming language.

lopopolo
Featured
lopopolo GitHub avatar

harness-engineering

Harness Engineering is a methodology for improving coding agent outputs by carefully crafting the environment around them—providing curated context, tools, and executable constraints that encode an organization’s nonfunctional requirements and cumulative lessons.

AI & Machine LearningAI Agents
2,390
slvDev
Featured
slvDev GitHub avatar

esp32-ai

A 28.9 million parameter language model runs on an $8 ESP32-S3 microcontroller entirely on-device, generating simple stories at about 9.5 tokens per second.

AI & Machine LearningLarge Language Models
1,960
littledivy
Featured
littledivy GitHub avatar

mimic

mimic captures traffic from any iOS or web app and automatically generates a Python client library that lets you call the app's API like a regular library.

AI & Machine Learning
1,482