Aims to simplify and help with commonly used functions in the aws cloud data areas.
Project description
Binary Rain Helper Toolkit: AWS Cloud
binaryrain_helper_cloud_aws is a python package that aims to simplify and help with common functions in AWS Cloud areas. It builds on top of the boto3 and aws-lambda-powertools libraries and provides additional functionality to make working with AWS Cloud easier, reduces boilerplate code and provides clear error messages.
Key Functions
-
get_secret_data(): retrieves secrets from AWS Secrets Manager:from binaryrain_helper_cloud_aws.aws import get_secret_data # Get a secret from AWS Secrets Manager secret = get_secret_data("my-secret") # Access secret values database_password = secret["password"]
-
get_app_config(): simplifies working with AWS AppConfig:from binaryrain_helper_cloud_aws.aws import get_app_config # Load configuration from AWS AppConfig config = get_app_config( AppConfig_environment="Production", AppConfig_application="MyApp", AppConfig_profile="DefaultConfig" ) # Access configuration values api_endpoint = config["api_endpoint"]
-
load_file_from_s3(): provides a simple way to read data from S3:from binaryrain_helper_cloud_aws.aws import load_file_from_s3 # Load a file from S3 file_bytes = load_file_from_s3( filename="data.csv", s3_bucket="my-bucket" ) # Use the file content print(f"File size: {len(file_bytes)} bytes")
-
save_file_to_s3(): handles uploading files to S3 with optional encryption:from binaryrain_helper_cloud_aws.aws import save_file_to_s3 # Save a file to S3 save_file_to_s3( filename="output.json", s3_bucket="my-bucket", file_contents=json_bytes ) # Save with server-side encryption save_file_to_s3( filename="sensitive-data.csv", s3_bucket="my-secure-bucket", file_contents=csv_bytes, server_side_encryption="aws:kms", sse_kms_key_id="arn:aws:kms:region:account:key/key-id" )
-
get_s3_presigned_url_readonly(): generates presigned URLs for time-limited S3 object access:from binaryrain_helper_cloud_aws.aws import get_s3_presigned_url_readonly # Generate a presigned URL valid for 2 minutes url = get_s3_presigned_url_readonly( filename="report.pdf", s3_bucket="my-bucket" ) # Generate a presigned URL valid for 1 hour long_url = get_s3_presigned_url_readonly( filename="large-dataset.parquet", s3_bucket="my-bucket", expires_in=3600 )
Benefits
- Consistent error handling with clear messages
- Input validation for all function parameters
- Simplified authentication and access to AWS services
- Secure handling of secrets and sensitive information
- Type hints for better IDE support
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 binaryrain_helper_cloud_aws-0.0.5.tar.gz.
File metadata
- Download URL: binaryrain_helper_cloud_aws-0.0.5.tar.gz
- Upload date:
- Size: 4.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.6.17
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
92b8e37bf4f1cfdcfc625cfb21d4fa5b7a508c5637267b08cd507dcfe35a3651
|
|
| MD5 |
144397ec210b178401be73b658577b0d
|
|
| BLAKE2b-256 |
35ed0414f775de7ab84db3e6f0bd5f145b93d107061148de911b16c163232c1e
|
File details
Details for the file binaryrain_helper_cloud_aws-0.0.5-py3-none-any.whl.
File metadata
- Download URL: binaryrain_helper_cloud_aws-0.0.5-py3-none-any.whl
- Upload date:
- Size: 5.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.6.17
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
3f21dd09eac454f91f03f110437b1d86dbb53e16da7fcfe6d623b47279a6340c
|
|
| MD5 |
92986e2b1a72ad3c678ab7db26b84b78
|
|
| BLAKE2b-256 |
18425f323823b24b27786775e95acff7cb05c52316745c9e50e721619e7005ab
|