--- id: cloud-sql-python-connector version: "1.21.0" license: Apache-2.0 license_treatment: permissive maintenance: active --- # cloud-sql-python-connector — Google Cloud SQL Python Connector library License: permissive · Maintenance: active · Downloads: 8.0M/mo ## 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 above — verify before relying. Provides IAM-based authentication and encrypted connections to Google Cloud SQL instances from Python, handling TLS encryption and identity verification without requiring SSL certificates. 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 pip install cloud-sql-python-connector uv add cloud-sql-python-connector poetry add cloud-sql-python-connector ## Installing cloud-sql-python-connector 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. 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() 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. 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_current - Install friction: low - Maintenance: active - Downloads: 8.0M/month (top 5,000 on PyPI) - Known vulnerabilities: none known ## Tags cloud sql python connector, google cloud sql authentication, iam database connections, cloud sql tls encryption, managed cloud database proxy, serverless cloud sql access, google cloud sql driver, google-cloud, iam-auth, tls-encryption [View on SkillFed](https://skillfed.io/packages/cloud-sql-python-connector) · [View on PyPI](https://pypi.org/project/cloud-sql-python-connector/)