data_base ❭ data_base_register ❭ DataBaseRegister
DataBaseRegister¶
-
class data_base.data_base_register.DataBaseRegister(registry_basedir, search_dbs=
'on_first_init')¶ Two column registry mapping data bases to their locations.
This registry keeps track of all
DataBaseidtags and their locations on disk. This is useful when sharing data with other people, resolving relative database paths, and moving databases to other file systems. This registry implements an SQLite backend to store these locations and corresponding database IDs.You can explicitly walk through a directory and add all
DataBaseit encounters to the registry withDataBaseRegister.search_dbs().- Parameters:¶
registry_basedir (str) – The location of the db registry
search_dbs (str|bool, optional) – Whether to look for data_bases in all subfolders of the registry’s directory. Defaults to “on_first_init”, which only does this if the registry is newly created.
- Attributes:¶
- Methods:¶
search_dbs(directory)Look for
DataBasein all subfolders of the registry’s directory and add them to the registry.add_db(unique_id, db_basedir)Add a database to the registry.
keys()Get all keys in the registry.