
Security News
Node.js Homepage Adds Paid Support Link, Prompting Contributor Pushback
A new Node.js homepage button linking to paid support for EOL versions has sparked a heated discussion among contributors and the wider community.
5x-aws-athena-auth-manager
Advanced tools
A simple Python library for creating an AWS Athena client using access key, secret key and region.
This Python library provides a simple way to create an AWS Athena client using AWS credentials. It handles authentication seamlessly, allowing developers to focus on querying Athena.
Install the package from PyPI using:
pip install 5x-aws-athena-auth-manager
This library relies on environment variables for authentication.
Variable | Description | Example |
---|---|---|
FIVEX_ATHENA_AWS_ACCESS_KEY | AWS Access Key ID | AKIA1234567890EXAMPLE |
FIVEX_ATHENA_AWS_SECRET_KEY | AWS Secret Access Key | wJalrXUtnFEMI/K7MDENG/123456 |
FIVEX_ATHENA_AWS_REGION | AWS Region | us-east-1 |
export FIVEX_ATHENA_AWS_ACCESS_KEY="your-access-key"
export FIVEX_ATHENA_AWS_SECRET_KEY="your-secret-key"
export FIVEX_ATHENA_AWS_REGION="your-aws-region"
from athena_auth import AthenaConnectionManager
try:
manager = AthenaConnectionManager()
client = manager.get_client()
print("ā
Athena Client Created Successfully!")
except Exception as e:
print(f"ā Error: {e}")
AthenaConnectionManager
Creates and manages an AWS Athena client using environment variables.
ā Validates AWS credentials from environment variables
ā Creates a boto3 Athena client with proper configuration
ā Tests the connection to ensure credentials are valid
ā Implements comprehensive error handling for debugging
The library provides detailed error handling with specific exceptions:
Exception | Cause |
---|---|
ValueError | Missing or invalid credentials |
ClientError | AWS API errors (invalid region, etc.) |
ConnectionError | Network or connectivity issues |
Exception | Unexpected errors during client creation |
from athena_auth import AthenaConnectionManager
from botocore.exceptions import ClientError
try:
manager = AthenaConnectionManager()
client = manager.get_client()
except ValueError as e:
print(f"ā Configuration Error: {e}")
except ClientError as e:
print(f"ā AWS Client Error: {e}")
except ConnectionError as e:
print(f"ā Connection Error: {e}")
except Exception as e:
print(f"ā Unexpected Error: {e}")
The library includes comprehensive test utilities:
# simple_test.py
from athena_auth import AthenaConnectionManager
def test_athena_connection():
manager = AthenaConnectionManager()
client = manager.get_client()
response = client.list_work_groups(MaxResults=1)
print("ā
Connection successful!")
if __name__ == "__main__":
test_athena_connection()
# Run the complete test suite
python test.py
Core dependencies required:
boto3>=1.26.0
botocore>=1.29.0
ā Simplifies AWS Athena authentication ā No need to manage credentials manually
ā Ensures proper credential validation ā Validates credentials before use
ā Provides comprehensive error handling ā Clear, actionable error messages
ā Includes testing utilities ā Easy to verify your setup
ā Production-ready ā Used by 5X platform services
We welcome contributions! Please feel free to submit a Pull Request.
MIT License - feel free to use this library in your projects!
FAQs
A simple Python library for creating an AWS Athena client using access key, secret key and region.
We found that 5x-aws-athena-auth-manager demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago.Ā It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
A new Node.js homepage button linking to paid support for EOL versions has sparked a heated discussion among contributors and the wider community.
Research
North Korean threat actors linked to the Contagious Interview campaign return with 35 new malicious npm packages using a stealthy multi-stage malware loader.
Research
Security News
The Socket Research Team investigates a malicious Python typosquat of a popular password library that forces Windows shutdowns when input is incorrect.