AmazonS3Storage
AWS_ACCESS_KEY_ID
and AWS_SECRET_ACCESS_KEY
. If none of these are
provided, it will try to use the local credentials (will be created if
logged in with AWS CLI).
Parameters:
- bucket_name (str): The name of the S3 bucket.
- create_if_not_exists (bool, optional): Whether to create the bucket if it does not exist. Defaults to True.
- access_key_id (Optional[str], optional): The AWS access key ID. Defaults to None.
- secret_access_key (Optional[str], optional): The AWS secret access key. Defaults to None.
- anonymous (bool, optional): Whether to use anonymous access. Defaults to False.
- References:
- https: //aws.amazon.com/pm/serv-s3/
- https: //aws.amazon.com/cli/
init
_prepare_and_check
canonicalize_path
- file_path (PurePath): The path to be canonicalized.
_put_file
- file_key (str): The path to the object in the bucket.
- file (File): The file to be uploaded.
_get_file
- file_key (str): The path to the object in the bucket.
- filename (str): The name of the file.
_upload_file
- local_file_path (Path): The path to the local file to be uploaded.
- remote_file_key (str): The path to the object in the bucket.
_download_file
- local_file_path (Path): The path to the local file to be saved.
- remote_file_key (str): The key of the object in the bucket.
_object_exists
- file_key: The key of the object in the bucket.