List and filter namespaces in the store.
Used to explore the organization of data, find specific collections, or navigate the namespace hierarchy.
list_namespaces(
self,
*,
prefix: NamespacePath | None = None,
suffix: NamespacePath | None = None,
max_depth: int | None = None,
limit: int = 100,
offset: int = 0
) -> list[tuple[str, ...]]"Examples":
Setting max_depth=3. Given the namespaces:
# Example if you have the following namespaces:
# ("a", "b", "c")
# ("a", "b", "d", "e")
# ("a", "b", "d", "i")
# ("a", "b", "f")
# ("a", "c", "f")
store.list_namespaces(prefix=("a", "b"), max_depth=3)
# [("a", "b", "c"), ("a", "b", "d"), ("a", "b", "f")]| Name | Type | Description |
|---|---|---|
prefix | NamespacePath | None | Default: NoneFilter namespaces that start with this path. |
suffix | NamespacePath | None | Default: NoneFilter namespaces that end with this path. |
max_depth | int | None | Default: NoneReturn namespaces up to this depth in the hierarchy. Namespaces deeper than this level will be truncated. |
limit | int | Default: 100Maximum number of namespaces to return. |
offset | int | Default: 0Number of namespaces to skip for pagination. |