sqlite - Efficient persistent storage for lists in Python -


i have (key, value) map each key have large list of heterogeneous lists (~max 250 items). each list mix of strings , numbers might want iterate over. key string. if wanted store such list thousands of such (key, value) pairs persistently efficient retrieval best options? if use sqlite need create table each key , map lists individual records in database. there better , efficient options if goal fast retrieval of list of lists particular key? here short example. animals map of keys list of lists. sample data looks this:

 animals = {      "lion" : [["siberian", 203, "tanzania", 123.56], ["russian", 321, "timbktu", 23423.2]],     "tiger: [["white", 121, "australia", 1211.1], ["indian", 111, "india", 1241.5]]   } 

so want able persist data structure , able index name of animal (always unique) , list of lists particular animal care about. if lists within each animal's info of fixed length , fixed fields, can exploit feature somehow improve efficiency?

as blender states in comment, pickle reasonable choice. make sure not use original version, though, , instead use c-based cpickle. alternatively, consider dill.


Comments

Popular posts from this blog

c# - Validate object ID from GET to POST -

node.js - Custom Model Validator SailsJS -

php - Find a regex to take part of Email -