Registry / aws / aws-advanced-python-wrapper

aws-advanced-python-wrapper

JSON →
library3.0.0pypypi✓ verified 85d ago

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.

pip install aws-advanced-python-wrapper
INSTALL
IMPORT
SIG · AWS-ADVANCED-PYTHO
A
aws-advanced-python-wrapper
awspythonv3.0.0
Install
7.8s avg
Import
2012ms
Disk
63MB
Pass rate
8/ 10
Env Coverage8 / 10
glibc
3.93.13
musl
3.93.13
Install & Compatibility
Where this runs
tested against v3.0.0 · pip install
no network on importno background threads
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
glibc
py 3.10
✓ —
✓ 12.1s
py 3.11
✓ —
✓ 7.43s
py 3.12
✓ —
✓ 6.23s
py 3.13
✓ —
✓ 5.53s
py 3.9
✕ timeout
✕ timeout
63MB installed
● package 63MB
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

AwsWrapperConnection
from aws_advanced_python_wrapper import AwsWrapperConnection
from aws_advanced_python_wrapper.driver import AwsWrapperConnection
Wrong subpackage path; AwsWrapperConnection is top-level
get_driver
from aws_advanced_python_wrapper import get_driver

Connects to an Aurora database using the wrapper. Replace the connection string with your actual credentials.

from aws_advanced_python_wrapper import AwsWrapperConnection import os # For PostgreSQL conn = AwsWrapperConnection.connect( 'postgresql://user:password@host:5432/db', autocommit=True ) # For MySQL # conn = AwsWrapperConnection.connect( # 'mysql://user:password@host:3306/db', # autocommit=True # ) with conn.cursor() as cursor: cursor.execute("SELECT 1") print(cursor.fetchone()) conn.close()
Debug
Known issues
breakingVersion 2.0.0 drops support for Python 3.8 and 3.9. Only Python 3.10+ is supported.
fix
Upgrade Python to 3.10+ or stay on version 1.x.
affects: >=2.0.0
breakingThe Failover v2 plugin is the default in 2.1.0 and replaces the old failover plugin. The old plugin's configuration keys have changed.
fix
Refer to the documentation for new Failover v2 configuration keys. If you used custom failover settings, they may need updating.
affects: >=2.1.0
gotchaThe wrapper does not automatically manage connection pooling; it's a wrapper around existing drivers. Use external pooling (e.g., psycopg2.pool) if needed.
fix
Implement connection pooling yourself using the underlying driver's pool feature or a library like SQLAlchemy.
affects: all
gotchaWhen using IAM authentication, the wrapper expects the RDS DB instance to have IAM authentication enabled. Otherwise, authentication may fail silently.
fix
Ensure the RDS instance has IAM DB authentication enabled. Use the 'aws_secrets_manager' plugin for secrets-based auth as an alternative.
affects: all
Errors
Common errors & fixes
ModuleNotFoundError: No module named 'psycopg2'
psycopg2 not installed; it is required for PostgreSQL connections.
fix
pip install aws-advanced-python-wrapper[pg]
aws_advanced_python_wrapper.exceptions.AwsWrapperConnectionException: Unable to connect to any host
The wrapper failed to connect to any database host, often due to incorrect connection string or network issues.
fix
Verify the connection string (e.g., 'postgresql://user:pass@host:5432/db'), check network connectivity, and ensure the database is accessible.
AttributeError: module 'aws_advanced_python_wrapper' has no attribute 'AwsWrapperConnection'
Using an outdated import path; AwsWrapperConnection is a top-level class.
fix
Use: from aws_advanced_python_wrapper import AwsWrapperConnection
Upgrade
Version history
3.0.0latest on PyPI · released Jun 3, 2026
Audit
Dependencies
psycopg2-binaryoptionalRequired for PostgreSQL connectivity
PyMySQLoptionalRequired for MySQL connectivity
boto3optionalUsed for AWS Secrets Manager and RDS authentication
Agent activity
35 hits · last 30 days
node
31
OpenAI (training)
1
Resources
aws-advanced-python-wrapper — pip install aws-advanced-python-wrapper · libregistry