Skip to main content

A package for serializing and deserializing data

Project description

ClassSerialization

Python library for class JSON serialization.


Example usage

from sol239_serialization.serialization import serialize, deserialize

class Book:
    """
    Simple class class example
    """
    def __init__(self, title:str, authors:list, page_count:int, price:float):
        self.title = title
        self.authors = authors
        self.page_count = page_count
        self.price = price

class_book = Book("The Great Gatsby", ["F. Scott Fitzgerald"], 180, 10.99)

# SERIALIZE
serialized_json_string = serialize(class_book, save_file=True, file_path="fl.json")
print(serialized_json_string)

# DESERIALIZE
book = deserialize(Book, "fl.json")
print(book.__dict__)
print(book.title)

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

sol239_serialization-0.2.1.tar.gz (14.6 kB view details)

Uploaded Source

Built Distribution

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

sol239_serialization-0.2.1-py3-none-any.whl (15.1 kB view details)

Uploaded Python 3

File details

Details for the file sol239_serialization-0.2.1.tar.gz.

File metadata

  • Download URL: sol239_serialization-0.2.1.tar.gz
  • Upload date:
  • Size: 14.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.12.6

File hashes

Hashes for sol239_serialization-0.2.1.tar.gz
Algorithm Hash digest
SHA256 f7fdea529a13c47f4a61b340a6bd4160b599c44c27e2869ea86378f19f8be9a1
MD5 e6626d380b97f3e6ac664f547cab4b33
BLAKE2b-256 9db9dda23ec030f251cbe164277ea4f1b6561a3b404057825b50d9d8f5adb66c

See more details on using hashes here.

File details

Details for the file sol239_serialization-0.2.1-py3-none-any.whl.

File metadata

File hashes

Hashes for sol239_serialization-0.2.1-py3-none-any.whl
Algorithm Hash digest
SHA256 eaf7d55a37ce8137cb344ff2053c2075bd6d980a4f95da3151cd6d2068bb018d
MD5 b2aef654523a8f2d558db2c2c07dcb75
BLAKE2b-256 a5fc715c4d754e9b32d353f64a098a413d5aa1fa0b0eaff1092160a034343539

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