JCDS2 Client

class JCDS2(classic_api_client: ClassicApi, pro_api_client: ProApi, concurrent_requests_method: Callable[..., Iterator])

Provides an interface to manage files in JCDS2.

Parameters:
  • classic_api_client (ClassicApi)

  • pro_api_client (ProApi)

  • concurrent_requests_method (Callable[..., Iterator])

upload_file(file_path: str | Path) None

Upload a file to the JCDS and create the package object.

If the file is less than 1 GiB in size the upload will be performed in a single request. If the file is greater than 1 GiB in size a multipart upload operation will be performed.

A JCDS2FileExistsError is raised if any file of the same name exists and is associated to a package.

Important

This operation requires the aws extra dependency.

Parameters:

file_path (Union[str, Path]) – The path to the file to upload. Will raise FileNotFoundError if the path to the file’s location does not exist.

Return type:

None

download_file(file_name: str, download_path: str | Path) None

Download a file from the JCDS by filename.

Parameters:
  • file_name (str) – The name of the file in the JCDS to download.

  • download_path (Union[str, Path]) – The path to download the file to. If the provided path is directory the file name will be appended to it. Will raise FileExistsError if the path is to a file location that already exists.

Return type:

None