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 when download

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.2.tar.gz (14.7 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.2-py3-none-any.whl (15.1 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: sol239_serialization-0.2.2.tar.gz
  • Upload date:
  • Size: 14.7 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.2.tar.gz
Algorithm Hash digest
SHA256 3a9bad90a9532b19f5d82afb2fbd5680e3ed0ade0347581a6ac15e093813f2a9
MD5 b9d88395c6a09d8bf461b2a4f1c2509c
BLAKE2b-256 c6ec2adb95d9f0ab14aae5fd40d4436398927709e9c387416fbb0a7c3a07eabe

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for sol239_serialization-0.2.2-py3-none-any.whl
Algorithm Hash digest
SHA256 1f0e5549720303a4c0b441eaf7deb42ecec964adab2c24c92ed2d4269113bcd5
MD5 52397f1961b9aabb60856732b15e529c
BLAKE2b-256 10a5f29f73b182665164b4cfb91bc70a4ec99d8738d1f758c68e08523ccf2801

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