Skip to main content

Save stuff quick and easy in Python

Project description

ezsaver

Lightweight tool to simplify saving/loading stuff in Jupyter notebooks.

Installation

Install with pip

pip install ezsaver

Usage

Import ezsaver as ez, and use ez.save() to save data. It will save objects of any complexity like tensorflow models, multidimensional numpy arrays, etc. Just feed it your filepath and the names of all the variables you want to save as arguments:

import ezsaver as ez

data1 = 2
data2 = np.random.random(size=(2, 4))
ez.save(filepath, data1, data2)

To load the data later, use ez.load(), giving it the filepath as an argument. It returns a dict, where the keys are the names of the original variables. If you forget what you named a variable, just view loaded_data.keys() to see them all.:

loaded_data = ez.load(filepath)

# keys are same name as original variables
data1 = saved_data['data1']
data2 = saved_data['data2']

If you have a feature request or problem, please open an issue. Note because of complexities of Python, ezsave does not work if you are coding directly from the command line .

Acknowledgments

  • Powered by the joblib and varname libraries.
  • Thanks to pwwang (developer of varname) for help debugging the earliest iteration.
  • Developed with support from NIH Bioinformatics and NIEHS Neurobehavioral Core.

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

ezsaver-0.1.0.tar.gz (3.9 kB view hashes)

Uploaded Source

Built Distribution

ezsaver-0.1.0-py3-none-any.whl (4.3 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page