Shelve is a terrible module (both slow and insecure), and you should never use it.
If you're looking for an easy-to-use in-memory (or file-backed) database that's part of the Python standard library, take a look at the sqlite3
module: http://docs.python.org/2/library/sqlite3.html
It's rock solid, powerful (it's a full-fledged SQL database), well-documented and remarkably fast.
EDIT: Also, as @roippi said, to actually read your files, you'll need to use the csv
module: http://docs.python.org/2/library/csv.html