Simple library to list and download files from Amazon S3.
Project description
s3-file-downloader
A simple Python library to list and download files from Amazon S3.
Supports both public (unsigned) and private (AWS credentials) buckets.
Features
- List objects in an S3 bucket under a prefix
- Download:
- One file
- Many files
- All files under a prefix
- Safe local filenames (handles weird S3 keys)
- Works with public access or with your AWS credentials
Installation
From PyPI (after publishing):
pip install s3-file-downloader
For development (local install):
git clone https://github.com/<your-username>/s3-file-downloader.git
cd s3-file-downloader
pip install -e .
Usage Example
from s3_file_downloader import make_s3_client, S3Downloader
# Public access (no AWS credentials needed)
s3 = make_s3_client(region="us-east-1", unsigned=True)
dl = S3Downloader(s3)
bucket = "aws-bigdata-blog"
prefix = "artifacts/flink-refarch/data/nyc-tlc-trips.snz/"
# 1) List objects
keys = dl.list_objects(bucket=bucket, prefix=prefix, limit=5)
print("Found keys:", keys)
# 2) Download one file
if keys:
dl.download_one(bucket, keys[0], "./downloads_one")
# 3) Download many files
dl.download_many(bucket, keys, "./downloads_many")
# 4) Download all files under prefix
dl.download_all_by_prefix(bucket, prefix, "./downloads_all", limit=None)
Requirements
-
Python 3.8+
-
boto3 (
pip install boto3) -
AWS credentials if accessing private buckets
-
Run
aws configureor set environment variables:AWS_ACCESS_KEY_IDAWS_SECRET_ACCESS_KEYAWS_SESSION_TOKEN(if required)
-
Authors
- Your Name (@Divya-Idupulapati)
- Friend’s Name (@PavanMarella10)
License
MIT License — free to use, copy, modify, and share.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file s3_file_downloader-0.1.0.tar.gz.
File metadata
- Download URL: s3_file_downloader-0.1.0.tar.gz
- Upload date:
- Size: 3.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
57e01abdae8863fda5fe131b68d2136abbc7c611933ccefafa39d951559dee13
|
|
| MD5 |
97c284ac6bcc689b47ead2a42a871987
|
|
| BLAKE2b-256 |
a04ed305a7622fb45484772d1e3644a1be00fcb42e4a6cf194c75abd522b1159
|
File details
Details for the file s3_file_downloader-0.1.0-py3-none-any.whl.
File metadata
- Download URL: s3_file_downloader-0.1.0-py3-none-any.whl
- Upload date:
- Size: 4.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
78e113a980b11cbb9cc3fab61c9b2b4c2e97bb2187d10b025f5dfb4f70b3002d
|
|
| MD5 |
9abca8cb2c6a5b938efa2f4245b0a9f9
|
|
| BLAKE2b-256 |
20aa64a1a457f55fb5e3b598e342916b1053fec31709677e01e6e0c0bf9edf3c
|