google-cloud-alloydb-connector
A Python client library for connecting securely to your Google Cloud AlloyDB instances.
What it is and what it does
The AlloyDB Python Connector is Google Cloud's recommended library for connecting Python applications to AlloyDB instances. It wraps PostgreSQL drivers and handles TLS 1.3 encryption, IAM-based authorization, and automatic credential refresh without requiring manual certificate or firewall management. The connector maintains a background refresh cycle to keep credentials warm, so you create one per application and reuse it across requests.
It supports both synchronous and asynchronous patterns and integrates with common PostgreSQL drivers. You authenticate using Google Cloud IAM roles rather than database passwords (optionally), configure connectivity mode (private IP, public IP, or Private Service Connect), and optionally enable IAM database authentication. The library is production-stable, actively maintained, and supports Python 3.10 through 3.14.
Use it for:
- Connect a web application to AlloyDB with automatic credential refresh and IAM-based authentication.
- Build async Python services that authenticate via IAM instead of managing database passwords.
- Deploy to serverless environments with lazy credential refresh to avoid background CPU throttling.
- Replace direct PostgreSQL connections with IAM-based authentication for improved security and auditability.
- Manage multi-region or multi-cluster AlloyDB access from a single Python application using instance URIs.
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
Provides secure, IAM-based connections to Google Cloud AlloyDB instances from Python applications using TLS 1.3 encryption and automatic credential management, with support for sync and async drivers.
Yes. This is the official Google Cloud connector for AlloyDB—actively maintained, production-stable, with no known vulnerabilities, low install friction, and Apache-2.0 licensing. Install it if you are connecting Python to AlloyDB and want automatic TLS, IAM-based auth, and credential lifecycle management without manual certificate handling.
Install
google-cloud-alloydb-connector on PyPI
pip
pip install google-cloud-alloydb-connectoruv
uv add google-cloud-alloydb-connectorpoetry
poetry add google-cloud-alloydb-connectorInstalling google-cloud-alloydb-connector
Before you install
Low friction installation with a pure-Python wheel. Actively maintained with a release 67 days ago and recent commits. Requires Python 3.10 or later and depends on standard Google Cloud libraries (google-auth, google-api-core, protobuf) plus cryptography and requests.
License in practice
Apache-2.0 permissive license allows commercial use, modification, and distribution with minimal restrictions—suitable for most production environments.
Quickstart
pip install google-cloud-alloydb-connector
from google.cloud.alloydbconnector import Connector
INSTANCE_URI = "projects/MY_PROJECT/locations/MY_REGION/clusters/MY_CLUSTER/instances/MY_INSTANCE"
with Connector() as connector:
conn = connector.connect(
INSTANCE_URI,
"pg8000",
user="my-user",
password="my-password",
db="my-db"
)
Requires Google Cloud credentials via Application Default Credentials (ADC), AlloyDB API enabled in your project, and the AlloyDB Client IAM role on your instance. Code must run in an environment connected to the VPC hosting your AlloyDB instance (or configured for public IP/PSC).
Verify before relying
- Performance characteristics and connection pooling overhead compared to direct PostgreSQL drivers
- Detailed support timeline for Python 3.14 and future versions beyond the stated semantic versioning policy
- Integration patterns with specific database drivers (pg8000, psycopg, asyncpg) and their individual requirements
Package facts
| License | Apache-2.0 (permissive) |
| Python support | supports the current Python release (>=3.10) |
| Install friction | low — pure-Python wheel |
| Runtime dependencies | 7 — aiofiles, cryptography, requests, google-auth, protobuf, google-cloud-alloydb, google-api-core |
| Maintenance | actively maintained — 67 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 754,627/month — #5,144 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: google_cloud_alloydb_connector-1.13.1-py3-none-any.whl
Tags
More Database packages
psycopg2-binary is a PostgreSQL database…
copyleft · top 1,000 on PyPI
redisPython client library for connecting to and…
permissive · top 1,000 on PyPI
ydbYDB Python SDK is the official client library…
permissive · top 1,000 on PyPI
snowflake-connector-pythonConnects Python applications to Snowflake data…
permissive · top 1,000 on PyPI
sqlparsesqlparse tokenizes SQL text into a tree of…
permissive · top 1,000 on PyPI
dbt-adaptersProvides base adapter protocols and shared…
permissive · top 1,000 on PyPI
cloud-sql-python-connectorProvides IAM-based authentication and encrypted…
permissive · top 5,000 on PyPI
google-cloud-alloydbProvides a Python client library for connecting…
permissive · top 1,000 on PyPI
sqlalchemy-rdsiamProvides SQLAlchemy dialects for connecting to…
unclear · top 15,000 on PyPI
googleauthenticationA meta package for connecting Python…
permissive · top 15,000 on PyPI
sqlalchemy-cockroachdbA SQLAlchemy dialect that enables ORM and SQL…
permissive · top 5,000 on PyPI
keyrings.google-artifactregistry-authA keyring backend that authenticates to Google…
permissive · top 5,000 on PyPI
google-cloud-iamProvides a Python client library for Google…
permissive · top 5,000 on PyPI
sqlalchemy-risingwaveProvides a SQLAlchemy dialect that enables…
permissive · top 15,000 on PyPI
gcloud-aio-authProvides asyncio-compatible and threadsafe…
permissive · top 1,000 on PyPI
google-cloud-iamconnectorcredentialsProvides a Python client library for Google…
permissive · top 15,000 on PyPI