dbopen¶
-
class data_base.dbopen.dbopen(path, mode=
'r'
)¶ Context manager to open files in databases
This explicitly calls Python’s
open()
method on a file. This is generally not recommended, as the content of databases is usually written in a specific format, that is automatically inferred by the database.However, for development and testing purposes, it may be of use to explicitly open these files.
Example
>>> with dbopen('db://my_db/my_key') as f: ... print(f.read()) # dumps the raw file content - not recommended for e.g. binary formats