문제

I'm developing a card catalog type application and Python and am trying to decide how to store the data. Not a web app. I don't expect a large app or a massive amount of data.

One alternative is a pickled dictionary. For example {id1: {author1, title1}, id2: {author2, title2}} (reality would be a bit more complex). This has the virtue of simplicity. I could search items by iterating over the entries.

Another alternative is an sqlite database. This seems more suited for the task, including persistence and good facilities for adding, editing, searching, with the main downside being that I'm not too familiar with sql databases. OTOH, this looks like a good opportunity to learn.

Would you use sqlite3 or something else? Any other considerations for making the choice?

Any suggestions for learning sqlite beyond those in these questions python database / sql programming - where to start and https://stackoverflow.com/questions/2855031/comprehensive-beginners-tutorial-for-python-and-sqlite

도움이 되었습니까?

해결책

Sqlite3 is a rock solid choice.

If you only need a key/value store, the shelve module offers and easy-to-use dictionary like API.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top