bsddb for simple database [very basic]

Skip Montanaro skip at pobox.com
Sun Aug 26 21:25:15 EDT 2001


    Artur> Ignacio Vazquez-Abrams wrote:
    >> On 26 Aug 2001, Artur Skura wrote:
    >>> etc, I will just have standard dictionary pairs, with strings.
    >>> I need records. How do I do that?
    >> 
    >> "Keys and values must be strings, however, so to use other objects as keys or
    >> to store other kinds of objects the user must serialize them somehow,
    >> typically using marshal.dumps or pickle.dumps."
    >> 
    >> You wanted very simple database functionality, you found it. Anything more
    >> complex is up to you.
 
    Artur> OK, I will use dumps/loads. I just thought there might be a more
    Artur> transparent way, maybe with another db module.

You might want to check out the shelve module.  The keys must still be
strings, but it transparently handles serialization of the values.

-- 
Skip Montanaro (skip at pobox.com)
http://www.mojam.com/
http://www.musi-cal.com/




More information about the Python-list mailing list