Skip to content

A simple python script that uploads a file to a s3 bucket.

Notifications You must be signed in to change notification settings

TimelyToga/upload_s3

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 

Repository files navigation

upload_s3

A simple python script that uploads a file to a s3 bucket under a randomly generated key, randomly generated key with a specified extension, or under a given key (optionally with an extension).

Place AWS access credentials in the following lines. Make sure to specify a valid bucket name.

  # AWS ACCESS DETAILS
  AWS_ACCESS_KEY_ID = '<AWS_ACCESS_KEY_ID>'
  AWS_SECRET_ACCESS_KEY = '<AWS_SECRET_ACCESS_KEY>'
  BUCKET = '<BUCKET_NAME>'

Usuage

upload_s3.py usage: python upload_s3.py <filename> [file_extension or file_key]

  •    `filename` is the path to the file to upload [REQUIRED]
    
  •    `file_extension` is a string that specifies any valid file extension (starts with a '.') {OPTIONAL}
    
  •    `file_key` is the key that the file will be stored in s3 under {OPTIONAL}
    

Requirements

The only third party dependency for this script is the boto library. To get boto use the following command:

pip install boto

Boto Documentation

About

A simple python script that uploads a file to a s3 bucket.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages