Reference
            async_s3
    S3 Bucket helper utils. Async list objects by folders
The file is mandatory for build system to find the package.
Classes
            async_s3.S3BucketObjects
    Attributes
            async_s3.S3BucketObjects.semaphore
  
      instance-attribute
  
semaphore = Semaphore(parallelism)
Functions
            async_s3.S3BucketObjects.iter
  
      async
  
iter(prefix: str = '/', *, max_level: Optional[int] = None, max_folders: Optional[int] = None, delimiter: str = '/') -> AsyncIterator[list[dict[str, Any]]]
Generator that yields objects in the bucket with the given prefix.
Yield objects by partial chunks (list of AWS S3 object dicts) as they are collected from AWS asynchronously.
max_level: The maximum folders depth to traverse in separate requests. If None, traverse all levels. max_folders: The maximum number of folders to load in separate requests. If None, requests all folders. Otherwise, the folders are grouped by prefixes before loading in separate requests. Try to group in the given number of folders if possible. delimiter: The delimiter for "folders".
            async_s3.S3BucketObjects.list
  
      async
  
list(prefix: str = '/', *, max_level: Optional[int] = None, max_folders: Optional[int] = None, delimiter: str = '/') -> list[dict[str, Any]]
List all objects in the bucket with the given prefix.
max_level: The maximum folders depth to traverse in separate requests.
If None, traverse all levels.
max_folders: The maximum number of folders to load in separate requests.
If None, requests all folders.
Otherwise, the folders are grouped by prefixes before loading in separate requests.
Try to group to the given max_folders if possible.
delimiter: The delimiter for "folders".
Modules
            async_s3.group_by_prefix
    Functions
            async_s3.group_by_prefix.find_longest_common_prefix
find_longest_common_prefix(words: list[str]) -> str
Finds the longest common prefix among a list of words.
            async_s3.group_by_prefix.group_by_prefix
group_by_prefix(words: list[str], desired_group_count: int) -> list[str]
Groups words by prefixes to create a desired number of word groups.
Try to create the desired number of groups if possible.
            async_s3.main
    async-s3.
Attributes
            async_s3.main.PROGRESS_REFRESH_INTERVAL
  
      module-attribute
  
PROGRESS_REFRESH_INTERVAL = 0.5
            async_s3.main.S3PROTO
  
      module-attribute
  
S3PROTO = 's3://'
Classes
            async_s3.main.ListingConfig
  
      dataclass
  
    Configuration for S3 object listing operations.
            async_s3.main.ListingConfig.bucket
  
      property
  
bucket: str
Extract bucket name from S3 URL.
            async_s3.main.ListingConfig.delimiter
  
      class-attribute
      instance-attribute
  
delimiter: str = '/'
            async_s3.main.ListingConfig.key
  
      property
  
key: str
Extract key/prefix from S3 URL.
            async_s3.main.ListingConfig.max_folders
  
      class-attribute
      instance-attribute
  
max_folders: Optional[int] = None
            async_s3.main.ListingConfig.max_level
  
      class-attribute
      instance-attribute
  
max_level: Optional[int] = None
            async_s3.main.ListingConfig.parallelism
  
      class-attribute
      instance-attribute
  
parallelism: int = 100
            async_s3.main.ListingConfig.repeat
  
      class-attribute
      instance-attribute
  
repeat: int = 1
            async_s3.main.ListingConfig.s3_url
  
      instance-attribute
  
s3_url: str
            async_s3.main.S3ListCommand
    Base class for S3 listing commands.
            async_s3.main.S3ListCommand.config
  
      instance-attribute
  
config = ListingConfig(s3_url=s3_url, max_level=max_level, max_folders=max_folders, repeat=repeat, parallelism=parallelism, delimiter=delimiter)
            async_s3.main.S3ListCommand.validate_and_execute
validate_and_execute() -> Iterable[dict[str, Any]]
Validate S3 URL and execute listing.
Functions
            async_s3.main.as3
as3() -> None
Async S3.
            async_s3.main.du
du(s3_url: str, max_level: Optional[int], max_folders: Optional[int], repeat: int, parallelism: int, delimiter: str) -> None
Show count and size for objects in an S3 bucket.
Example: as3 du s3://bucket/key
            async_s3.main.error
error(message: str) -> None
Print an error message and exit.
            async_s3.main.human_readable_size
human_readable_size(size: float, decimal_places: int = 2) -> str
Convert bytes to a human-readable format.
            async_s3.main.list_objects
list_objects(config: ListingConfig) -> Iterable[dict[str, Any]]
List objects in an S3 bucket.
            async_s3.main.list_objects_async
  
      async
  
list_objects_async(config: ListingConfig) -> Iterable[dict[str, Any]]
List objects in an S3 bucket.
            async_s3.main.list_objects_options
list_objects_options(func: Callable[[Any], None]) -> Callable[[Any], None]
Add common options to commands using list_objects.
            async_s3.main.list_objects_with_progress
  
      async
  
list_objects_with_progress(s3_list: S3BucketObjects, config: ListingConfig) -> tuple[Iterable[dict[str, Any]], float]
List objects in an S3 bucket with a progress bar.
Returns: (The objects, the elapsed time)
            async_s3.main.ls
ls(s3_url: str, max_level: Optional[int], max_folders: Optional[int], repeat: int, parallelism: int, delimiter: str) -> None
List objects in an S3 bucket.
Example: as3 ls s3://bucket/key
            async_s3.main.print_attempt_info
print_attempt_info(attempt: int, duration: float) -> None
Print the elapsed time for an attempt.
            async_s3.main.print_average_time
print_average_time(total_time: float, repeat: int) -> None
Print the average elapsed time.
            async_s3.main.print_start_info
print_start_info(config: ListingConfig) -> None
Print the command parameters.
            async_s3.main.print_summary
print_summary(objects: Iterable[dict[str, Any]]) -> None
Print a summary of the objects.
            async_s3.main.split_s3_url
split_s3_url(s3_url: str) -> tuple[str, str]
Split an S3 URL into bucket and key.
            async_s3.main.validate_delimiter
validate_delimiter(ctx: Context, param: Parameter, value: str) -> str
Validate the Delimiter option.
            async_s3.s3_bucket_objects
    Attributes
            async_s3.s3_bucket_objects.DEFAULT_PARALLELISM
  
      module-attribute
  
DEFAULT_PARALLELISM = 100
Classes
            async_s3.s3_bucket_objects.S3BucketObjects
                async_s3.s3_bucket_objects.S3BucketObjects.semaphore
  
      instance-attribute
  
semaphore = Semaphore(parallelism)
            async_s3.s3_bucket_objects.S3BucketObjects.iter
  
      async
  
iter(prefix: str = '/', *, max_level: Optional[int] = None, max_folders: Optional[int] = None, delimiter: str = '/') -> AsyncIterator[list[dict[str, Any]]]
Generator that yields objects in the bucket with the given prefix.
Yield objects by partial chunks (list of AWS S3 object dicts) as they are collected from AWS asynchronously.
max_level: The maximum folders depth to traverse in separate requests. If None, traverse all levels. max_folders: The maximum number of folders to load in separate requests. If None, requests all folders. Otherwise, the folders are grouped by prefixes before loading in separate requests. Try to group in the given number of folders if possible. delimiter: The delimiter for "folders".
            async_s3.s3_bucket_objects.S3BucketObjects.list
  
      async
  
list(prefix: str = '/', *, max_level: Optional[int] = None, max_folders: Optional[int] = None, delimiter: str = '/') -> list[dict[str, Any]]
List all objects in the bucket with the given prefix.
max_level: The maximum folders depth to traverse in separate requests.
If None, traverse all levels.
max_folders: The maximum number of folders to load in separate requests.
If None, requests all folders.
Otherwise, the folders are grouped by prefixes before loading in separate requests.
Try to group to the given max_folders if possible.
delimiter: The delimiter for "folders".
Functions
            async_s3.s3_bucket_objects.create_session
  
      cached
  
create_session() -> AioSession
Create a session object.
            async_s3.s3_bucket_objects.get_s3_client
get_s3_client() -> AioBaseClient
Get S3 client.