scottwernervt / cloudstorage

Unified cloud storage API for storage services.
http://cloudstorage.readthedocs.io/en/latest/
MIT License
93 stars 27 forks source link

How to look through directories recursively in Minio Driver #50

Open Dimpison opened 5 years ago

Dimpison commented 5 years ago

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)
scottwernervt commented 5 years ago

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?

Dimpison commented 5 years ago

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 commented 5 years ago

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

scottwernervt commented 5 years ago

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