List¶
object_store_rs.list ¶
list(
store: ObjectStore,
prefix: str | None = None,
*,
offset: str | None = None,
max_items: int | None = 2000
) -> List[ObjectMeta]
List all the objects with the given prefix.
Prefixes are evaluated on a path segment basis, i.e. foo/bar/ is a prefix of
foo/bar/x but not of foo/bar_baz/x. List is recursive, i.e. foo/bar/more/x
will be included.
Note: the order of returned ObjectMeta is not
guaranteed
Note
In the future, we'd like to have list return an async iterable, just like
get, so that we can stream the result of list, but we need some
changes in the upstream
object-store repo first.
Parameters:
-
store(ObjectStore) –The ObjectStore instance to use.
-
prefix(str | None, default:None) –The prefix within ObjectStore to use for listing. Defaults to None.
Other Parameters:
-
offset(str | None) –If provided, list all the objects with the given prefix and a location greater than
offset. Defaults toNone. -
max_items(int | None) –The maximum number of items to return. Defaults to 2000.
Returns:
-
List[ObjectMeta]–A list of
ObjectMeta.
object_store_rs.list_async
async
¶
list_async(
store: ObjectStore,
prefix: str | None = None,
*,
offset: str | None = None,
max_items: int | None = 2000
) -> List[ObjectMeta]
Call list asynchronously.
Refer to the documentation for list.
object_store_rs.list_with_delimiter ¶
list_with_delimiter(
store: ObjectStore, prefix: str | None = None
) -> ListResult
List objects with the given prefix and an implementation specific delimiter. Returns common prefixes (directories) in addition to object metadata.
Prefixes are evaluated on a path segment basis, i.e. foo/bar/ is a prefix of
foo/bar/x but not of foo/bar_baz/x. List is not recursive, i.e. foo/bar/more/x
will not be included.
Parameters:
-
store(ObjectStore) –The ObjectStore instance to use.
-
prefix(str | None, default:None) –The prefix within ObjectStore to use for listing. Defaults to None.
Returns:
-
ListResult–ListResult
object_store_rs.list_with_delimiter_async
async
¶
list_with_delimiter_async(
store: ObjectStore, prefix: str | None = None
) -> ListResult
Call list_with_delimiter asynchronously.
Refer to the documentation for list_with_delimiter.