Note that there are some explanatory texts on larger screens.

plurals
  1. POpython database / sql programming - where to start
    text
    copied!<p>What is the best way to use an embedded database, say sqlite in Python:</p> <ol> <li>Should be small footprint. I'm only needing few thousands records per table. And just a handful of tables per database.</li> <li>If it's one provided by Python default installation, then great. Must be open-source, available on Windows and Linus. </li> <li>Better if SQL is not written directly, but no ORM is fully needed. Something that will shield me from the actual database, but not that huge of a library. Something similar to ADO will be great.</li> <li>Mostly will be used through code, but if there is a GUI front end, then that is great</li> <li>Need just a few pages to get started with. I don't want to go through pages reading what a table is and how a Select statement works. I know all of that.</li> <li>Support for Python 3 is preferred, but 2.x is okay too.</li> </ol> <p><em>The usage is not a web app. It's a small database to hold at most 5 tables. The data in each table is just a few string columns. Think something just larger than a pickled dictionary</em></p> <p><strong>Update</strong>: Many thanks for the great suggestions.<br> The use-case I'm talking about is fairly simple. One you'd probably do in a day or two.<br> It's a 100ish line Python script that gathers data about a relatively large number of files (say 10k), and creates metadata files about them, and then one large metadata file about the whole files tree. I just need to avoid re-processing the files already processed, and create the metadata for the updated files, and update the main metadata file. In a way, cache the processed data, and only update it on file updates. If the cache is corrupt / unavailable, then simply process the whole tree. It might take 20 minutes, but that's okay.</p> <p>Note that all processing is done in-memory.</p> <p>I would like to avoid any external dependencies, so that the script can easily be put on any system with just a Python installation on it. Being Windows, it is sometimes hard to get all the components installed. So, In my opinion, even a database might be an overkill. </p> <p>You probably wouldn't fire up an Office Word/Writer to write a small post it type note, similarly I am reluctant on using something like Django for this use-case.</p> <p>Where to start?</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload