cloud-sql-python-connector
Google Cloud SQL Python Connector library
Decision gist · record as of 2026-08-14
Yes. This is the official, actively maintained connector for Python applications accessing Cloud SQL on Google Cloud. It eliminates certificate management and IP allowlisting overhead while providing IAM-based security. Install it if you are running Python on Google Cloud and need Cloud SQL connectivity.AI-flagged interpretation of the facts on this page — verify before relying
Before you install
- Requires IAM principal with Cloud SQL Client role and Cloud SQL Admin API enabled in your Google Cloud Project; uses Application Default Credentials for authentication.
- Low friction install with a pure-Python wheel.
- Actively maintained with a recent release (21 days old) and a stable codebase (344 stars, last commit 2026-08-13).
License · maintenance · safety
Apache-2.0 (permissive) — Apache-2.0 permissive license allows commercial and private use with minimal restrictions.
last release 2026-07-24 (21 days) · last repo commit 2026-08-13 · 344 stars
0 known vulnerabilities (OSV.dev, 2026-08-14) · 7,971,363 downloads/mo, #1,677 on PyPI
Alternatives
Verify before relying
pip install "cloud-sql-python-connector[pymysql]"
from google.cloud.sql.connector import Connector
connector = Connector()
conn = connector.connect(
"project:region:instance",
"pymysql",
user="my-user",
password="my-password",
db="my-db-name"
)
connector.close()- Performance characteristics and connection overhead compared to direct SSL certificate management
- Support for connection pooling libraries beyond those mentioned in the description
- Behavior and latency in environments with intermittent network connectivity
What it is and what it does
The Cloud SQL Python Connector is a Google-maintained library that handles secure, IAM-authenticated connections to Cloud SQL instances without requiring SSL certificates or IP allowlisting. It wraps database drivers (pymysql, pg8000, asyncpg, pytds), intercepting connection requests to establish encrypted TLS 1.3 tunnels through Google's infrastructure using your application's IAM credentials.
The connector is designed to work alongside connection pooling libraries to manage connection reuse and reduce overhead. It supports both eager (background refresh) and lazy refresh strategies for credential management, making it suitable for serverless environments like Cloud Run and Cloud Functions where CPU throttling occurs outside request contexts. You initialize a Connector object, call its connect method with your instance details, and the library handles all authentication and encryption transparently.
Use it for
- Connect Python applications on Cloud Run or Cloud Functions to Cloud SQL without managing certificates or firewall rules
- Migrate from Cloud SQL Auth Proxy to a native Python solution with IAM-based access control
- Build multi-tenant applications where each tenant's database access is controlled via IAM roles
- Use IAM database authentication to avoid storing database passwords in application code or secrets
- Establish encrypted connections to Cloud SQL from on-premises or hybrid environments using service account credentials
Worth the install?
AI-flagged interpretation of the facts on this page. Verify before relying on it.
Yes.
This is the official, actively maintained connector for Python applications accessing Cloud SQL on Google Cloud. It eliminates certificate management and IP allowlisting overhead while providing IAM-based security. Install it if you are running Python on Google Cloud and need Cloud SQL connectivity.
Install
cloud-sql-python-connector on PyPI
Before you install
Low friction install with a pure-Python wheel. Actively maintained with a recent release (21 days old) and a stable codebase (344 stars, last commit 2026-08-13). Eight runtime dependencies are all well-established libraries.
Requires IAM principal with Cloud SQL Client role and Cloud SQL Admin API enabled in your Google Cloud Project; uses Application Default Credentials for authentication.
License in practice
Apache-2.0 permissive license allows commercial and private use with minimal restrictions.
Quickstart
pip install "cloud-sql-python-connector[pymysql]"
from google.cloud.sql.connector import Connector
connector = Connector()
conn = connector.connect(
"project:region:instance",
"pymysql",
user="my-user",
password="my-password",
db="my-db-name"
)
connector.close()
Verify before relying
- Performance characteristics and connection overhead compared to direct SSL certificate management
- Support for connection pooling libraries beyond those mentioned in the description
- Behavior and latency in environments with intermittent network connectivity
Package facts
| License | Apache-2.0 permissive |
| Python support | Supports the current Python release >=3.9 |
| Install friction | Low. Pure-Python wheel |
| Runtime dependencies | 8 packagesaiohttpcryptographydnspythonRequestsgoogle-authgrpcioprotobufgoogleapis-common-protos |
| Maintenance | Actively maintained 21 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 7,971,363 / month, #1,677 on PyPI 30-day window, as of 2026-08-14 |
| Known vulnerabilities | None known OSV.dev, checked 2026-08-14 |
| Classifiers | Development Status :: 5 - Production/StableIntended Audience :: DevelopersOperating System :: OS IndependentProgramming Language :: PythonProgramming Language :: Python :: 3Programming Language :: Python :: 3.10Programming Language :: Python :: 3.11Programming Language :: Python :: 3.12Programming Language :: Python :: 3.13Programming Language :: Python :: 3.9 |
Evidence: cloud_sql_python_connector-1.21.0-py3-none-any.whl
Tags
Let your AI agent find packages like this
Example. Real query, live index.
You found this page by searching. An agent finds it by wishing: SkillFed indexes 14,416 PyPI packages by what they can do, searchable in plain language.
wish › “cloud sql python connector”
- cloud-sql-python-connectorProvides IAM-based authentication and encrypted connections to Google…
- snowflake-connector-pythonConnects Python applications to Snowflake data warehouses using the…
- singlestoredbProvides a DB-API 2.0 compatible Python interface to SingleStore, a…
Give your agent the search over MCP, or paste the wish link into any chat.
More Database packages
psycopg2-binary is a PostgreSQL database adapter for Python that implements the DB API 2.0 specification, enabling Python applications to connect to and query PostgreSQL databases with thread-safe concurrent operations.
Python client library for connecting to and executing commands against Redis key-value stores, supporting both synchronous and asynchronous operations.
Install it if your application needs to interact with Redis; the only prerequisite is a running Redis server instance.
YDB Python SDK is the official client library for connecting to and querying YDB databases from Python applications.
Install it if you need to connect Python applications to YDB databases.
Connects Python applications to Snowflake data warehouses using the DB API 2.0 specification, enabling SQL queries, data transfers, and warehouse operations.
sqlparse tokenizes SQL text into a tree of statements, clauses, and expressions, and provides functions to split scripts, format queries, and inspect parsed tokens without validating dialect or syntax.
Install it if you need to manipulate, format, or analyze SQL text programmatically.
Provides base adapter protocols and shared functionality that database adapters use to integrate with dbt-core, handling connections, dialect translation, relation caching, and core interface management.
See also google-cloud-alloydb-connector · sqlalchemy-rdsiam · ipython-sql · gcloud-aio-auth · databricks-sql-connector · redshift-connector · sqlalchemy-pytds · sqlalchemy-aurora-data-api · google-cloud-iam · sqlalchemy-databricks