Python module for convenient storage of classes in files.
Project description
FrozenClass
This library was created in order to be able to save classes with a single line, as well as load them!
Read the docs
Example
from frozenclass import DataController
# Test class
class Test:
test_var = 10
# Init controller class
data_controller = DataController('PATH_TO_SAVE`S FOLDER')
# Save class as file
save_name = data_controller.freeze_class(Test())
# Get all saves classes models
loaded_classes = data_controller.load_save(save_name) # -> Test object
# Get var value
print(test_var.test_var) # -> 10
Installation
$ pip install frozenclass
Installation from source
Dependencies:
- poetry
$ git clone https://github.com/GigantPro/frozenclass.git; cd frozenclass-main
$ poetry run build; cd dist
$ pip install $(ls -Art | tail -n 1)
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
frozenclass-0.1.3.tar.gz
(14.9 kB
view hashes)