--- id: jsons version: "1.6.3" license: MIT license_treatment: permissive maintenance: dormant --- # jsons — For serializing Python objects to JSON (dicts) and back License: permissive · Maintenance: dormant · Downloads: 1.5M/mo ## 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 above — 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 pip install jsons uv add jsons 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_current - Install friction: low - Maintenance: dormant - Downloads: 1.5M/month (top 5,000 on PyPI) - Known vulnerabilities: none known ## Tags python object to json serialization, dataclass json serializer, deserialize json to python objects, json serialization without boilerplate, attrs dataclass json conversion, typed json deserialization, serialization, dataclass-json, type-aware [View on SkillFed](https://skillfed.io/packages/jsons) · [View on PyPI](https://pypi.org/project/jsons/)