Skip to main content

S3 wrapper built on top of boto3.

Project description

ezS3

This library provides abstractions over boto3 to easily deal with S3 buckets.

Usage

from ezs3 import S3

# be sure to have set AWS_ACCESS_KEY_ID and
# AWS_SECRET_ACCESS_KEY env variables.
s3 = S3(bucket_name="some_bucket")

# or load credentials from file.
s3 = S3.from_credentials(bucket_name="some_bucket")

# upload everything in `./data` to `bucket_name://data/input`, imitating the
# directory structure. the directory `data` itself is not copied.
# these are equivalent:
#   s3.upload("./data", "data/input")
#   s3.upload("./data/", "data/input/")
s3.upload("./data/", "data/input")
# upload `/tmp/my_file` to `bucket_name://data/my_file`.
s3.upload("/tmp/my_file", "data/")

# download everything under `bucket_name://data/input` into `./data2`,
# imitating the prefix structure.
s3.download("data/input", "./data2/")
# download `bucket_name://data/my_file` into `/tmp`.
s3.download("data/my_file", "/tmp/")
# same as above, but file is renamed to `my_file2`.
s3.download("data/my_file", "/tmp/my_file2")

# remove files.
s3.remove(*s3.list_keys("data/"))

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distribution

ezs3-0.2.1-py3-none-any.whl (16.0 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page