Skip to main content

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


Download files

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

Source Distribution

binaryrain_helper_cloud_aws-0.0.4.tar.gz (4.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

binaryrain_helper_cloud_aws-0.0.4-py3-none-any.whl (5.4 kB view details)

Uploaded Python 3

File details

Details for the file binaryrain_helper_cloud_aws-0.0.4.tar.gz.

File metadata

File hashes

Hashes for binaryrain_helper_cloud_aws-0.0.4.tar.gz
Algorithm Hash digest
SHA256 f5dd3b4b8510e4631b4b8ea39db2361ef4ef6e8afdfaa0645ff88a2f26a151c6
MD5 a088201d798ea4ddd2d5d797c5e78d77
BLAKE2b-256 14c23636e7896ce986b895f5278827e513ba44c9ccfbb63a5a59a3f8f9c2391a

See more details on using hashes here.

File details

Details for the file binaryrain_helper_cloud_aws-0.0.4-py3-none-any.whl.

File metadata

File hashes

Hashes for binaryrain_helper_cloud_aws-0.0.4-py3-none-any.whl
Algorithm Hash digest
SHA256 99847f822c529d18aa422ff0e4f0548208e0826f8d5ca8d7f4ad61d7676b0534
MD5 4d1a4dee9c3968d157cba014d198090e
BLAKE2b-256 ccb5a6674b68a43b3b71bb3bd21e4020b0c7f5cb3b9d00df536c070eb0b24e1f

See more details on using hashes here.

Supported by

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