in-memory database in Python

SQLite3 might work. The Python interface does support the in-memory implementation that the SQLite3 C API offers.

From the spec:

You can also supply the special name :memory: to create a database in RAM.

It's also relatively cheap with transactions, depending on what you are doing. To get going, just:

import sqlite3
conn = sqlite3.connect(':memory:')

You can then proceed like you were using a regular database.

Depending on your data - if you can get by with key/value (strings, hashes, lists, sets, sorted sets, etc) - Redis might be another option to explore (as you mentioned that you wanted to share with other programs).


I guess, SQLite3 will be the best option then.

If possible, take a look at memcached. (for key-value pair, lighting fast!)

UPDATE 1:

HSQLDB for SQL Like tables. (no python support)


It may not seem obvious, but pandas has a lot of relational capabilities. See comparison with SQL