skillfed

jsonobject

A library for dealing with JSON as python objects

jsonobject v2.3.1 395.1K downloads/30d#6,984 on PyPI236
Permissive 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) AGING released

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 jsonobject

uv

uv add jsonobject

poetry

poetry add jsonobject

Installing 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

License :: OSI Approved :: BSD LicenseProgramming Language :: PythonProgramming Language :: Python :: 3Programming Language :: Python :: 3.10Programming Language :: Python :: 3.11Programming Language :: Python :: 3.12Programming Language :: Python :: 3.13Programming Language :: Python :: 3.9

Tags

json to python object mappingschema-based json deserializationnested json handlingjson object serializationtyped json wrapperpython object json conversionjson schema validation
json-serializationschema-mappingdata-validation

More Software Development packages