Skip to main content

Overview

Whilst looking about to see if anyone had proposed a __json__ protocol for Python, I found this article and it struck me as so simple and obviously right.

So, I decided to provide a lib to make it easier for everyone.

Usage

Just pass json_default.default as the default function when calling json.dump(s).

import json

from json_default import default

...

return json.dumps(mydata, default=default)

If you have more types you want to define serialisation for, just add them:

from json_default import default


@default.register(mytype):
def _(obj):
    ...

Metadata

Release files for json-default 0.2

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

Source distribution (sdist)

Source distribution for json-default 0.2
File Size Uploaded Provenance Actions
json_default-0.2.tar.gz 2.7 kB Without provenance Details for json_default-0.2.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for json-default 0.2
File Interpreter ABI Platform Actions
json_default-0.2-py2.py3-none-any.whl Python 3, Python 2 none any Details for json_default-0.2-py2.py3-none-any.whl

Total release size: 5.9 kB

Release files / json_default-0.2.tar.gz

Download URL json_default-0.2.tar.gz
Size 2.7 kB
Tags Source
SHA-256 checksum
How to use checksums
ec3106abab937b088c243bef22e9d92444bfc15ba664867bbf0b6480ea80975f
BLAKE2b-256 checksum
How to use checksums
dff89814d8d849ebc7e808cae91c522881b7449b8977bec0b0199f901c5c383b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Release files / json_default-0.2-py2.py3-none-any.whl

Download URL json_default-0.2-py2.py3-none-any.whl
Size 3.2 kB
Tags Python 2 Python 3
SHA-256 checksum
How to use checksums
986d9db82208689cd5d0ec1ee3672317fbd51f83419c93222378192cdf690568
BLAKE2b-256 checksum
How to use checksums
2373e49f40041bf41d510e32bedaae1b2646cada083cbda9283d8cb2f1e37d70
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Security for json-default 0.2

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.

No provenance found

None of the files in this release were uploaded with provenance metadata.

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

0.2 This release

2 release files No 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