cloudstorage icon indicating copy to clipboard operation
cloudstorage copied to clipboard

How to look through directories recursively in Minio Driver

Open Dimpison opened this issue 4 years ago • 4 comments

Is there any way to go through directories (blobs) recursively in Minio Driver?

def get_blobs(self, container: Container) -> Iterable[Blob]:
        for obj in self.client.list_objects(container.name, recursive=False):
            yield self._make_obj(container, obj)

Dimpison avatar Aug 12 '19 12:08 Dimpison

You can traverse one level deep:

for container in storage:
    container.name
    # 'container-a', 'container-b', ...

    for blob in container:
        blob.name
        # 'blob-1', 'blob-2', ...

The library does not currently support nested containers/folders. Are you looking for an implementation of os.walk functionality?

scottwernervt avatar Aug 12 '19 16:08 scottwernervt

Yes. Just want to store several types of file in one bucket, but split them using folders. And apply retention policy to these files. Maybe you have some kind of workaround for this, do you?

Dimpison avatar Aug 13 '19 07:08 Dimpison

Are there any updates on this question? Is this gonna be developed in the next patch/version?

Dimpison avatar Aug 19 '19 14:08 Dimpison

It would be developed in the next version and depends on:

scottwernervt avatar Aug 19 '19 14:08 scottwernervt