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.2.tar.gz (4.7 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.2-py3-none-any.whl (5.3 kB view details)

Uploaded Python 3

File details

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

File metadata

File hashes

Hashes for binaryrain_helper_cloud_aws-0.0.2.tar.gz
Algorithm Hash digest
SHA256 bb2bc73dd4ed096e204df8dc37d045b8df0a26e0ccd025c0995128ae3b3578a5
MD5 bea91aec2c8e002cfe283c31508e731b
BLAKE2b-256 39c8d6d0143e17535626e471aed5cfa01dcdaf2cfb7832e55ee5e371ed7dd419

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for binaryrain_helper_cloud_aws-0.0.2-py3-none-any.whl
Algorithm Hash digest
SHA256 3d5db5e61bd507d61e0903551d2eb6b3e1e10c3f42c7876df7863f753a54825c
MD5 3a67caf117ee41b7610e7d65f73346b7
BLAKE2b-256 72b8ba0b6aeec6b00338c52dd48ed3e7e378b4f709f234d7fd7a5b1ca9ef7876

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