Upload

Upload#

Upload files to bucket.

iter_files(input_dir: Path, exclude: list[str] | None = None) Iterator[Path][source]#

Return an iterator of Path

upload(input_dir: str | PathLike, exclude: list[str] | None = None, prescient_client: PrescientClient | None = None, overwrite: bool = True) None[source]#

Upload files from input directory to the location defined by PRESCIENT_UPLOAD_BUCKET

Parameters:
  • input_dir (str | os.PathLike) – Input directory containing file(s) to be uploaded. By default will upload all files contained in input directory.

  • exclude (Optional[list[str]]) – A list of glob patterns to exclude from uploading. For example `exclude=[”.txt”, “.csv”] would skip any matched files that end with a .txt or .csv suffix. If not provided by default all files will be uploaded.

  • prescient_client (Optional[PrescientClient]) – A PrescientClient instance. If not provided a default PrescientClient instance will be created.

  • overwrite (bool) – Whether to overwrite objects if they already exist. If False, upload is skipped. Useful for continuing an upload that was started previously. Defaults to True.