PyDocs

Nav

Data Persistence

whichdb

dbm

function (source)
  • whichdb(filename)
Guess which db package to use to open a db file.

Return values:

- None if the database file can't be read;
- empty string if the file can be read but can't be recognized
- the name of the dbm submodule (e.g. "ndbm" or "gnu") if recognized.

Importing the given module may still fail, and opening the
database using that module may still fail.
Changed in 3.11
  • 3.11: filename accepts a path-like object.
0 Examples
No examples for dbm/whichdb.
See Also
No see-alsos for dbm/whichdb
0 Notes
No notes for whichdb