--- id: jsonobject version: "2.3.1" 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) license_treatment: permissive maintenance: aging --- # jsonobject — A library for dealing with JSON as python objects License: permissive · Maintenance: aging · Downloads: 395.1K/mo ## 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 above — 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 pip install jsonobject uv add jsonobject 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_current - Install friction: medium - Maintenance: aging - Downloads: 395.1K/month (top 15,000 on PyPI) - Known vulnerabilities: none known ## Tags json to python object mapping, schema-based json deserialization, nested json handling, json object serialization, typed json wrapper, python object json conversion, json schema validation, json-serialization, schema-mapping, data-validation [View on SkillFed](https://skillfed.io/packages/jsonobject) · [View on PyPI](https://pypi.org/project/jsonobject/)