Skip to main content

Convert json to object and back in Python.

Project description

JSONClass

Convert json to object and back in Python.

Example

from jsonclass import JSONClass


class Test(JSONClass):
    field: str


obj = Test()
obj.field = "value"
assert obj.to_json()["field"] == "value"

obj = JSONClass({"__json_class__": "Test", "field": "value2"})
assert isinstance(obj, Test)
assert obj.field = "value2"

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

jsonclass-0.0.9.tar.gz (15.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

jsonclass-0.0.9-py3-none-any.whl (14.9 kB view details)

Uploaded Python 3

File details

Details for the file jsonclass-0.0.9.tar.gz.

File metadata

  • Download URL: jsonclass-0.0.9.tar.gz
  • Upload date:
  • Size: 15.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.10.10

File hashes

Hashes for jsonclass-0.0.9.tar.gz
Algorithm Hash digest
SHA256 356ac1fbf6bf01b49d2bac40388c4908e430c329ddf800c77d16c2a91c74f13d
MD5 d7977cdc165fc2f0c407aa2ecd293409
BLAKE2b-256 b2558317688fc4f8e01eb993feb91642570c512fa98ba380a8ee02f85a6048f9

See more details on using hashes here.

File details

Details for the file jsonclass-0.0.9-py3-none-any.whl.

File metadata

  • Download URL: jsonclass-0.0.9-py3-none-any.whl
  • Upload date:
  • Size: 14.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.10.10

File hashes

Hashes for jsonclass-0.0.9-py3-none-any.whl
Algorithm Hash digest
SHA256 eea374d1673f07b27f9eb7c88988381f71f4cfde5cf4613a73551fbf08fbc8eb
MD5 807135e2681a8e53756ed9d16274de47
BLAKE2b-256 e5bd5b211388060bb4f040e863bbc67f4514f53f0bf88a58ea5348860ad88853

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page