Python DBM Module for Windows?
Actually, after more googling around, I found this:
http://docs.python.org/library/anydbm.html#module-anydbm
I've tried this on windows and it seems to be working fine =)
Based on the following test on a Windows 7 system using Python 2.7.2 it appears that dbhash is supported on Windows instalations.
import os
import anydbm
import whichdb
file = os.curdir + '/testdbm' # define a test file name in the current directory
d = anydbm.open(file, 'c') # create a new database using the test file name
db_type = whichdb.whichdb(file) # get the dbm database type
print(db_type) # display the result
'dbhash'
If Python 3 is of relevance, I'd go for an external k-v solution, as dumbdbm is no joy.
Some pure Python options:
semidbm - A faster alternative to dumbdbm, Python standard library only, pip and go. The one I'd go for if I want to ensure portability and availability to users.
PickleDB - Uses json to serialize data. Standrad library only, I haven't benchmarked but I suspect it's slower than semidbm because of the serialization overhead.
Petite DB - My own simple workaround using Python's zipfile module. Basic testing in the books but it's not production ready.
There are also Python wrappers to LMDB, UnQLite and SQLite4 LSM, all of which support Windows, though the SQLite4 bindings weren't tested.
The latter two are by Charles Leifer, who is both savvy with k-v stores and an avid Python developer (see Peewee).
As far as LMDB, I've tried it for a while. No complaints, but it uses a transactional model, where you can't use it dictionary-style like with other dbm's, unless you subclass/compose/submit a pull request etc. Also, it explicitly doesn't utilize compression (see also) which was something I was interested in.
So LMDB just didn't quite fit my specific needs. It does seem to be highly capable, the bindings worked fine, and installing them was untroublesome (pip worked for me, had no need to install LMDB seperately or any nuisance to that effect).