Skip to main content

JSON Dataclass Object Mapper

Project description

#JSONUT jsonut can be used to convert json objects to Python data class objects and vice versa.

How to Use

Example

from dataclasses import dataclass, field
from typing import *

import jsonut

# Sample Dataclass Object
@dataclass
class SampleObject(jsonut.JsonSerializable):
    name: str = field(default_factory=str)
    numbers: List[int] = field(default_factory=list)

    def __eq__(self, other):
        if not isinstance(other, self.__class__):
            return False

        if self.name != other.name:
            return False

        if self.numbers != other.numbers:
            return False

        return True


# Create an object
# sample_obj = create_sample_object()

# Serialization
serialized = serialize(sample_obj)

# Deserialization
deserialized = deserialize(serialized)

How to Deploy to PyPI

refer with: https://packaging.python.org/tutorials/packaging-projects/

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

jsonut-0.1.0.tar.gz (2.8 kB view hashes)

Uploaded Source

Built Distribution

jsonut-0.1.0-py3-none-any.whl (15.6 kB view hashes)

Uploaded Python 3

Supported by

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