Skip to main content

jsonify-objects

Recursively convert almost any Python object to a JSON-serializable structure.

Installation

pip install jsonify-objects

Usage

dumps

Drop-in wrapper around json.dumps that handles non-serializable types.

from jsonify_objects import dumps

dumps({"a": 1, "b": True})
# '{\n  "a": "1",\n  "b": "true"\n}'

jsonify_objects

Returns the converted structure without serializing to a string.

from jsonify_objects import jsonify_objects

jsonify_objects({"a": 1, "b": True})
# {"a": "1", "b": "true"}

Behavior

Primitives

Primitive values inside plain dicts and lists are converted to strings.

Type Output
int, float str(value)
bool "true" / "false"
str unchanged
None null
Enum str(value.value)
dumps({"x": 42, "flag": True, "color": Color.RED})
# {"x": "42", "flag": "true", "color": "red"}

Dataclasses and objects

By default, non-serializable objects fall back to repr.

dumps({"user": UserDataclass("Alice", 30)})
# {"user": "UserDataclass(name='Alice', age=30)"}

Pass serialize_objects=True to expand objects and dataclasses into dicts. Numeric fields on expanded objects preserve their native JSON types.

dumps({"user": UserDataclass("Alice", 30)}, serialize_objects=True)
# {"user": {"name": "Alice", "age": 30}}

Nested objects are expanded recursively.

dumps({"person": Person("Bob", Address("NYC"))}, serialize_objects=True)
# {"person": {"name": "Bob", "address": {"city": "NYC"}}}

Objects without a __dict__ (e.g. slots-only classes) fall back to repr.

indent

dumps accepts an indent parameter (default 2) passed through to json.dumps.

dumps({"a": 1}, indent=4)

Metadata

Release files for jsonify-objects 1.0.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for jsonify-objects 1.0.0
File Size Uploaded Provenance
jsonify_objects-1.0.0.tar.gz 15.7 kB With provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for jsonify-objects 1.0.0
File Interpreter ABI Platform
jsonify_objects-1.0.0-py3-none-any.whl Python 3 none any Details

Total release size: 19.6 kB

Release files / jsonify_objects-1.0.0.tar.gz

Download URL jsonify_objects-1.0.0.tar.gz
Size 15.7 kB
Tags Source
SHA-256 checksum
How to use checksums
9321a630e95e77bbb5df9a523879c0349991f1ee2e3f5a6f3292e6085a95d424
BLAKE2b-256 checksum
How to use checksums
03f673ae7fbf7fec71aec8e8b2982bd51f77cd988092f20caef3b533ffa04dbe
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.12

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Apr 21, 2026.

Transparency log

Release files / jsonify_objects-1.0.0-py3-none-any.whl

Download URL jsonify_objects-1.0.0-py3-none-any.whl
Size 3.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
b3fcf84e7701db0a32f2f1f2d1ba49e839b651b51ee0b1dedadc2a4efaa294ba
BLAKE2b-256 checksum
How to use checksums
08a111ecb0118178606980dba8d32a772e3ea31f243221bd3074f1bdb5c10877
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.12

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Apr 21, 2026.

Transparency log

Security for jsonify-objects 1.0.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

All 2 files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for jsonify_objects-1.0.0.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Apr 21, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

1.0.0 This release

2 release files Full provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page