sqlalchemy-spanner
SQLAlchemy dialect integrated into Cloud Spanner database
Decision gist · record as of 2026-08-14
Yes, but with caution. The package is functional and has low install friction, but its abandoned status (no commits since March 2026) means no active maintenance or support for future SQLAlchemy or Spanner API changes. Install it only if you are committed to maintaining a fork or if your application's SQLAlchemy and Spanner dependencies are locked to versions known to work with this dialect. For new projects, verify whether a maintained alternative exists or whether direct use of the Spanner client is more appropriate.AI-flagged interpretation of the facts on this page — verify before relying
Before you install
- Requires Google Cloud Spanner credentials configured via Application Default Credentials or passed explicitly; requires Python 3.10 or later.
- Low install friction with a pure-Python wheel.
- However, the package is marked as abandoned with no commits since 2026-03-13, raising concerns about future maintenance and compatibility with newer SQLAlchemy or Spanner API versions.
License · maintenance · safety
Apache 2.0 (permissive) — Licensed under Apache 2.0 (permissive), allowing use in most commercial and open-source projects without significant restrictions.
last release 2026-06-03 (72 days) · last repo commit 2026-03-13 · 53 stars · archived
0 known vulnerabilities (OSV.dev, 2026-08-14) · 19,731,216 downloads/mo, #1,056 on PyPI
Alternatives
Verify before relying
pip install sqlalchemy-spanner
from sqlalchemy import create_engine, MetaData, Table
engine = create_engine(
"spanner+spanner:///projects/project-id/instances/instance-id/databases/database-id"
)
metadata = MetaData(bind=engine)
table = Table("users", metadata, autoload=True)
with engine.begin() as connection:
result = connection.execute(table.select())- Whether the abandoned status affects compatibility with current SQLAlchemy 2.x releases and recent Spanner API changes.
- Whether community forks or alternative maintained dialects exist for Spanner.
- Performance characteristics and known limitations beyond those listed in the documentation excerpt.
What it is and what it does
sqlalchemy-spanner is a SQLAlchemy dialect that bridges the gap between SQLAlchemy's ORM and query abstractions and Google Cloud Spanner's database engine. It wraps the Spanner DB API (which implements PEP-249) to allow developers to use familiar SQLAlchemy patterns—table definitions, insert/update/delete operations, and select queries—against a Spanner instance without writing raw SQL or using the lower-level Spanner client directly.
The dialect supports Spanner-specific features like interleaved tables, commit timestamps, and unique constraints, and integrates with Alembic for schema migrations. It requires active Google Cloud credentials and a configured Spanner project, instance, and database. The package depends on sqlalchemy, google-cloud-spanner, and alembic, and supports Python 3.10 through 3.14. However, the repository is archived and abandoned, with no commits since March 2026, which may pose risks for long-term maintenance and compatibility.
Use it for
- Build a web application using SQLAlchemy ORM that persists data to Cloud Spanner without rewriting queries for a different database dialect.
- Migrate an existing SQLAlchemy application from a traditional SQL database to Cloud Spanner by swapping the connection URL.
- Define and manage Spanner schema using SQLAlchemy's declarative table API and Alembic migrations instead of raw DDL.
- Leverage Spanner's interleaved tables and commit-timestamp features through SQLAlchemy's table constructor options.
- Use SQLAlchemy's query builder and ORM relationships to work with Spanner data in a Python application.
Worth the install?
AI-flagged interpretation of the facts on this page. Verify before relying on it.
Yes, but with caution.
The package is functional and has low install friction, but its abandoned status (no commits since March 2026) means no active maintenance or support for future SQLAlchemy or Spanner API changes. Install it only if you are committed to maintaining a fork or if your application's SQLAlchemy and Spanner dependencies are locked to versions known to work with this dialect. For new projects, verify whether a maintained alternative exists or whether direct use of the Spanner client is more appropriate.
Install
sqlalchemy-spanner on PyPI
Before you install
Low install friction with a pure-Python wheel. However, the package is marked as abandoned with no commits since 2026-03-13, raising concerns about future maintenance and compatibility with newer SQLAlchemy or Spanner API versions.
Requires Google Cloud Spanner credentials configured via Application Default Credentials or passed explicitly; requires Python 3.10 or later.
License in practice
Licensed under Apache 2.0 (permissive), allowing use in most commercial and open-source projects without significant restrictions.
Quickstart
pip install sqlalchemy-spanner
from sqlalchemy import create_engine, MetaData, Table
engine = create_engine(
"spanner+spanner:///projects/project-id/instances/instance-id/databases/database-id"
)
metadata = MetaData(bind=engine)
table = Table("users", metadata, autoload=True)
with engine.begin() as connection:
result = connection.execute(table.select())
Verify before relying
- Whether the abandoned status affects compatibility with current SQLAlchemy 2.x releases and recent Spanner API changes.
- Whether community forks or alternative maintained dialects exist for Spanner.
- Performance characteristics and known limitations beyond those listed in the documentation excerpt.
Package facts
| License | Apache 2.0 permissive |
| Python support | Supports the current Python release >=3.10 |
| Install friction | Low. Pure-Python wheel |
| Runtime dependencies | 3 packagessqlalchemygoogle-cloud-spanneralembic |
| Maintenance | Abandoned 72 days since the last release |
| Last repo commit | repository archived |
| First released | |
| Downloads | 19,731,216 / month, #1,056 on PyPI 30-day window, as of 2026-08-14 |
| Known vulnerabilities | None known OSV.dev, checked 2026-08-14 |
| Classifiers | Intended Audience :: DevelopersLicense :: OSI Approved :: Apache Software LicenseProgramming Language :: Python :: 3.10Programming Language :: Python :: 3.11Programming Language :: Python :: 3.12Programming Language :: Python :: 3.13Programming Language :: Python :: 3.14 |
Evidence: sqlalchemy_spanner-1.19.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 › “sqlalchemy cloud spanner”
- sqlalchemy-spannerProvides a SQLAlchemy dialect that enables applications to use…
- google-cloud-spannerPython client library for Google Cloud Spanner, a managed globally…
- db-dtypesProvides pandas extension data types for SQL systems like BigQuery…
Give your agent the search over MCP, or paste the wish link into any chat.
More Front-Ends packages
SQLAlchemy is a Python SQL toolkit and Object Relational Mapper (ORM) that provides both a high-level ORM layer for declarative object persistence and a Core SQL construction system for direct database abstraction and query building.
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.
Alembic generates and manages database schema migrations for SQLAlchemy applications, handling version control of database structure changes with support for upgrades, downgrades, and auto-generation from model changes.
Install it if you use SQLAlchemy and need to version-control schema changes; skip it only if you manage migrations manually or use a different ORM entirely.
A Python client library for connecting to and querying Weaviate, a vector database that enables semantic search and AI-powered data retrieval.
A Python client library that connects to Databricks clusters and SQL warehouses using a Thrift-based protocol, conforming to the Python DB API 2.0 specification and supporting Arrow-based data exchange.
Install it if you need to query Databricks clusters or SQL warehouses from Python.
Psycopg 3 is a PostgreSQL database adapter for Python that enables applications to connect to, query, and manage PostgreSQL databases using Python code.
Install it if you need to connect Python to PostgreSQL.
See also google-cloud-spanner · sqlalchemy-solr · databricks-sqlalchemy · clickhouse-sqlalchemy · cerbos-sqlalchemy · pybigquery · sqlalchemy-jdbcapi · snowflake-sqlalchemy · db-dtypes · sqlakeyset