skillfed

typing-json

Type-aware Python JSON serialization and validation.

typing-json v0.1.3 110.0K downloads/30d#12,490 on PyPI
Permissive license Abandoned released

What it is and what it does

typing_json wraps Python's standard json module to add type awareness during serialization and deserialization. Instead of returning plain dictionaries and lists, it validates decoded JSON against a provided type annotation and raises TypeError if the data doesn't match. It supports a broad range of types—JSON primitives, Decimal, typed collections (List, Dict, Set, Tuple, etc.), TypedDict, NamedTuple, Literal, Union, Optional, and enums—making it useful when you want to deserialize JSON into statically typed Python objects with runtime guarantees.

The package provides three pairs of functions mirroring the standard library: dump/load for file I/O, dumps/loads for strings, and to_json_obj/from_json_obj for in-memory conversion. It also includes is_instance, which extends isinstance to handle all supported types. The main use case is ensuring that JSON data loaded into a statically typed application (e.g., one checked with mypy) conforms to its declared types at runtime.

Use it for:

  • Deserialize JSON API responses into typed dataclasses or TypedDict with automatic validation.
  • Load configuration files as typed structures and catch schema mismatches at runtime.
  • Serialize complex Python objects with nested typed collections back to JSON reliably.
  • Validate JSON data against type specifications in applications using static type checkers.
  • Convert JSON with Decimal values to typed structures while controlling int/float casting.

Worth the install?

AI-flagged interpretation of the facts on this page — verify before relying

Provides type-aware JSON serialization and deserialization with runtime type validation, extending Python's built-in json module to work with typed collections, Decimal, Literal, Union, Optional, and TypedDict.

No. The package is abandoned (last release 2067 days ago) with no active maintenance. While it has low install friction and permissive licensing, the lack of updates means unfixed bugs, no support for modern Python features, and no security patches. For new projects, use a maintained alternative like pydantic or msgspec; for existing code already relying on typing_json, consider migrating.

Install

typing-json on PyPI

pip

pip install typing-json

uv

uv add typing-json

poetry

poetry add typing-json

Installing typing-json

Before you install

Low install friction with a single lightweight dependency (typing-extensions). However, the package is abandoned as of 2067 days since last release; no active maintenance or security updates should be expected.

License in practice

Licensed under MIT (permissive), so you can use it freely in commercial and open-source projects without restriction, though you must include the license notice.

Quickstart

from typing import Dict
from typing_json import loads

data = loads('{"key": "value"}', Dict[str, str])
print(data)

Requires Python 3.7 or later; typing-extensions must be installed as a runtime dependency.

Verify before relying

  • Whether the package works correctly with Python versions beyond 3.7 despite classifier listing only 3.7.
  • Whether abandoned status means known bugs or incompatibilities with modern Python versions remain unfixed.
  • Real-world performance characteristics when handling large or deeply nested typed structures.

Package facts

License not declared (permissive)
Python support not specified
Install friction low — pure-Python wheel
Runtime dependencies 1 — typing-extensions
Maintenance abandoned — 2,067 days since the last release
First released
Downloads 109,955/month — #12,490 on PyPI (30-day window, as of 2026-08-14)
Known vulnerabilities none known (OSV.dev, checked 2026-08-14)

Evidence: typing_json-0.1.3-py3-none-any.whl

Development Status :: 4 - BetaLicense :: OSI Approved :: MIT LicenseNatural Language :: EnglishOperating System :: OS IndependentProgramming Language :: Python :: 3.7Typing :: Typed

Tags

typed json serializationjson with type validationruntime type checking jsontyped collections jsonjson schema validation pythontype-safe json encodingjson deserialization with types
json-serializationtype-validationabandoned

More Software Development packages