A collection of natural language-like utility functions to intuitively and easily control AWS's cloud object storage resource, S3.
Project description
AWS S3 Controller
A collection of natural language-like utility functions to intuitively and easily control AWS's cloud object storage resource, S3.
- Control S3. Manage, interact with, and handle S3 just like your local storage.
- *AWS: Amazon Web Services
*S3: Simple Storage Service in AWS
Features
- File Scanning: Search files in S3 buckets and local directories using regex patterns
- File Transfer: Upload, download, and relocate files between S3 buckets and local directories
- Data Processing: Read CSV and Excel files directly from S3 into pandas DataFrames
- Bucket Management: Create and manage S3 bucket structure
- Special Operations: Handle specific use cases like timeseries data processing
Installation
pip install -r requirements.txt
Module Structure
The module is organized into several specialized components:
s3_scanner.py: File search functionality in S3 buckets and local directoriess3_transfer.py: File transfer operations between S3 and local storages3_dataframe_reader.py: Functions for reading files into pandas DataFramess3_structure.py: S3 bucket structure managements3_special_operations.py: Special purpose functions for specific operations
Usage Examples
Scanning Files
from aws_s3_controller import scan_files_in_bucket_by_regex
# Find all CSV files in a bucket
files = scan_files_in_bucket_by_regex(
bucket="my-bucket",
bucket_prefix="data",
regex=r".*\.csv$",
option="key"
)
Transferring Files
from aws_s3_controller import download_files_from_s3, upload_files_to_s3
# Download files matching a pattern
download_files_from_s3(
bucket="my-bucket",
regex=r".*\.csv$",
file_folder_local="./downloads",
bucket_prefix="data"
)
# Upload files to S3
upload_files_to_s3(
file_folder_local="./uploads",
regex=r".*\.xlsx$",
bucket="my-bucket",
bucket_prefix="excel-files"
)
Reading Data
from aws_s3_controller import open_df_in_bucket, open_excel_in_bucket
# Read CSV file
df = open_df_in_bucket(
bucket="my-bucket",
bucket_prefix="data",
file_name="example.csv"
)
# Read Excel file
df = open_excel_in_bucket(
bucket="my-bucket",
bucket_prefix="excel",
file_name="example.xlsx"
)
Dependencies
- boto3
- pandas
- python-dotenv
- xlrd (for Excel file support)
- shining_pebbles
Configuration
- Create a
.envfile in your project root - Add your AWS credentials:
AWS_ACCESS_KEY_ID=your_access_key
AWS_SECRET_ACCESS_KEY=your_secret_key
AWS_DEFAULT_REGION=your_region
Contributing
- Fork the repository
- Create your feature branch
- Commit your changes with descriptive commit messages
- Push to your branch
- Create a Pull Request
Author
June Young Park
AI Management Development Team Lead & Quant Strategist at LIFE Asset Management
LIFE Asset Management is a hedge fund management firm that integrates value investing and engagement strategies with quantitative approaches and financial technology, headquartered in Seoul, South Korea.
Contact
- Email: juneyoungpaak@gmail.com
- Location: TWO IFC, Yeouido, Seoul
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 aws_s3_controller-0.7.5.tar.gz.
File metadata
- Download URL: aws_s3_controller-0.7.5.tar.gz
- Upload date:
- Size: 9.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.11.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
d5b797c50e919569fb5e37c03310d68c7457c526edec19728e7328518274e8ca
|
|
| MD5 |
e2e2f7decf958ea8e1feefdfb112b111
|
|
| BLAKE2b-256 |
1fbe5b7560aa624854d9876b15c448c5e27b763941927bf237c7197b5da8b2ab
|
File details
Details for the file aws_s3_controller-0.7.5-py3-none-any.whl.
File metadata
- Download URL: aws_s3_controller-0.7.5-py3-none-any.whl
- Upload date:
- Size: 10.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.11.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
dc977d57a94f8f3fbbafbb134f09c9ce63e6d3b2c26e702d4e6d69189a23b7fc
|
|
| MD5 |
924316a16f964d0b5eba6ac5d1ab1b7c
|
|
| BLAKE2b-256 |
6f4ca4a26dc6d350b5da17850056d4383d4368dc67082dc8c19eebc53135aeca
|