Skip to main content

A package for serializing and deserializing data

Project description

ClassSerialization

Python library for class JSON serialization.


Installation

pip install sol239_serialization
pip install git+https://github.com/sol239/ClassSerialization

Example

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)

View at:

https://pypi.org/project/sol239-serialization/0.2.2/


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.3.tar.gz (14.8 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.3-py3-none-any.whl (15.2 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: sol239_serialization-0.2.3.tar.gz
  • Upload date:
  • Size: 14.8 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.3.tar.gz
Algorithm Hash digest
SHA256 49fbb754cb50e01c93d8fb84e796a4acbbc0fad11a2dfb5bf8f139612e1209a7
MD5 8aea5d52cc52b9365bc48cb70626dea6
BLAKE2b-256 c6269e72f335b86a1d4732687dccdae82383b99ce1ee5861fd8cea1e1906f18b

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for sol239_serialization-0.2.3-py3-none-any.whl
Algorithm Hash digest
SHA256 209d4e96894cad345a86da59074bfda8b1d92e1bf69cc1c6bb805ab50f4cec60
MD5 bbeeb8420697a204fd606ad0c9a35083
BLAKE2b-256 44bb827c5778ed74d1c0bd03ff41e731541b5ff059992b99baba2174ba85768a

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