title: Flat file NoSQL solution
body: <p>Is there a built-in way in SQLite (or similar) to keep the best of both worlds SQL / NoSQL, for small projects, i.e.:</p>
  
  <ul>
  <li>stored <strong>in a (flat) file</strong> like SQLite (no client/server scheme, no server to install; more precisely : nothing else to install except <code>pip install &lt;package&gt;</code>)</li>
  <li>possibility to store rows as <code>dict</code>, <em>without</em> having a common structure for each row, like NoSQL databases</li>
  <li>support of simple queries</li>
  </ul>
  
  <p>Example:</p>
  
  <pre><code>db = NoSQLite('test.db')
  db.addrow({'name': 'john doe', 'balance': 1000, 'data': [1, 73.23, 18]})
  db.addrow({'name': 'alice', 'balance': 2000, 'email': 'a@b.com'})
  for row in db.find('balance &gt; 1500'):
      print(row)
  
  # {'id': 'f565a9fd3a', 'name': 'alice', 'balance': 2000, 'email': 'a@b.com'}   # id was auto-generated
  </code></pre>
  
  <p>Note: I have constantly been amazed along the years by how many interesting features are in fact possible with SQLite in a few lines of code, that's why I'm asking if what I describe here could maybe be available simply with SQLite by using only a few SQLite core features.</p>
  
  <p>PS: <a href="https://docs.python.org/3/library/shelve.html" rel="noreferrer"><code>shelve</code></a> <em>could</em> look like a solution but in fact it's just a persistent key/value store, and it doesn't have query/<code>find</code> functions; also <a href="https://docs.python.org/2/library/bsddb.html" rel="noreferrer"><code>bsddb</code></a> (BerkeleyDB for Python) looks deprecated and has no query feature with a similar API.</p>