jsons
For serializing Python objects to JSON (dicts) and back
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 jsonsuv
uv add jsonspoetry
poetry add jsonsInstalling 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
Tags
More Software Development packages
Provides backported and experimental type hints…
permissive · top 100 on PyPI
numpyNumPy provides an N-dimensional array object…
permissive · top 100 on PyPI
fastapiFastAPI is a Python web framework for building…
permissive · top 100 on PyPI
annotated-docProvides a way to document function parameters,…
permissive · top 100 on PyPI
typerTyper builds command-line applications from…
permissive · top 1,000 on PyPI
distlibDistlib provides low-level packaging utilities…
permissive · top 1,000 on PyPI
databind.jsonDeserializes and serializes Python dataclasses…
permissive · top 15,000 on PyPI
dataclass-factoryConverts dataclasses to and from dictionaries…
permissive · top 15,000 on PyPI
databindDatabind deserializes JSON-like nested data…
permissive · top 15,000 on PyPI
vdfSerializes and deserializes Valve's KeyValue…
permissive · top 15,000 on PyPI
serpyco-rsSerializes and deserializes Python dataclasses…
permissive · top 15,000 on PyPI
typedloadLoads and dumps JSON-like data into typed…
copyleft · top 1,000 on PyPI
php2jsonConverts PHP serialized strings to JSON format,…
permissive · top 15,000 on PyPI
typed-json-dataclassAdds JSON serialization and type validation to…
permissive · top 15,000 on PyPI
databind.coreDeserializes and serializes Python dataclasses…
permissive · top 15,000 on PyPI
attrsattrs is a Python library that automatically…
permissive · top 100 on PyPI