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)
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
5492b401bc9d018e842b9496c3b558d81203171c2e7c902ceb9f134dc8afcb20
|
|
| MD5 |
d5ef6897d51568e957180c69684aa416
|
|
| BLAKE2b-256 |
2d42ec085729c6c16fda8de3ee2e8d92bb87e8b4c05781f1894c1820f59e3606
|
File details
Details for the file sol239_serialization-0.2-py3-none-any.whl.
File metadata
- Download URL: sol239_serialization-0.2-py3-none-any.whl
- Upload date:
- Size: 15.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.12.6
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
5ae04062c14d9bd3226dbb7c23241f25405ad1601de3ade6ece12026a4ab7ef9
|
|
| MD5 |
97270dafcfc92c5b5892f68c351a44ab
|
|
| BLAKE2b-256 |
3f41feb5283e18d5865b303a8b163f5ca38cbdee6c56fcc7929e4db2e2a79ca2
|