API Reference
get_mutable_prefixes

def get_mutable_prefixes() -> Iterator[PrefixMetaData]

Returns a list of all currently open prefixes that can be modified (i.e., are opened in read-write mode).

This function is useful for inspecting the state of your dbzero workspace to see which prefrixes are available for writing data. It filters out any prefixes that have been opened in read-only ("r") mode.

Returns

An iterator over metadata objects for each prefix opened in read-write ("rw") mode. Each object has a .name attribute holding the string identifier of the prefix and an .uuid.


Example

Listing all mutable prefixes

When multiple prefixes are open with default (read-write) access, the function returns all of them.

db0.init(path="/path/to/my/data")
# No open prefixes at the start
print([p.name for p in db0.get_mutable_prefixes()])
# Output: []
 
# Open some prefixes
db0.open("prefix1")
db0.open("prefix2", "r")
db0.open("prefix3")
 
# The list will now include all prefixes open in "rw" mode
print([p.name for p in db0.get_mutable_prefixes()])
# Output: ["prefix1", "prefix3"]