Pbox is a simple module that makes it easier to handle persistent data using pickle or json.


Keywords
pickle, persistent, data, cPickle, json
License
Other
Install
pip install pbox==2.6.0

Documentation

 pbox:
    This module adds a layer to simplify the use of persistent data with pickle.
    
    Usage:
    import pbox module and type:
        
        box = CreateBox() - To create a new box instance.
        
        box.dump(<objs_as_strings>) - To save objects.
        
        box.pick(<item_as_strings>) - To retrieve an object. One at a time.
        
        box.data_folder = <string> - To define a different folder to save the data file. ( Default is '.dat' )
        
        box.data_file = <string> - To define a different data file name. ( Default is 'datafile.pkl' )

        box.protocol = <int> - To define a new protocol for pickle. ( Default is pickle.HIGHEST_PROTOCOL )

        box.data_pack = <dict> - To manually define a dictionary with objects and 
        references to save at the datafile.
        
        box.remove_data - To remove the data folder and file from the computer.