Skip to main content

A package for serializing and deserializing data

Project description

ClassSerialization

Python library for class JSON serialization.


Example usage

from 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.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-py3-none-any.whl (15.1 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: sol239_serialization-0.2.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.tar.gz
Algorithm Hash digest
SHA256 5492b401bc9d018e842b9496c3b558d81203171c2e7c902ceb9f134dc8afcb20
MD5 d5ef6897d51568e957180c69684aa416
BLAKE2b-256 2d42ec085729c6c16fda8de3ee2e8d92bb87e8b4c05781f1894c1820f59e3606

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for sol239_serialization-0.2-py3-none-any.whl
Algorithm Hash digest
SHA256 5ae04062c14d9bd3226dbb7c23241f25405ad1601de3ade6ece12026a4ab7ef9
MD5 97270dafcfc92c5b5892f68c351a44ab
BLAKE2b-256 3f41feb5283e18d5865b303a8b163f5ca38cbdee6c56fcc7929e4db2e2a79ca2

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