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.3.tar.gz (4.9 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.3-py3-none-any.whl (5.4 kB view details)

Uploaded Python 3

File details

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

File metadata

File hashes

Hashes for binaryrain_helper_cloud_aws-0.0.3.tar.gz
Algorithm Hash digest
SHA256 7f284b253189a49556522e43b8e0eedccfe44d731866aecd88506587fadecfb2
MD5 555cfb341a12da42388ee4b72ba4ade7
BLAKE2b-256 99bb5c7e4dc4a98a537472f517e2e7859bc1177b9cab2526d1251aa59aa5257a

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for binaryrain_helper_cloud_aws-0.0.3-py3-none-any.whl
Algorithm Hash digest
SHA256 e2db30fc986dad2e5ae341736178eb9c3cfee35355082bd5d0b50e0acc0447e7
MD5 6c520564de24762f5b33eecdaa2e80f5
BLAKE2b-256 16857988a1f0724a52f344aa1d778f47be76ed4a572d538d2acb919355167968

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