{"id":23300,"library":"aws-advanced-python-wrapper","title":"AWS Advanced Python Wrapper","description":"The AWS Advanced Python Wrapper is a Python driver wrapper that adds enhanced functionality for Amazon Aurora databases, including automatic failover, connection pooling, and read/write splitting. It supports PostgreSQL and MySQL drivers. The current version is 2.1.0, with a release cadence of approximately every 3-4 months.","status":"active","version":"2.1.0","language":"python","source_language":"en","source_url":"https://github.com/awslabs/aws-advanced-python-wrapper","tags":["aws","aurora","database","rds","postgresql","mysql","failover"],"install":[{"cmd":"pip install aws-advanced-python-wrapper","lang":"bash","label":"Standard installation"},{"cmd":"pip install aws-advanced-python-wrapper[pg]","lang":"bash","label":"With PostgreSQL support"},{"cmd":"pip install aws-advanced-python-wrapper[mysql]","lang":"bash","label":"With MySQL support"}],"dependencies":[{"reason":"Required for PostgreSQL connectivity","package":"psycopg2-binary","optional":true},{"reason":"Required for MySQL connectivity","package":"PyMySQL","optional":true},{"reason":"Used for AWS Secrets Manager and RDS authentication","package":"boto3","optional":true}],"imports":[{"note":"Wrong subpackage path; AwsWrapperConnection is top-level","wrong":"from aws_advanced_python_wrapper.driver import AwsWrapperConnection","symbol":"AwsWrapperConnection","correct":"from aws_advanced_python_wrapper import AwsWrapperConnection"},{"note":null,"wrong":null,"symbol":"get_driver","correct":"from aws_advanced_python_wrapper import get_driver"}],"quickstart":{"code":"from aws_advanced_python_wrapper import AwsWrapperConnection\nimport os\n\n# For PostgreSQL\nconn = AwsWrapperConnection.connect(\n    'postgresql://user:password@host:5432/db',\n    autocommit=True\n)\n# For MySQL\n# conn = AwsWrapperConnection.connect(\n#     'mysql://user:password@host:3306/db',\n#     autocommit=True\n# )\n\nwith conn.cursor() as cursor:\n    cursor.execute(\"SELECT 1\")\n    print(cursor.fetchone())\nconn.close()","lang":"python","description":"Connects to an Aurora database using the wrapper. Replace the connection string with your actual credentials."},"warnings":[{"fix":"Upgrade Python to 3.10+ or stay on version 1.x.","message":"Version 2.0.0 drops support for Python 3.8 and 3.9. Only Python 3.10+ is supported.","severity":"breaking","affected_versions":">=2.0.0"},{"fix":"Refer to the documentation for new Failover v2 configuration keys. If you used custom failover settings, they may need updating.","message":"The Failover v2 plugin is the default in 2.1.0 and replaces the old failover plugin. The old plugin's configuration keys have changed.","severity":"breaking","affected_versions":">=2.1.0"},{"fix":"Implement connection pooling yourself using the underlying driver's pool feature or a library like SQLAlchemy.","message":"The wrapper does not automatically manage connection pooling; it's a wrapper around existing drivers. Use external pooling (e.g., psycopg2.pool) if needed.","severity":"gotcha","affected_versions":"all"},{"fix":"Ensure the RDS instance has IAM DB authentication enabled. Use the 'aws_secrets_manager' plugin for secrets-based auth as an alternative.","message":"When using IAM authentication, the wrapper expects the RDS DB instance to have IAM authentication enabled. Otherwise, authentication may fail silently.","severity":"gotcha","affected_versions":"all"}],"env_vars":null,"last_verified":"2026-05-01T00:00:00.000Z","next_check":"2026-07-30T00:00:00.000Z","problems":[{"fix":"pip install aws-advanced-python-wrapper[pg]","cause":"psycopg2 not installed; it is required for PostgreSQL connections.","error":"ModuleNotFoundError: No module named 'psycopg2'"},{"fix":"Verify the connection string (e.g., 'postgresql://user:pass@host:5432/db'), check network connectivity, and ensure the database is accessible.","cause":"The wrapper failed to connect to any database host, often due to incorrect connection string or network issues.","error":"aws_advanced_python_wrapper.exceptions.AwsWrapperConnectionException: Unable to connect to any host"},{"fix":"Use: from aws_advanced_python_wrapper import AwsWrapperConnection","cause":"Using an outdated import path; AwsWrapperConnection is a top-level class.","error":"AttributeError: module 'aws_advanced_python_wrapper' has no attribute 'AwsWrapperConnection'"}],"ecosystem":"pypi","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}