Registry / aws / aurora-data-api

aurora-data-api

JSON →
library0.5.0pypypi✓ verified 84d ago

A Python DB-API 2.0 client for the AWS Aurora Serverless Data API. Version 0.5.0 adds compatibility with RDS Data API for Aurora Serverless v2. The library provides a familiar database interface (PEP 249) for accessing Aurora Serverless databases without persistent connections.

pip install aurora-data-api
INSTALL
IMPORT
SIG · AURORA-DATA-API
A
aurora-data-api
awspythonv0.5.0
Install
3.7s avg
Import
741ms
Disk
50MB
Pass rate
10/ 10
Env Coverage10 / 10
glibc
3.93.13
musl
3.93.13
Install & Compatibility
Where this runs
tested against v0.5.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
py 3.103.95 runs
installs and imports cleanly · install 0.0s · import 0.756s · 51MB
glibc
py 3.103.95 runs
installs and imports cleanly · install 3.7s · import 0.726s · 52MB
50MB installed
● package 50MB
Code
Verified usage

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

aurora_data_api
import aurora_data_api
import aurora_data_api.client
Top-level module provides connect, use that

Connect and query Aurora Serverless via Data API

import aurora_data_api cluster_arn = 'arn:aws:rds:us-east-1:123456789012:cluster:my-cluster' secret_arn = 'arn:aws:secretsmanager:us-east-1:123456789012:secret:my-secret' database = 'mydb' connection = aurora_data_api.connect( database=database, secret_arn=secret_arn, resource_arn=cluster_arn ) with connection.cursor() as cursor: cursor.execute('SELECT * FROM users') for row in cursor.fetchall(): print(row)
Debug
Known issues
breakingVersion 0.4.0 reverted native type casting for JSON and UUID columns; they are now returned as strings. If you relied on automatic conversion, update your code.
fix
Manually parse JSON or UUID fields from strings.
affects: >=0.4.0
gotchaArray parameters are not supported and raise an error (since 0.4.0). Use individual parameters or batch execute.
fix
Pass parameters as scalar values, not lists.
affects: >=0.4.0
deprecatedThe `resource_arn` parameter is used but AWS documentation now calls it `resource_arn`; older aliases may be removed.
fix
Use `resource_arn` as the parameter name.
affects: all
Errors
Common errors & fixes
TypeError: 'list' object has no attribute 'items'
Passing a list as a parameter value (e.g., cursor.execute('SELECT * FROM t WHERE id IN (%s)', [1,2])). The driver does not support array parameters.
fix
Use tuple expansion or loop: cursor.execute('SELECT * FROM t WHERE id IN (%s,%s)', (1,2))
botocore.errorfactory.BadRequestException: An error occurred (BadRequestException) when calling the ExecuteStatement operation: Invalid secret arn
The secret ARN is malformed or the secret does not exist.
fix
Verify the secret ARN format: arn:aws:secretsmanager:<region>:<account>:secret:<name>-<random>
Upgrade
Version history
0.5.0latest on PyPI · released Dec 29, 2023
Audit
Dependencies
boto3requiredAWS SDK for Data API calls
sqlalchemyoptionalOptional SQLAlchemy dialect for aurora-data-api
Agent activity
30 hits · last 30 days
node
26
OpenAI (training)
1
Resources
aurora-data-api — pip install aurora-data-api · libregistry