Using the shelve module as a database