We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
ls
I needed a function that is similar to ls to just list paths at a given S3URI.
list_s3_paths is recursive and only lists files, not directories, for example, as ls would.
list_s3_paths
I implemented this function for aibs-informatics-AD-image-convert library:
aibs-informatics-AD-image-convert
def list_directories(s3_path: S3URI, **kwargs): s3_client = get_s3_client(**kwargs) paginator = s3_client.get_paginator("list_objects_v2") operation_parameters = { "Bucket": s3_path.bucket, "Delimiter": "/", "Prefix": s3_path.key, } page_iterator = paginator.paginate(**operation_parameters) directories = [] for page in page_iterator: if "CommonPrefixes" in page: for common_prefix in page["CommonPrefixes"]: directories.append(common_prefix["Prefix"]) return directories
If this is implemented, that function should be replaced with this new one.
The text was updated successfully, but these errors were encountered:
No branches or pull requests
Summary
I needed a function that is similar to
ls
to just list paths at a given S3URI.Justification
list_s3_paths
is recursive and only lists files, not directories, for example, asls
would.Solution
I implemented this function for
aibs-informatics-AD-image-convert
library:If this is implemented, that function should be replaced with this new one.
The text was updated successfully, but these errors were encountered: