s3

anemoi.utils.s3.s3_client(*args: Any, **kwargs: Any) Any

Create an S3 client.

Parameters:
  • *args (Any) – Positional arguments for the S3 client.

  • **kwargs (Any) – Keyword arguments for the S3 client.

Returns:

The S3 client.

Return type:

Any

anemoi.utils.s3.upload(source: str, target: str, *, overwrite: bool = False, resume: bool = False, verbosity: int = 1, progress: Callable | None = None, threads: int = 1) None

Upload a file to S3.

Parameters:
  • source (str) – The source file path.

  • target (str) – The target S3 path.

  • overwrite (bool, optional) – Whether to overwrite the target file, by default False.

  • resume (bool, optional) – Whether to resume a previous upload, by default False.

  • verbosity (int, optional) – The verbosity level, by default 1.

  • progress (Callable, optional) – A callback function for progress updates, by default None.

  • threads (int, optional) – The number of threads to use, by default 1.

anemoi.utils.s3.download(*args: Any, **kwargs: Any) Any

Download a file from S3.

Parameters:
  • *args (Any) – Positional arguments for the download.

  • **kwargs (Any) – Keyword arguments for the download.

Returns:

The result of the download.

Return type:

Any

anemoi.utils.s3.delete(*args: Any, **kwargs: Any) Any

Delete a file from S3.

Parameters:
  • *args (Any) – Positional arguments for the delete.

  • **kwargs (Any) – Keyword arguments for the delete.

Returns:

The result of the delete.

Return type:

Any