jsonobject
A library for dealing with JSON as python objects
What it is and what it does
jsonobject is a Python library that bridges JSON and Python objects by letting you define typed schemas that automatically convert between JSON strings (or dicts) and native Python objects. You define a class inheriting from JsonObject with typed properties (StringProperty, DateTimeProperty, ListProperty, etc.), then use it to wrap raw JSON data or construct objects that serialize back to JSON with proper type coercion—datetimes become ISO strings, decimals preserve precision, and nested objects compose naturally.
The library handles both construction styles: passing a dict of raw JSON data or using keyword arguments with Python-native types. It was originally inspired by couchdbkit's Document/DocumentSchema API and is used in production by CommCare HQ. The API is largely stable, though it is maintained at a slower cadence and targets Python 3.9 and later with no external runtime dependencies.
Use it for:
- Deserialize JSON API responses into typed Python objects with automatic datetime and decimal conversion.
- Define a schema once and use it to validate and wrap incoming JSON from external services or databases.
- Serialize complex Python objects with nested structures, dates, and custom types back to JSON for storage or transmission.
- Build configuration or data models that enforce type safety and provide IDE autocomplete for deeply nested JSON structures.
- Migrate from couchdbkit-based code to a simpler, standalone library with compatible API.
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
jsonobject provides a Python library for mapping deeply nested JSON structures to well-typed Python objects with automatic serialization and deserialization between the two representations.
Yes, if you need schema-based JSON-to-Python mapping with type safety and no external dependencies. The library is stable and permissively licensed. However, the aging maintenance status (last release 533 days ago) means you should verify compatibility with your Python version and use case before relying on it for new projects; consider alternatives if you need active development or advanced validation features.
Install
jsonobject on PyPI
pip
pip install jsonobjectuv
uv add jsonobjectpoetry
poetry add jsonobjectInstalling jsonobject
Before you install
Medium install friction due to compiled wheels for multiple Python versions (3.9–3.13), but no runtime dependencies. Last release was 533 days ago; repository is not archived and shows recent activity (last commit 2025-05-23), though maintenance status is aging.
License in practice
BSD 2-Clause license (permissive). You may use, modify, and distribute the package freely in commercial and private projects, provided you retain copyright notices and include the license text.
Quickstart
pip install jsonobject
from jsonobject import JsonObject, StringProperty, BooleanProperty, DateTimeProperty, ListProperty
import datetime
class User(JsonObject):
username = StringProperty()
name = StringProperty()
active = BooleanProperty(default=False)
date_joined = DateTimeProperty()
tags = ListProperty(unicode)
user = User(name='John Doe', username='jdoe', date_joined=datetime.datetime.utcnow(), tags=['generic'])
print(user.to_json())
Verify before relying
- Whether the aging maintenance status affects stability for new Python versions or modern use cases.
- Performance characteristics compared to alternatives for large or deeply nested JSON structures.
- Completeness of type validation and error handling for edge cases in production environments.
- Current download volume and active user base given the 533-day gap since last release.
Package facts
| License | Copyright (c) 2013-2014, Dimagi Inc., and individual contributors. All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that… (full text in the JSON record) (permissive) |
| Python support | supports the current Python release (>=3.9) |
| Install friction | medium — platform-specific wheel |
| Runtime dependencies | none |
| Maintenance | aging — 533 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 395,117/month — #6,984 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: jsonobject-2.3.1-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl; jsonobject-2.3.1-cp310-cp310-musllinux_1_2_x86_64.whl; jsonobject-2.3.1-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl; jsonobject-2.3.1-cp311-cp311-musllinux_1_2_x86_64.whl; jsonobject-2.3.1-cp312-cp312-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl; jsonobject-2.3.1-cp312-cp312-musllinux_1_2_x86_64.whl; jsonobject-2.3.1-cp313-cp313-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl; jsonobject-2.3.1-cp313-cp313-musllinux_1_2_x86_64.whl; jsonobject-2.3.1-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl; jsonobject-2.3.1-cp39-cp39-musllinux_1_2_x86_64.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
jsonconversionConverts arbitrary Python objects to JSON…
permissive · top 5,000 on PyPI
databind.jsonDeserializes and serializes Python dataclasses…
permissive · top 15,000 on PyPI
json-flattenConverts nested JSON objects into flat…
permissive · top 15,000 on PyPI
databindDatabind deserializes JSON-like nested data…
permissive · top 15,000 on PyPI
logging-jsonFormats Python logging records as JSON output,…
permissive · top 15,000 on PyPI
schemaValidates Python data structures (dicts, lists,…
permissive · top 1,000 on PyPI
databind.coreDeserializes and serializes Python dataclasses…
permissive · top 15,000 on PyPI
json-strong-typingSerializes Python dataclasses to JSON and…
permissive · top 15,000 on PyPI
yamlableConverts Python objects to YAML and back using…
permissive · top 15,000 on PyPI
json-encoderProvides JSON serialization with…
unclear · top 15,000 on PyPI