Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to look through directories recursively in Minio Driver #50

Open
Dimpison opened this issue Aug 12, 2019 · 4 comments
Open

How to look through directories recursively in Minio Driver #50

Dimpison opened this issue Aug 12, 2019 · 4 comments

Comments

@Dimpison
Copy link

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
Copy link
Owner

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
Copy link
Author

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
Copy link
Author

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

@scottwernervt
Copy link
Owner

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants