File Uploader Options#

pydantic model onetl.file.file_uploader.options.FileUploaderOptions#

File uploading options

field if_exists: FileExistBehavior = FileExistBehavior.ERROR (alias 'mode')#

How to handle existing files in the target directory.

Possible values:
  • error (default) - do nothing, mark file as failed

  • ignore - do nothing, mark file as ignored

  • replace_file - replace existing file with a new one

  • replace_entire_directory - delete local directory content before downloading files

field delete_local: bool = False#

If True, remove local file after successful download.

If download failed, file will left intact.

field workers: int = 1#

Number of workers to create for parallel file upload.

1 (default) means files will me uploaded sequentially. 2 or more means files will be uploaded in parallel workers.

Recommended value is min(32, os.cpu_count() + 4), e.g. 5.