skillfed

jsons

For serializing Python objects to JSON (dicts) and back

jsons v1.6.3 1.5M downloads/30d#3,867 on PyPI291
Permissive license MIT DORMANT released

What it is and what it does

jsons is a serialization library that converts Python objects into JSON-compatible dicts and strings, then deserializes them back into typed instances. It works with dataclasses, attrs classes, and plain Python objects without requiring changes to your class definitions. The library handles common types (datetime, date, time, timezone, timedelta, Decimal, Path) and supports generic types like List and Dict with type hints.

You use it by calling jsons.dump() to serialize an instance to a dict, and jsons.load() to deserialize a dict back into a typed object. It's designed to be customizable and extendable, with support for complex nested structures and optional type-aware validation. The single runtime dependency is typish, and installation is straightforward.

Use it for:

  • Serialize dataclass instances to JSON for API responses or file storage without manual field mapping.
  • Deserialize JSON payloads into typed dataclass or attrs objects with automatic type conversion (e.g., string to datetime).
  • Convert Python objects to dicts for database storage or caching while preserving type information.
  • Handle nested structures with generic types (e.g., List[MyClass] or Dict[str, OtherClass]) in a single call.
  • Build REST API handlers that accept JSON and automatically convert it to domain objects.

Worth the install?

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

Converts Python objects (dataclasses, attrs classes, and plain objects) to JSON-serializable dicts and strings, and deserializes them back to typed instances.

Yes, if you need straightforward object-to-JSON serialization for dataclasses or attrs without boilerplate. The library is stable and has no known vulnerabilities, but be aware it is dormant (last release 2022-06-09, last commit 2023-12-29). It works well for current Python versions and common use cases, but may not receive updates for future language features. Install it if your project's Python version and dependencies are stable; avoid it if you need active maintenance or cutting-edge typing support.

Install

jsons on PyPI

pip

pip install jsons

uv

uv add jsons

poetry

poetry add jsons

Installing jsons

Before you install

Low install friction; single runtime dependency (typish). Maintenance is dormant—last release was 2022-06-09 and last commit 2023-12-29. No active development reported.

License in practice

MIT license (permissive). No restrictions on use, modification, or distribution in commercial or private projects.

Quickstart

pip install jsons

import jsons
from dataclasses import dataclass
from datetime import datetime

@dataclass
class Person:
    name: str
    birthday: datetime

p = Person('Guido van Rossum', datetime(1956, 1, 31, 12, 0))
out = jsons.dump(p)  # {'name': 'Guido van Rossum', 'birthday': '1956-01-31T12:00:00'}
p2 = jsons.load(out, Person)  # Deserialize back to Person instance

Verify before relying

  • Whether dormant status poses compatibility risks with Python 3.11+ or newer typing constructs.
  • Real-world performance characteristics when serializing deeply nested or large object graphs.
  • Whether typish dependency is actively maintained and compatible with current Python versions.

Package facts

License MIT (permissive)
Python support supports the current Python release (>=3.5)
Install friction low — pure-Python wheel
Runtime dependencies 1 — typish
Maintenance dormant — 1,527 days since the last release
Last repo commit
First released
Downloads 1,471,741/month — #3,867 on PyPI (30-day window, as of 2026-08-14)
Known vulnerabilities none known (OSV.dev, checked 2026-08-14)

Evidence: jsons-1.6.3-py3-none-any.whl

Intended Audience :: DevelopersLicense :: OSI Approved :: MIT LicenseNatural Language :: EnglishOperating System :: OS IndependentProgramming Language :: PythonProgramming Language :: Python :: 3Programming Language :: Python :: 3.10Programming Language :: Python :: 3.5Programming Language :: Python :: 3.6Programming Language :: Python :: 3.7Programming Language :: Python :: 3.8Programming Language :: Python :: 3.9

Tags

python object to json serializationdataclass json serializerdeserialize json to python objectsjson serialization without boilerplateattrs dataclass json conversiontyped json deserialization
serializationdataclass-jsontype-aware

More Software Development packages