Skip to content

andrewrgarcia/rlish

Repository files navigation

License Documentation Status

Saving and loading information in Python should be shorter and easier.

rlish is a Python package for simple and efficient data serialization and deserialization. It supports both pickle and joblib serialization methods, making it suitable for a wide range of data types, including large NumPy arrays and machine learning models.

simplescreenrecorder-2024-06-23_11.09.05.mp4

Installation

You can install rlish using pip:

pip install rlish

Usage

Saving Data

To save data, use the save function. You can choose between pickle and joblib formats:

import rlish

dictionary = {'a': 1, 'b': 2, 'c': 3}
tensor = np.random.randint(0,10,(200,200,200))


# Save dictionary using pickle
rlish.save(dictionary, 'my_dictio')

# Save data using joblib
rlish.save(tensor, 'huge_tensor', format='joblib')

Loading Data

To load data, use the load function:

# Load data saved with pickle
loaded_data_pickle = rlish.load('my_dictio')

# Load data saved with joblib
loaded_data_joblib = rlish.load('huge_tensor')

# Load your data with the format printed out (if you forgot)
loaded_data_joblib = rlish.load('huge_tensor', what_is=True)

Contributing

Contributions to rlish are welcome! Feel free to open an issue or submit a pull request.