diff --git a/packages/google-cloud-spanner-dbapi-driver/.coveragerc b/packages/google-cloud-spanner-dbapi-driver/.coveragerc
new file mode 100644
index 000000000000..b36fd06d4caf
--- /dev/null
+++ b/packages/google-cloud-spanner-dbapi-driver/.coveragerc
@@ -0,0 +1,12 @@
+[run]
+branch = True
+
+[report]
+show_missing = True
+omit =
+ google/cloud/spanner_driver/__init__.py
+exclude_lines =
+ # Re-enable the standard pragma
+ pragma: NO COVER
+ # Ignore debug-only repr
+ def __repr__
diff --git a/packages/google-cloud-spanner-dbapi-driver/.flake8 b/packages/google-cloud-spanner-dbapi-driver/.flake8
new file mode 100644
index 000000000000..90316de21489
--- /dev/null
+++ b/packages/google-cloud-spanner-dbapi-driver/.flake8
@@ -0,0 +1,34 @@
+# -*- coding: utf-8 -*-
+# Copyright 2025 Google LLC
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+[flake8]
+# TODO(https://github.com/googleapis/gapic-generator-python/issues/2333):
+# Resolve flake8 lint issues
+ignore = E203, E231, E266, E501, W503
+exclude =
+ # TODO(https://github.com/googleapis/gapic-generator-python/issues/2333):
+ # Ensure that generated code passes flake8 lint
+ **/gapic/**
+ **/services/**
+ **/types/**
+ # Exclude Protobuf gencode
+ *_pb2.py
+
+ # Standard linting exemptions.
+ **/.nox/**
+ __pycache__,
+ .git,
+ *.pyc,
+ conf.py
diff --git a/packages/google-cloud-spanner-dbapi-driver/.repo-metadata.json b/packages/google-cloud-spanner-dbapi-driver/.repo-metadata.json
new file mode 100644
index 000000000000..6008b776651b
--- /dev/null
+++ b/packages/google-cloud-spanner-dbapi-driver/.repo-metadata.json
@@ -0,0 +1,16 @@
+{
+ "api_description": "Google Cloud Spanner DBAPI 2.0 Driver",
+ "api_id": "spanner.googleapis.com",
+ "api_shortname": "spanner",
+ "client_documentation": "https://cloud.google.com/python/docs/reference/spanner-dbapi-driver/latest",
+ "default_version": "v1",
+ "distribution_name": "google-cloud-spanner-dbapi-driver",
+ "issue_tracker": "https://github.com/googleapis/google-cloud-python/issues",
+ "language": "python",
+ "library_type": "MANUAL",
+ "name": "spanner-dbapi-driver",
+ "name_pretty": "Spanner DBAPI Driver",
+ "product_documentation": "https://cloud.google.com/spanner/",
+ "release_level": "preview",
+ "repo": "googleapis/google-cloud-python"
+}
diff --git a/packages/google-cloud-spanner-dbapi-driver/LICENSE b/packages/google-cloud-spanner-dbapi-driver/LICENSE
new file mode 100644
index 000000000000..f4f87bd4ed6d
--- /dev/null
+++ b/packages/google-cloud-spanner-dbapi-driver/LICENSE
@@ -0,0 +1,203 @@
+
+ Apache License
+ Version 2.0, January 2004
+ http://www.apache.org/licenses/
+
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
+
+ 1. Definitions.
+
+ "License" shall mean the terms and conditions for use, reproduction,
+ and distribution as defined by Sections 1 through 9 of this document.
+
+ "Licensor" shall mean the copyright owner or entity authorized by
+ the copyright owner that is granting the License.
+
+ "Legal Entity" shall mean the union of the acting entity and all
+ other entities that control, are controlled by, or are under common
+ control with that entity. For the purposes of this definition,
+ "control" means (i) the power, direct or indirect, to cause the
+ direction or management of such entity, whether by contract or
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
+ outstanding shares, or (iii) beneficial ownership of such entity.
+
+ "You" (or "Your") shall mean an individual or Legal Entity
+ exercising permissions granted by this License.
+
+ "Source" form shall mean the preferred form for making modifications,
+ including but not limited to software source code, documentation
+ source, and configuration files.
+
+ "Object" form shall mean any form resulting from mechanical
+ transformation or translation of a Source form, including but
+ not limited to compiled object code, generated documentation,
+ and conversions to other media types.
+
+ "Work" shall mean the work of authorship, whether in Source or
+ Object form, made available under the License, as indicated by a
+ copyright notice that is included in or attached to the work
+ (an example is provided in the Appendix below).
+
+ "Derivative Works" shall mean any work, whether in Source or Object
+ form, that is based on (or derived from) the Work and for which the
+ editorial revisions, annotations, elaborations, or other modifications
+ represent, as a whole, an original work of authorship. For the purposes
+ of this License, Derivative Works shall not include works that remain
+ separable from, or merely link (or bind by name) to the interfaces of,
+ the Work and Derivative Works thereof.
+
+ "Contribution" shall mean any work of authorship, including
+ the original version of the Work and any modifications or additions
+ to that Work or Derivative Works thereof, that is intentionally
+ submitted to Licensor for inclusion in the Work by the copyright owner
+ or by an individual or Legal Entity authorized to submit on behalf of
+ the copyright owner. For the purposes of this definition, "submitted"
+ means any form of electronic, verbal, or written communication sent
+ to the Licensor or its representatives, including but not limited to
+ communication on electronic mailing lists, source code control systems,
+ and issue tracking systems that are managed by, or on behalf of, the
+ Licensor for the purpose of discussing and improving the Work, but
+ excluding communication that is conspicuously marked or otherwise
+ designated in writing by the copyright owner as "Not a Contribution."
+
+ "Contributor" shall mean Licensor and any individual or Legal Entity
+ on behalf of whom a Contribution has been received by Licensor and
+ subsequently incorporated within the Work.
+
+ 2. Grant of Copyright License. Subject to the terms and conditions of
+ this License, each Contributor hereby grants to You a perpetual,
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+ copyright license to reproduce, prepare Derivative Works of,
+ publicly display, publicly perform, sublicense, and distribute the
+ Work and such Derivative Works in Source or Object form.
+
+ 3. Grant of Patent License. Subject to the terms and conditions of
+ this License, each Contributor hereby grants to You a perpetual,
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+ (except as stated in this section) patent license to make, have made,
+ use, offer to sell, sell, import, and otherwise transfer the Work,
+ where such license applies only to those patent claims licensable
+ by such Contributor that are necessarily infringed by their
+ Contribution(s) alone or by combination of their Contribution(s)
+ with the Work to which such Contribution(s) was submitted. If You
+ institute patent litigation against any entity (including a
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
+ or a Contribution incorporated within the Work constitutes direct
+ or contributory patent infringement, then any patent licenses
+ granted to You under this License for that Work shall terminate
+ as of the date such litigation is filed.
+
+ 4. Redistribution. You may reproduce and distribute copies of the
+ Work or Derivative Works thereof in any medium, with or without
+ modifications, and in Source or Object form, provided that You
+ meet the following conditions:
+
+ (a) You must give any other recipients of the Work or
+ Derivative Works a copy of this License; and
+
+ (b) You must cause any modified files to carry prominent notices
+ stating that You changed the files; and
+
+ (c) You must retain, in the Source form of any Derivative Works
+ that You distribute, all copyright, patent, trademark, and
+ attribution notices from the Source form of the Work,
+ excluding those notices that do not pertain to any part of
+ the Derivative Works; and
+
+ (d) If the Work includes a "NOTICE" text file as part of its
+ distribution, then any Derivative Works that You distribute must
+ include a readable copy of the attribution notices contained
+ within such NOTICE file, excluding those notices that do not
+ pertain to any part of the Derivative Works, in at least one
+ of the following places: within a NOTICE text file distributed
+ as part of the Derivative Works; within the Source form or
+ documentation, if provided along with the Derivative Works; or,
+ within a display generated by the Derivative Works, if and
+ wherever such third-party notices normally appear. The contents
+ of the NOTICE file are for informational purposes only and
+ do not modify the License. You may add Your own attribution
+ notices within Derivative Works that You distribute, alongside
+ or as an addendum to the NOTICE text from the Work, provided
+ that such additional attribution notices cannot be construed
+ as modifying the License.
+
+ You may add Your own copyright statement to Your modifications and
+ may provide additional or different license terms and conditions
+ for use, reproduction, or distribution of Your modifications, or
+ for any such Derivative Works as a whole, provided Your use,
+ reproduction, and distribution of the Work otherwise complies with
+ the conditions stated in this License.
+
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
+ any Contribution intentionally submitted for inclusion in the Work
+ by You to the Licensor shall be under the terms and conditions of
+ this License, without any additional terms or conditions.
+ Notwithstanding the above, nothing herein shall supersede or modify
+ the terms of any separate license agreement you may have executed
+ with Licensor regarding such Contributions.
+
+ 6. Trademarks. This License does not grant permission to use the trade
+ names, trademarks, service marks, or product names of the Licensor,
+ except as required for reasonable and customary use in describing the
+ origin of the Work and reproducing the content of the NOTICE file.
+
+ 7. Disclaimer of Warranty. Unless required by applicable law or
+ agreed to in writing, Licensor provides the Work (and each
+ Contributor provides its Contributions) on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+ implied, including, without limitation, any warranties or conditions
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
+ PARTICULAR PURPOSE. You are solely responsible for determining the
+ appropriateness of using or redistributing the Work and assume any
+ risks associated with Your exercise of permissions under this License.
+
+ 8. Limitation of Liability. In no event and under no legal theory,
+ whether in tort (including negligence), contract, or otherwise,
+ unless required by applicable law (such as deliberate and grossly
+ negligent acts) or agreed to in writing, shall any Contributor be
+ liable to You for damages, including any direct, indirect, special,
+ incidental, or consequential damages of any character arising as a
+ result of this License or out of the use or inability to use the
+ Work (including but not limited to damages for loss of goodwill,
+ work stoppage, computer failure or malfunction, or any and all
+ other commercial damages or losses), even if such Contributor
+ has been advised of the possibility of such damages.
+
+ 9. Accepting Warranty or Additional Liability. While redistributing
+ the Work or Derivative Works thereof, You may choose to offer,
+ and charge a fee for, acceptance of support, warranty, indemnity,
+ or other liability obligations and/or rights consistent with this
+ License. However, in accepting such obligations, You may act only
+ on Your own behalf and on Your sole responsibility, not on behalf
+ of any other Contributor, and only if You agree to indemnify,
+ defend, and hold each Contributor harmless for any liability
+ incurred by, or claims asserted against, such Contributor by reason
+ of your accepting any such warranty or additional liability.
+
+ END OF TERMS AND CONDITIONS
+
+ APPENDIX: How to apply the Apache License to your work.
+
+ To apply the Apache License to your work, attach the following
+ boilerplate notice, with the fields enclosed by brackets "[]"
+ replaced with your own identifying information. (Don't include
+ the brackets!) The text should be enclosed in the appropriate
+ comment syntax for the file format. We also recommend that a
+ file or class name and description of purpose be included on the
+ same "printed page" as the copyright notice for easier
+ identification within third-party archives.
+
+ Copyright [yyyy] [name of copyright owner]
+
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+
\ No newline at end of file
diff --git a/packages/google-cloud-spanner-dbapi-driver/MANIFEST.in b/packages/google-cloud-spanner-dbapi-driver/MANIFEST.in
new file mode 100644
index 000000000000..e69de29bb2d1
diff --git a/packages/google-cloud-spanner-dbapi-driver/README.rst b/packages/google-cloud-spanner-dbapi-driver/README.rst
new file mode 100644
index 000000000000..29d7be7da11e
--- /dev/null
+++ b/packages/google-cloud-spanner-dbapi-driver/README.rst
@@ -0,0 +1,11 @@
+Python DBAPI 2.0 Compliant Driver for Spanner
+=============================================
+
+|stable| |pypi| |versions|
+
+.. |stable| image:: https://img.shields.io/badge/support-stable-gold.svg
+ :target: https://github.com/googleapis/google-cloud-python/blob/main/README.rst#stability-levels
+.. |pypi| image:: https://img.shields.io/pypi/v/google-cloud-spanner-dbapi-driver.svg
+ :target: https://pypi.org/project/google-cloud-spanner-dbapi-driver/
+.. |versions| image:: https://img.shields.io/pypi/pyversions/google-cloud-spanner-dbapi-driver.svg
+ :target: https://pypi.org/project/google-cloud-spanner-dbapi-driver/
diff --git a/packages/google-cloud-spanner-dbapi-driver/docs/README.rst b/packages/google-cloud-spanner-dbapi-driver/docs/README.rst
new file mode 100644
index 000000000000..29d7be7da11e
--- /dev/null
+++ b/packages/google-cloud-spanner-dbapi-driver/docs/README.rst
@@ -0,0 +1,11 @@
+Python DBAPI 2.0 Compliant Driver for Spanner
+=============================================
+
+|stable| |pypi| |versions|
+
+.. |stable| image:: https://img.shields.io/badge/support-stable-gold.svg
+ :target: https://github.com/googleapis/google-cloud-python/blob/main/README.rst#stability-levels
+.. |pypi| image:: https://img.shields.io/pypi/v/google-cloud-spanner-dbapi-driver.svg
+ :target: https://pypi.org/project/google-cloud-spanner-dbapi-driver/
+.. |versions| image:: https://img.shields.io/pypi/pyversions/google-cloud-spanner-dbapi-driver.svg
+ :target: https://pypi.org/project/google-cloud-spanner-dbapi-driver/
diff --git a/packages/google-cloud-spanner-dbapi-driver/docs/_static/custom.css b/packages/google-cloud-spanner-dbapi-driver/docs/_static/custom.css
new file mode 100644
index 000000000000..b0a295464b23
--- /dev/null
+++ b/packages/google-cloud-spanner-dbapi-driver/docs/_static/custom.css
@@ -0,0 +1,20 @@
+div#python2-eol {
+ border-color: red;
+ border-width: medium;
+}
+
+/* Ensure minimum width for 'Parameters' / 'Returns' column */
+dl.field-list > dt {
+ min-width: 100px
+}
+
+/* Insert space between methods for readability */
+dl.method {
+ padding-top: 10px;
+ padding-bottom: 10px
+}
+
+/* Insert empty space between classes */
+dl.class {
+ padding-bottom: 50px
+}
diff --git a/packages/google-cloud-spanner-dbapi-driver/docs/_templates/layout.html b/packages/google-cloud-spanner-dbapi-driver/docs/_templates/layout.html
new file mode 100644
index 000000000000..95e9c77fcfe1
--- /dev/null
+++ b/packages/google-cloud-spanner-dbapi-driver/docs/_templates/layout.html
@@ -0,0 +1,50 @@
+
+{% extends "!layout.html" %}
+{%- block content %}
+{%- if theme_fixed_sidebar|lower == 'true' %}
+
+ As of January 1, 2020 this library no longer supports Python 2 on the latest released version.
+ Library versions released prior to that date will continue to be available. For more information please
+ visit Python 2 support on Google Cloud.
+
+{%- else %}
+{{ super() }}
+{%- endif %}
+{%- endblock %}
diff --git a/packages/google-cloud-spanner-dbapi-driver/docs/conf.py b/packages/google-cloud-spanner-dbapi-driver/docs/conf.py
new file mode 100644
index 000000000000..a0a978d424e6
--- /dev/null
+++ b/packages/google-cloud-spanner-dbapi-driver/docs/conf.py
@@ -0,0 +1,417 @@
+# -*- coding: utf-8 -*-
+# Copyright 2025 Google LLC
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+##
+# google-cloud-spanner-dbapi documentation build configuration file
+#
+# This file is execfile()d with the current directory set to its
+# containing dir.
+#
+# Note that not all possible configuration values are present in this
+# autogenerated file.
+#
+# All configuration values have a default; values that are commented out
+# serve to show the default.
+
+import logging
+import os
+import shlex
+import sys
+from typing import Any
+
+# If extensions (or modules to document with autodoc) are in another directory,
+# add these directories to sys.path here. If the directory is relative to the
+# documentation root, use os.path.abspath to make it absolute, like shown here.
+sys.path.insert(0, os.path.abspath(".."))
+
+# For plugins that can not read conf.py.
+# See also: https://github.com/docascode/sphinx-docfx-yaml/issues/85
+sys.path.insert(0, os.path.abspath("."))
+
+__version__ = ""
+
+# -- General configuration ------------------------------------------------
+
+# If your documentation needs a minimal Sphinx version, state it here.
+needs_sphinx = "4.5.0"
+
+# Add any Sphinx extension module names here, as strings. They can be
+# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom
+# ones.
+extensions = [
+ "sphinx.ext.autodoc",
+ "sphinx.ext.autosummary",
+ "sphinx.ext.intersphinx",
+ "sphinx.ext.coverage",
+ "sphinx.ext.doctest",
+ "sphinx.ext.napoleon",
+ "sphinx.ext.todo",
+ "sphinx.ext.viewcode",
+ "recommonmark",
+]
+
+# autodoc/autosummary flags
+autoclass_content = "both"
+autodoc_default_options = {"members": True}
+autosummary_generate = True
+
+
+# Add any paths that contain templates here, relative to this directory.
+templates_path = ["_templates"]
+
+# The suffix(es) of source filenames.
+# You can specify multiple suffix as a list of string:
+# source_suffix = ['.rst', '.md']
+source_suffix = [".rst", ".md"]
+
+# The encoding of source files.
+# source_encoding = 'utf-8-sig'
+
+# The root toctree document.
+root_doc = "index"
+
+# General information about the project.
+project = "google-cloud-spanner-dbapi"
+copyright = "2025, Google, LLC"
+author = "Google APIs"
+
+# The version info for the project you're documenting, acts as replacement for
+# |version| and |release|, also used in various other places throughout the
+# built documents.
+#
+# The full version, including alpha/beta/rc tags.
+release = __version__
+# The short X.Y version.
+version = ".".join(release.split(".")[0:2])
+
+# The language for content autogenerated by Sphinx. Refer to documentation
+# for a list of supported languages.
+#
+# This is also used if you do content translation via gettext catalogs.
+# Usually you set "language" from the command line for these cases.
+language = None
+
+# There are two options for replacing |today|: either, you set today to some
+# non-false value, then it is used:
+# today = ''
+# Else, today_fmt is used as the format for a strftime call.
+# today_fmt = '%B %d, %Y'
+
+# List of patterns, relative to source directory, that match files and
+# directories to ignore when looking for source files.
+exclude_patterns = [
+ "_build",
+ "**/.nox/**/*",
+ "samples/AUTHORING_GUIDE.md",
+ "samples/CONTRIBUTING.md",
+ "samples/snippets/README.rst",
+]
+
+# The reST default role (used for this markup: `text`) to use for all
+# documents.
+# default_role = None
+
+# If true, '()' will be appended to :func: etc. cross-reference text.
+# add_function_parentheses = True
+
+# If true, the current module name will be prepended to all description
+# unit titles (such as .. function::).
+# add_module_names = True
+
+# If true, sectionauthor and moduleauthor directives will be shown in the
+# output. They are ignored by default.
+# show_authors = False
+
+# The name of the Pygments (syntax highlighting) style to use.
+pygments_style = "sphinx"
+
+# A list of ignored prefixes for module index sorting.
+# modindex_common_prefix = []
+
+# If true, keep warnings as "system message" paragraphs in the built documents.
+# keep_warnings = False
+
+# If true, `todo` and `todoList` produce output, else they produce nothing.
+todo_include_todos = True
+
+
+# -- Options for HTML output ----------------------------------------------
+
+# The theme to use for HTML and HTML Help pages. See the documentation for
+# a list of builtin themes.
+html_theme = "alabaster"
+
+# Theme options are theme-specific and customize the look and feel of a theme
+# further. For a list of options available for each theme, see the
+# documentation.
+html_theme_options = {
+ "description": "Python DBAPI 2.0 Compliant Driver for Spanner",
+ "github_user": "googleapis",
+ "github_repo": "google-cloud-python",
+ "github_banner": True,
+ "font_family": "'Roboto', Georgia, sans",
+ "head_font_family": "'Roboto', Georgia, serif",
+ "code_font_family": "'Roboto Mono', 'Consolas', monospace",
+}
+
+# Add any paths that contain custom themes here, relative to this directory.
+# html_theme_path = []
+
+# The name for this set of Sphinx documents. If None, it defaults to
+# " v documentation".
+# html_title = None
+
+# A shorter title for the navigation bar. Default is the same as html_title.
+# html_short_title = None
+
+# The name of an image file (relative to this directory) to place at the top
+# of the sidebar.
+# html_logo = None
+
+# The name of an image file (within the static path) to use as favicon of the
+# docs. This file should be a Windows icon file (.ico) being 16x16 or 32x32
+# pixels large.
+# html_favicon = None
+
+# Add any paths that contain custom static files (such as style sheets) here,
+# relative to this directory. They are copied after the builtin static files,
+# so a file named "default.css" will overwrite the builtin "default.css".
+html_static_path = ["_static"]
+
+# Add any extra paths that contain custom files (such as robots.txt or
+# .htaccess) here, relative to this directory. These files are copied
+# directly to the root of the documentation.
+# html_extra_path = []
+
+# If not '', a 'Last updated on:' timestamp is inserted at every page bottom,
+# using the given strftime format.
+# html_last_updated_fmt = '%b %d, %Y'
+
+# If true, SmartyPants will be used to convert quotes and dashes to
+# typographically correct entities.
+# html_use_smartypants = True
+
+# Custom sidebar templates, maps document names to template names.
+# html_sidebars = {}
+
+# Additional templates that should be rendered to pages, maps page names to
+# template names.
+# html_additional_pages = {}
+
+# If false, no module index is generated.
+# html_domain_indices = True
+
+# If false, no index is generated.
+# html_use_index = True
+
+# If true, the index is split into individual pages for each letter.
+# html_split_index = False
+
+# If true, links to the reST sources are added to the pages.
+# html_show_sourcelink = True
+
+# If true, "Created using Sphinx" is shown in the HTML footer. Default is True.
+# html_show_sphinx = True
+
+# If true, "(C) Copyright ..." is shown in the HTML footer. Default is True.
+# html_show_copyright = True
+
+# If true, an OpenSearch description file will be output, and all pages will
+# contain a tag referring to it. The value of this option must be the
+# base URL from which the finished HTML is served.
+# html_use_opensearch = ''
+
+# This is the file name suffix for HTML files (e.g. ".xhtml").
+# html_file_suffix = None
+
+# Language to be used for generating the HTML full-text search index.
+# Sphinx supports the following languages:
+# 'da', 'de', 'en', 'es', 'fi', 'fr', 'hu', 'it', 'ja'
+# 'nl', 'no', 'pt', 'ro', 'ru', 'sv', 'tr'
+# html_search_language = 'en'
+
+# A dictionary with options for the search language support, empty by default.
+# Now only 'ja' uses this config value
+# html_search_options = {'type': 'default'}
+
+# The name of a javascript file (relative to the configuration directory) that
+# implements a search results scorer. If empty, the default will be used.
+# html_search_scorer = 'scorer.js'
+
+# Output file base name for HTML help builder.
+htmlhelp_basename = "google-cloud-spanner-dbapi-doc"
+
+# -- Options for warnings ------------------------------------------------------
+
+
+suppress_warnings = [
+ # Temporarily suppress this to avoid "more than one target found for
+ # cross-reference" warning, which are intractable for us to avoid while in
+ # a mono-repo.
+ # See https://github.com/sphinx-doc/sphinx/blob
+ # /2a65ffeef5c107c19084fabdd706cdff3f52d93c/sphinx/domains/python.py#L843
+ "ref.python"
+]
+
+# -- Options for LaTeX output ---------------------------------------------
+
+latex_elements = {
+ # The paper size ('letterpaper' or 'a4paper').
+ # 'papersize': 'letterpaper',
+ # The font size ('10pt', '11pt' or '12pt').
+ # 'pointsize': '10pt',
+ # Additional stuff for the LaTeX preamble.
+ # 'preamble': '',
+ # Latex figure (float) alignment
+ # 'figure_align': 'htbp',
+}
+
+# Grouping the document tree into LaTeX files. List of tuples
+# (source start file, target name, title,
+# author, documentclass [howto, manual, or own class]).
+latex_documents = [
+ (
+ root_doc,
+ "google-cloud-spanner-dbapi.tex",
+ "google-cloud-spanner-dbapi Documentation",
+ author,
+ "manual",
+ )
+]
+
+# The name of an image file (relative to this directory) to place at the top of
+# the title page.
+# latex_logo = None
+
+# For "manual" documents, if this is true, then toplevel headings are parts,
+# not chapters.
+# latex_use_parts = False
+
+# If true, show page references after internal links.
+# latex_show_pagerefs = False
+
+# If true, show URL addresses after external links.
+# latex_show_urls = False
+
+# Documents to append as an appendix to all manuals.
+# latex_appendices = []
+
+# If false, no module index is generated.
+# latex_domain_indices = True
+
+
+# -- Options for manual page output ---------------------------------------
+
+# One entry per manual page. List of tuples
+# (source start file, name, description, authors, manual section).
+man_pages = [
+ (
+ root_doc,
+ "google-cloud-spanner-dbapi",
+ "google-cloud-spanner-dbapi Documentation",
+ [author],
+ 1,
+ )
+]
+
+# If true, show URL addresses after external links.
+# man_show_urls = False
+
+
+# -- Options for Texinfo output -------------------------------------------
+
+# Grouping the document tree into Texinfo files. List of tuples
+# (source start file, target name, title, author,
+# dir menu entry, description, category)
+texinfo_documents = [
+ (
+ root_doc,
+ "google-cloud-spanner-dbapi",
+ "google-cloud-spanner-dbapi Documentation",
+ author,
+ "google-cloud-spanner-dbapi",
+ "google-cloud-spanner-dbapi Library",
+ "APIs",
+ )
+]
+
+# Documents to append as an appendix to all manuals.
+# texinfo_appendices = []
+
+# If false, no module index is generated.
+# texinfo_domain_indices = True
+
+# How to display URL addresses: 'footnote', 'no', or 'inline'.
+# texinfo_show_urls = 'footnote'
+
+# If true, do not generate a @detailmenu in the "Top" node's menu.
+# texinfo_no_detailmenu = False
+
+
+# Example configuration for intersphinx: refer to the Python standard library.
+intersphinx_mapping = {
+ "python": ("https://python.readthedocs.org/en/latest/", None),
+ "google-auth": ("https://googleapis.dev/python/google-auth/latest/", None),
+ "google.api_core": (
+ "https://googleapis.dev/python/google-api-core/latest/",
+ None,
+ ),
+ "grpc": ("https://grpc.github.io/grpc/python/", None),
+ "proto-plus": ("https://proto-plus-python.readthedocs.io/en/latest/", None),
+ "protobuf": ("https://googleapis.dev/python/protobuf/latest/", None),
+}
+
+
+# Napoleon settings
+napoleon_google_docstring = True
+napoleon_numpy_docstring = True
+napoleon_include_private_with_doc = False
+napoleon_include_special_with_doc = True
+napoleon_use_admonition_for_examples = False
+napoleon_use_admonition_for_notes = False
+napoleon_use_admonition_for_references = False
+napoleon_use_ivar = False
+napoleon_use_param = True
+napoleon_use_rtype = True
+
+
+# Setup for sphinx behaviors such as warning filters.
+class UnexpectedUnindentFilter(logging.Filter):
+ """Filter out warnings about unexpected unindentation following bullet lists."""
+
+ def filter(self, record: logging.LogRecord) -> bool:
+ """Filter the log record.
+
+ Args:
+ record (logging.LogRecord): The log record.
+
+ Returns:
+ bool: False to suppress the warning, True to allow it.
+ """
+ msg = record.getMessage()
+ if "Bullet list ends without a blank line" in msg:
+ return False
+ return True
+
+
+def setup(app: Any) -> None:
+ """Setup the Sphinx application.
+
+ Args:
+ app (Any): The Sphinx application.
+ """
+ # Sphinx's logger is hierarchical. Adding a filter to the
+ # root 'sphinx' logger will catch warnings from all sub-loggers.
+ logger = logging.getLogger("sphinx")
+ logger.addFilter(UnexpectedUnindentFilter())
diff --git a/packages/google-cloud-spanner-dbapi-driver/docs/index.rst b/packages/google-cloud-spanner-dbapi-driver/docs/index.rst
new file mode 100644
index 000000000000..98ebacf8044d
--- /dev/null
+++ b/packages/google-cloud-spanner-dbapi-driver/docs/index.rst
@@ -0,0 +1,19 @@
+.. include:: README.rst
+
+
+API Reference
+-------------
+.. toctree::
+ :maxdepth: 2
+
+
+Changelog
+---------
+
+For a list of all ``google-cloud-spanner-dbapi`` releases:
+
+.. toctree::
+ :maxdepth: 2
+
+.. toctree::
+ :hidden:
diff --git a/packages/google-cloud-spanner-dbapi-driver/google/cloud/spanner_driver/__init__.py b/packages/google-cloud-spanner-dbapi-driver/google/cloud/spanner_driver/__init__.py
new file mode 100644
index 000000000000..b75f2a4d398f
--- /dev/null
+++ b/packages/google-cloud-spanner-dbapi-driver/google/cloud/spanner_driver/__init__.py
@@ -0,0 +1,30 @@
+# Copyright 2026 Google LLC
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+"""Spanner Python Driver."""
+
+import logging
+
+from . import version as package_version
+from .dbapi import apilevel, paramstyle, threadsafety
+
+__version__ = package_version.__version__
+
+logger = logging.getLogger(__name__)
+logger.addHandler(logging.NullHandler())
+
+__all__: list[str] = [
+ "apilevel",
+ "paramstyle",
+ "threadsafety",
+]
diff --git a/packages/google-cloud-spanner-dbapi-driver/google/cloud/spanner_driver/dbapi.py b/packages/google-cloud-spanner-dbapi-driver/google/cloud/spanner_driver/dbapi.py
new file mode 100644
index 000000000000..8e9dea6232f3
--- /dev/null
+++ b/packages/google-cloud-spanner-dbapi-driver/google/cloud/spanner_driver/dbapi.py
@@ -0,0 +1,43 @@
+# Copyright 2026 Google LLC
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+"""DBAPI 2.0 Global Variables."""
+
+# Globals: apilevel
+# String constant stating the supported DB API level.
+# https://peps.python.org/pep-0249/#apilevel
+# Currently only the strings “1.0” and “2.0” are allowed.
+# If not given, a DB-API 1.0 level interface should be assumed.
+apilevel: str = "2.0"
+
+# Globals: threadsafety
+# https://peps.python.org/pep-0249/#threadsafety
+# Integer constant stating the level of thread safety the interface supports.
+# Possible values are:
+# 0 - Threads may not share the module.
+# 1 - Threads may share the module, but not connections.
+# 2 - Threads may share the module and connections.
+# 3 - Threads may share the module, connections and cursors.
+threadsafety: int = 1
+
+# Globals: paramstyle
+# https://peps.python.org/pep-0249/#paramstyle
+# String constant stating the type of parameter marker formatting expected
+# by the interface.
+# Possible values are
+# qmark - Question mark style, e.g. ...WHERE name=?
+# numeric - Numeric, positional style, e.g. ...WHERE name=:1
+# named - Named style, e.g. ...WHERE name=:name
+# format - ANSI C printf format codes, e.g. ...WHERE name=%s
+# pyformat - Python extended format codes, e.g. ...WHERE name=%(name)s
+paramstyle: str = "pyformat"
diff --git a/packages/google-cloud-spanner-dbapi-driver/google/cloud/spanner_driver/version.py b/packages/google-cloud-spanner-dbapi-driver/google/cloud/spanner_driver/version.py
new file mode 100644
index 000000000000..e2d420ede8f5
--- /dev/null
+++ b/packages/google-cloud-spanner-dbapi-driver/google/cloud/spanner_driver/version.py
@@ -0,0 +1,16 @@
+# -*- coding: utf-8 -*-
+# Copyright 2025 Google LLC
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+__version__ = "0.0.1" # {x-release-please-version}
diff --git a/packages/google-cloud-spanner-dbapi-driver/mypy.ini b/packages/google-cloud-spanner-dbapi-driver/mypy.ini
new file mode 100644
index 000000000000..81b11c94badc
--- /dev/null
+++ b/packages/google-cloud-spanner-dbapi-driver/mypy.ini
@@ -0,0 +1,15 @@
+[mypy]
+python_version = 3.11
+namespace_packages = True
+ignore_missing_imports = False
+
+# TODO(https://github.com/googleapis/gapic-generator-python/issues/2563):
+# Dependencies that historically lacks py.typed markers
+[mypy-google.iam.*]
+ignore_missing_imports = True
+
+# Helps mypy navigate the 'google' namespace more reliably in 3.10+
+explicit_package_bases = True
+
+# Performance: reuse results from previous runs to speed up 'nox'
+incremental = True
diff --git a/packages/google-cloud-spanner-dbapi-driver/noxfile.py b/packages/google-cloud-spanner-dbapi-driver/noxfile.py
new file mode 100644
index 000000000000..dd7e1d3323f8
--- /dev/null
+++ b/packages/google-cloud-spanner-dbapi-driver/noxfile.py
@@ -0,0 +1,590 @@
+# -*- coding: utf-8 -*-
+# Copyright 2025 Google LLC
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+import glob
+import os
+import pathlib
+import re
+import shutil
+import warnings
+from typing import Dict, List
+
+import nox
+
+RUFF_VERSION = "ruff==0.14.14"
+
+LINT_PATHS = ["google", "tests", "noxfile.py", "setup.py"]
+
+# Add samples to the list of directories to format if the directory exists.
+if os.path.isdir("samples"):
+ LINT_PATHS.append("samples")
+
+ALL_PYTHON = [
+ "3.10",
+ "3.11",
+ "3.12",
+ "3.13",
+ "3.14",
+]
+
+DEFAULT_PYTHON_VERSION = "3.11"
+
+# TODO(https://github.com/googleapis/gapic-generator-python/issues/2450):
+# Switch this to Python 3.15 alpha1
+# https://peps.python.org/pep-0790/
+PREVIEW_PYTHON_VERSION = "3.14"
+
+CURRENT_DIRECTORY = pathlib.Path(__file__).parent.absolute()
+
+LOWER_BOUND_CONSTRAINTS_FILE = CURRENT_DIRECTORY / "constraints.txt"
+PACKAGE_NAME = "google-cloud-spanner-dbapi-driver"
+
+UNIT_TEST_STANDARD_DEPENDENCIES = [
+ "spannerlib-python",
+ "mock",
+ "asyncmock",
+ "pytest",
+ "pytest-cov",
+ "pytest-asyncio",
+]
+UNIT_TEST_EXTERNAL_DEPENDENCIES: List[str] = []
+UNIT_TEST_LOCAL_DEPENDENCIES: List[str] = []
+UNIT_TEST_DEPENDENCIES: List[str] = []
+UNIT_TEST_EXTRAS: List[str] = []
+UNIT_TEST_EXTRAS_BY_PYTHON: Dict[str, List[str]] = {}
+
+SYSTEM_TEST_PYTHON_VERSIONS: List[str] = ALL_PYTHON
+SYSTEM_TEST_STANDARD_DEPENDENCIES = [
+ "spannerlib-python",
+ "mock",
+ "pytest",
+ "google-cloud-testutils",
+]
+SYSTEM_TEST_EXTERNAL_DEPENDENCIES: List[str] = []
+SYSTEM_TEST_LOCAL_DEPENDENCIES: List[str] = []
+SYSTEM_TEST_DEPENDENCIES: List[str] = []
+SYSTEM_TEST_EXTRAS: List[str] = []
+SYSTEM_TEST_EXTRAS_BY_PYTHON: Dict[str, List[str]] = {}
+
+VERBOSE = False
+MODE = "--verbose" if VERBOSE else "--quiet"
+
+nox.options.sessions = [
+ "unit",
+ "system",
+ "cover",
+ "lint",
+ "lint_setup_py",
+ "docs",
+]
+
+# Error if a python version is missing
+nox.options.error_on_missing_interpreters = True
+
+
+@nox.session(python=ALL_PYTHON)
+def mypy(session):
+ """Run the type checker."""
+ session.install(
+ # TODO(https://github.com/googleapis/gapic-generator-python/issues/2410): Use the latest version of mypy
+ "mypy<1.16.0",
+ "types-requests",
+ "types-protobuf",
+ )
+ session.install(".")
+ session.run(
+ "mypy",
+ "-p",
+ "google",
+ )
+
+
+@nox.session
+def update_lower_bounds(session):
+ """Update lower bounds in constraints.txt to match setup.py"""
+ session.install("google-cloud-testutils")
+ session.install(".")
+
+ session.run(
+ "lower-bound-checker",
+ "update",
+ "--package-name",
+ PACKAGE_NAME,
+ "--constraints-file",
+ str(LOWER_BOUND_CONSTRAINTS_FILE),
+ )
+
+
+@nox.session
+def check_lower_bounds(session):
+ """Check lower bounds in setup.py are reflected in constraints file"""
+ session.install("google-cloud-testutils")
+ session.install(".")
+
+ session.run(
+ "lower-bound-checker",
+ "check",
+ "--package-name",
+ PACKAGE_NAME,
+ "--constraints-file",
+ str(LOWER_BOUND_CONSTRAINTS_FILE),
+ )
+
+
+@nox.session(python=DEFAULT_PYTHON_VERSION)
+def lint(session):
+ """Run linters.
+
+ Returns a failure if the linters find linting errors or sufficiently
+ serious code quality issues.
+ """
+ session.install("flake8", RUFF_VERSION)
+
+ # 2. Check formatting
+ session.run(
+ "ruff",
+ "format",
+ "--check",
+ f"--target-version=py{ALL_PYTHON[0].replace('.', '')}",
+ "--line-length=88",
+ *LINT_PATHS,
+ )
+
+ session.run("flake8", "google", "tests")
+
+
+@nox.session(python=DEFAULT_PYTHON_VERSION)
+def format(session):
+ """
+ Run ruff to sort imports and format code.
+ """
+ # 1. Install ruff (skipped automatically if you run with --no-venv)
+ session.install(RUFF_VERSION)
+
+ # 2. Run Ruff to fix imports
+ # check --select I: Enables strict import sorting
+ # --fix: Applies the changes automatically
+ session.run(
+ "ruff",
+ "check",
+ "--select",
+ "I",
+ "--fix",
+ f"--target-version=py{ALL_PYTHON[0].replace('.', '')}",
+ "--line-length=88", # Standard Black line length
+ *LINT_PATHS,
+ )
+
+ # 3. Run Ruff to format code
+ session.run(
+ "ruff",
+ "format",
+ f"--target-version=py{ALL_PYTHON[0].replace('.', '')}",
+ "--line-length=88", # Standard Black line length
+ *LINT_PATHS,
+ )
+
+
+@nox.session(python=DEFAULT_PYTHON_VERSION)
+def lint_setup_py(session):
+ """Verify that setup.py is valid (including RST check)."""
+ session.install("setuptools", "docutils", "pygments")
+ session.run("python", "setup.py", "check", "--restructuredtext", "--strict")
+
+
+def install_unittest_dependencies(session, *constraints):
+ standard_deps = UNIT_TEST_STANDARD_DEPENDENCIES + UNIT_TEST_DEPENDENCIES
+ session.install(*standard_deps, *constraints)
+
+ if UNIT_TEST_EXTERNAL_DEPENDENCIES:
+ warnings.warn(
+ "'unit_test_external_dependencies' is deprecated. Instead, please "
+ "use 'unit_test_dependencies' or 'unit_test_local_dependencies'.",
+ DeprecationWarning,
+ )
+ session.install(*UNIT_TEST_EXTERNAL_DEPENDENCIES, *constraints)
+
+ if UNIT_TEST_LOCAL_DEPENDENCIES:
+ session.install(*UNIT_TEST_LOCAL_DEPENDENCIES, *constraints)
+
+ if UNIT_TEST_EXTRAS_BY_PYTHON:
+ extras = UNIT_TEST_EXTRAS_BY_PYTHON.get(session.python, [])
+ elif UNIT_TEST_EXTRAS:
+ extras = UNIT_TEST_EXTRAS
+ else:
+ extras = []
+
+ if extras:
+ session.install("-e", f".[{','.join(extras)}]", *constraints)
+ else:
+ session.install("-e", ".", *constraints)
+
+
+@nox.session(python=ALL_PYTHON)
+def unit(session):
+ """Run the unit test suite."""
+
+ constraints_path = str(
+ CURRENT_DIRECTORY / "testing" / f"constraints-{session.python}.txt"
+ )
+ install_unittest_dependencies(session, "-c", constraints_path)
+
+ # Run py.test against the unit tests.
+ session.run(
+ "py.test",
+ MODE,
+ f"--junitxml=unit_{session.python}_sponge_log.xml",
+ "--cov=google",
+ "--cov=tests/unit",
+ "--cov-append",
+ "--cov-config=.coveragerc",
+ "--cov-report=",
+ "--cov-fail-under=0",
+ os.path.join("tests", "unit"),
+ *session.posargs,
+ env={},
+ )
+
+
+def install_systemtest_dependencies(session, *constraints):
+ session.install(*SYSTEM_TEST_STANDARD_DEPENDENCIES, *constraints)
+
+ if SYSTEM_TEST_EXTERNAL_DEPENDENCIES:
+ session.install(*SYSTEM_TEST_EXTERNAL_DEPENDENCIES, *constraints)
+
+ if SYSTEM_TEST_LOCAL_DEPENDENCIES:
+ session.install("-e", *SYSTEM_TEST_LOCAL_DEPENDENCIES, *constraints)
+
+ if SYSTEM_TEST_DEPENDENCIES:
+ session.install("-e", *SYSTEM_TEST_DEPENDENCIES, *constraints)
+
+ if SYSTEM_TEST_EXTRAS_BY_PYTHON:
+ extras = SYSTEM_TEST_EXTRAS_BY_PYTHON.get(session.python, [])
+ elif SYSTEM_TEST_EXTRAS:
+ extras = SYSTEM_TEST_EXTRAS
+ else:
+ extras = []
+
+ if extras:
+ session.install("-e", f".[{','.join(extras)}]", *constraints)
+ else:
+ session.install("-e", ".", *constraints)
+
+
+@nox.session(python=SYSTEM_TEST_PYTHON_VERSIONS)
+def system(session):
+ """Run the system test suite."""
+ constraints_path = str(
+ CURRENT_DIRECTORY / "testing" / f"constraints-{session.python}.txt"
+ )
+ system_test_path = os.path.join("tests", "system.py")
+ system_test_folder_path = os.path.join("tests", "system")
+
+ # Check the value of `RUN_SYSTEM_TESTS` env var. It defaults to true.
+ if os.environ.get("RUN_SYSTEM_TESTS", "true") == "false":
+ session.skip("RUN_SYSTEM_TESTS is set to false, skipping")
+
+ system_test_exists = os.path.exists(system_test_path)
+ system_test_folder_exists = os.path.exists(system_test_folder_path)
+ # Sanity check: only run tests if found.
+ if not system_test_exists and not system_test_folder_exists:
+ session.skip("System tests were not found")
+
+ install_systemtest_dependencies(session, "-c", constraints_path)
+
+ # Run py.test against the system tests.
+ if system_test_exists:
+ session.run(
+ "py.test",
+ MODE,
+ f"--junitxml=system_{session.python}_sponge_log.xml",
+ system_test_path,
+ *session.posargs,
+ )
+ if system_test_folder_exists:
+ session.run(
+ "py.test",
+ MODE,
+ f"--junitxml=system_{session.python}_sponge_log.xml",
+ system_test_folder_path,
+ *session.posargs,
+ )
+
+
+@nox.session(python=DEFAULT_PYTHON_VERSION)
+def cover(session):
+ """Run the final coverage report.
+
+ This outputs the coverage report aggregating coverage from the unit
+ test runs (not system test runs), and then erases coverage data.
+ """
+ session.install("coverage", "pytest-cov")
+ session.run("coverage", "report", "--show-missing", "--fail-under=100")
+
+ session.run("coverage", "erase")
+
+
+@nox.session(python=DEFAULT_PYTHON_VERSION)
+def docs(session):
+ """Build the docs for this library."""
+
+ session.install("-e", ".")
+ session.install(
+ # We need to pin to specific versions of the `sphinxcontrib-*` packages
+ # which still support sphinx 4.x.
+ # See https://github.com/googleapis/sphinx-docfx-yaml/issues/344
+ # and https://github.com/googleapis/sphinx-docfx-yaml/issues/345.
+ "sphinxcontrib-applehelp==1.0.4",
+ "sphinxcontrib-devhelp==1.0.2",
+ "sphinxcontrib-htmlhelp==2.0.1",
+ "sphinxcontrib-qthelp==1.0.3",
+ "sphinxcontrib-serializinghtml==1.1.5",
+ "sphinx==4.5.0",
+ "alabaster",
+ "recommonmark",
+ )
+
+ shutil.rmtree(os.path.join("docs", "_build"), ignore_errors=True)
+ session.run(
+ "sphinx-build",
+ "-W", # warnings as errors
+ "-T", # show full traceback on exception
+ "-N", # no colors
+ "-b",
+ "html", # builder
+ "-d",
+ os.path.join("docs", "_build", "doctrees", ""), # cache directory
+ # paths to build:
+ os.path.join("docs", ""),
+ os.path.join("docs", "_build", "html", ""),
+ )
+
+
+@nox.session(python=DEFAULT_PYTHON_VERSION)
+def docfx(session):
+ """Build the docfx yaml files for this library."""
+
+ session.install("-e", ".")
+ session.install(
+ # We need to pin to specific versions of the `sphinxcontrib-*` packages
+ # which still support sphinx 4.x.
+ # See https://github.com/googleapis/sphinx-docfx-yaml/issues/344
+ # and https://github.com/googleapis/sphinx-docfx-yaml/issues/345.
+ "sphinxcontrib-applehelp==1.0.4",
+ "sphinxcontrib-devhelp==1.0.2",
+ "sphinxcontrib-htmlhelp==2.0.1",
+ "sphinxcontrib-qthelp==1.0.3",
+ "sphinxcontrib-serializinghtml==1.1.5",
+ "gcp-sphinx-docfx-yaml",
+ "alabaster",
+ "recommonmark",
+ )
+
+ shutil.rmtree(os.path.join("docs", "_build"), ignore_errors=True)
+ session.run(
+ "sphinx-build",
+ "-T", # show full traceback on exception
+ "-N", # no colors
+ "-D",
+ (
+ "extensions=sphinx.ext.autodoc,"
+ "sphinx.ext.autosummary,"
+ "docfx_yaml.extension,"
+ "sphinx.ext.intersphinx,"
+ "sphinx.ext.coverage,"
+ "sphinx.ext.napoleon,"
+ "sphinx.ext.todo,"
+ "sphinx.ext.viewcode,"
+ "recommonmark"
+ ),
+ "-b",
+ "html",
+ "-d",
+ os.path.join("docs", "_build", "doctrees", ""),
+ os.path.join("docs", ""),
+ os.path.join("docs", "_build", "html", ""),
+ )
+
+
+@nox.session(python=PREVIEW_PYTHON_VERSION)
+def prerelease_deps(session):
+ """
+ Run all tests with pre-release versions of dependencies installed
+ rather than the standard non pre-release versions.
+ Pre-release versions can be installed using
+ `pip install --pre `.
+ """
+
+ # Install all dependencies
+ session.install("-e", ".")
+
+ # Install dependencies for the unit test environment
+ unit_deps_all = UNIT_TEST_STANDARD_DEPENDENCIES + UNIT_TEST_EXTERNAL_DEPENDENCIES
+ session.install(*unit_deps_all)
+
+ # Install dependencies for the system test environment
+ system_deps_all = (
+ SYSTEM_TEST_STANDARD_DEPENDENCIES
+ + SYSTEM_TEST_EXTERNAL_DEPENDENCIES
+ + SYSTEM_TEST_EXTRAS
+ )
+ session.install(*system_deps_all)
+
+ # Because we test minimum dependency versions on the minimum Python
+ # version, the first version we test with in the unit tests sessions has a
+ # constraints file containing all dependencies and extras.
+ with open(
+ CURRENT_DIRECTORY / "testing" / f"constraints-{ALL_PYTHON[0]}.txt",
+ encoding="utf-8",
+ ) as constraints_file:
+ constraints_text = constraints_file.read()
+
+ # Ignore leading whitespace and comment lines.
+ constraints_deps = [
+ match.group(1)
+ for match in re.finditer(
+ r"^\s*([^#\s=]+)", constraints_text, flags=re.MULTILINE
+ )
+ ]
+
+ # Install dependencies specified in `testing/constraints-X.txt`.
+ session.install(*constraints_deps)
+
+ # Note: If a dependency is added to the `prerel_deps` list,
+ # the `core_dependencies_from_source` list in the `core_deps_from_source`
+ # nox session should also be updated.
+ prerel_deps = [
+ "spannerlib-python",
+ ]
+
+ for dep in prerel_deps:
+ session.install("--pre", "--no-deps", "--ignore-installed", dep)
+ # TODO(https://github.com/grpc/grpc/issues/38965): Add `grpcio-status``
+ # to the dictionary below once this bug is fixed.
+ # TODO(https://github.com/googleapis/google-cloud-python/issues/13643): Add
+ # `googleapis-common-protos` and `grpc-google-iam-v1` to the dictionary below
+ # once this bug is fixed.
+ package_namespaces = {
+ "spannerlib-python": "google.cloud.spannerlib",
+ }
+
+ version_namespace = package_namespaces.get(dep)
+
+ print(f"Installed {dep}")
+ if version_namespace:
+ session.run(
+ "python",
+ "-c",
+ f"import {version_namespace}; print({version_namespace}.__version__)",
+ )
+
+ session.run(
+ "py.test",
+ "tests/unit",
+ env={},
+ )
+
+
+@nox.session(python=DEFAULT_PYTHON_VERSION)
+def core_deps_from_source(session):
+ """Run all tests with core dependencies installed from source
+ rather than pulling the dependencies from PyPI.
+ """
+
+ # Install all dependencies
+ session.install("-e", ".")
+
+ # Install dependencies for the unit test environment
+ unit_deps_all = UNIT_TEST_STANDARD_DEPENDENCIES + UNIT_TEST_EXTERNAL_DEPENDENCIES
+ session.install(*unit_deps_all)
+
+ # Install dependencies for the system test environment
+ system_deps_all = (
+ SYSTEM_TEST_STANDARD_DEPENDENCIES
+ + SYSTEM_TEST_EXTERNAL_DEPENDENCIES
+ + SYSTEM_TEST_EXTRAS
+ )
+ session.install(*system_deps_all)
+
+ # Because we test minimum dependency versions on the minimum Python
+ # version, the first version we test with in the unit tests sessions has a
+ # constraints file containing all dependencies and extras.
+ with open(
+ CURRENT_DIRECTORY / "testing" / f"constraints-{ALL_PYTHON[0]}.txt",
+ encoding="utf-8",
+ ) as constraints_file:
+ constraints_text = constraints_file.read()
+
+ # Ignore leading whitespace and comment lines.
+ constraints_deps = [
+ match.group(1)
+ for match in re.finditer(
+ r"^\s*([^#\s=]+)", constraints_text, flags=re.MULTILINE
+ )
+ ]
+
+ # Install dependencies specified in `testing/constraints-X.txt`.
+ session.install(*constraints_deps)
+
+ # TODO(https://github.com/googleapis/gapic-generator-python/issues/2358): `grpcio` and
+ # `grpcio-status` should be added to the list below so that they are installed from source,
+ # rather than PyPI.
+ # TODO(https://github.com/googleapis/gapic-generator-python/issues/2357): `protobuf` should be
+ # added to the list below so that it is installed from source, rather than PyPI
+ # Note: If a dependency is added to the `core_dependencies_from_source` list,
+ # the `prerel_deps` list in the `prerelease_deps` nox session should also be updated.
+ core_dependencies_from_source = []
+
+ for dep in core_dependencies_from_source:
+ session.install(dep, "--no-deps", "--ignore-installed")
+ print(f"Installed {dep}")
+
+ session.run(
+ "py.test",
+ "tests/unit",
+ env={},
+ )
+
+
+@nox.session
+def build(session):
+ """
+ Builds the wheel.
+ """
+ if os.path.exists("dist"):
+ shutil.rmtree("dist")
+
+ # Install build dependencies
+ session.install("build", "twine")
+
+ # Build the wheel
+ session.log("Building...")
+ session.run("python", "-m", "build")
+
+ # Check the built artifacts with twine
+ session.log("Checking artifacts with twine...")
+ artifacts = glob.glob("dist/*")
+ if not artifacts:
+ session.error("No built artifacts found in dist/ to check.")
+
+ session.run("twine", "check", *artifacts)
+
+
+@nox.session
+def install(session):
+ """
+ Install locally
+ """
+ session.install("-e", ".")
diff --git a/packages/google-cloud-spanner-dbapi-driver/setup.py b/packages/google-cloud-spanner-dbapi-driver/setup.py
new file mode 100644
index 000000000000..cfc0b06a229b
--- /dev/null
+++ b/packages/google-cloud-spanner-dbapi-driver/setup.py
@@ -0,0 +1,83 @@
+# -*- coding: utf-8 -*-
+# Copyright 2025 Google LLC
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+import io
+import os
+import re
+
+import setuptools # type: ignore
+
+package_root = os.path.abspath(os.path.dirname(__file__))
+
+name = "google-cloud-spanner-dbapi-driver"
+
+description = "Google Cloud Spanner DBAPI 2.0 Driver"
+
+version = None
+
+with open(os.path.join(package_root, "google/cloud/spanner_driver/version.py")) as fp:
+ version_candidates = re.findall(r"__version__\s*=\s*\"([^\"]+)\"", fp.read())
+ assert len(version_candidates) == 1
+ version = version_candidates[0]
+
+release_status = "Development Status :: 1 - Planning"
+
+dependencies = [
+ "spannerlib-python",
+]
+extras = {}
+url = "https://github.com/googleapis/google-cloud-python/tree/main/packages/google-cloud-spanner-dbapi-driver"
+
+readme_filename = os.path.join(package_root, "README.rst")
+with io.open(readme_filename, encoding="utf-8") as readme_file:
+ readme = readme_file.read()
+
+packages = [
+ package
+ for package in setuptools.find_namespace_packages()
+ if package.startswith("google")
+]
+
+setuptools.setup(
+ name=name,
+ version=version,
+ description=description,
+ long_description=readme,
+ author="Google LLC",
+ author_email="googleapis-packages@google.com",
+ license="Apache 2.0",
+ url=url,
+ classifiers=[
+ release_status,
+ "Intended Audience :: Developers",
+ "License :: OSI Approved :: Apache Software License",
+ "Programming Language :: Python",
+ "Programming Language :: Python :: 3",
+ "Programming Language :: Python :: 3.10",
+ "Programming Language :: Python :: 3.11",
+ "Programming Language :: Python :: 3.12",
+ "Programming Language :: Python :: 3.13",
+ "Programming Language :: Python :: 3.14",
+ "Operating System :: OS Independent",
+ "Topic :: Database",
+ ],
+ platforms="Posix; MacOS X; Windows",
+ packages=packages,
+ python_requires=">=3.10",
+ install_requires=dependencies,
+ extras_require=extras,
+ include_package_data=True,
+ zip_safe=False,
+)
diff --git a/packages/google-cloud-spanner-dbapi-driver/testing/constraints-3.10.txt b/packages/google-cloud-spanner-dbapi-driver/testing/constraints-3.10.txt
new file mode 100644
index 000000000000..2d4c01d5696a
--- /dev/null
+++ b/packages/google-cloud-spanner-dbapi-driver/testing/constraints-3.10.txt
@@ -0,0 +1,4 @@
+# -*- coding: utf-8 -*-
+# This constraints file is required for unit tests.
+# List all library dependencies and extras in this file.
+spannerlib-python
diff --git a/packages/google-cloud-spanner-dbapi-driver/testing/constraints-3.11.txt b/packages/google-cloud-spanner-dbapi-driver/testing/constraints-3.11.txt
new file mode 100644
index 000000000000..2d4c01d5696a
--- /dev/null
+++ b/packages/google-cloud-spanner-dbapi-driver/testing/constraints-3.11.txt
@@ -0,0 +1,4 @@
+# -*- coding: utf-8 -*-
+# This constraints file is required for unit tests.
+# List all library dependencies and extras in this file.
+spannerlib-python
diff --git a/packages/google-cloud-spanner-dbapi-driver/testing/constraints-3.12.txt b/packages/google-cloud-spanner-dbapi-driver/testing/constraints-3.12.txt
new file mode 100644
index 000000000000..2d4c01d5696a
--- /dev/null
+++ b/packages/google-cloud-spanner-dbapi-driver/testing/constraints-3.12.txt
@@ -0,0 +1,4 @@
+# -*- coding: utf-8 -*-
+# This constraints file is required for unit tests.
+# List all library dependencies and extras in this file.
+spannerlib-python
diff --git a/packages/google-cloud-spanner-dbapi-driver/testing/constraints-3.13.txt b/packages/google-cloud-spanner-dbapi-driver/testing/constraints-3.13.txt
new file mode 100644
index 000000000000..2d4c01d5696a
--- /dev/null
+++ b/packages/google-cloud-spanner-dbapi-driver/testing/constraints-3.13.txt
@@ -0,0 +1,4 @@
+# -*- coding: utf-8 -*-
+# This constraints file is required for unit tests.
+# List all library dependencies and extras in this file.
+spannerlib-python
diff --git a/packages/google-cloud-spanner-dbapi-driver/testing/constraints-3.14.txt b/packages/google-cloud-spanner-dbapi-driver/testing/constraints-3.14.txt
new file mode 100644
index 000000000000..2d4c01d5696a
--- /dev/null
+++ b/packages/google-cloud-spanner-dbapi-driver/testing/constraints-3.14.txt
@@ -0,0 +1,4 @@
+# -*- coding: utf-8 -*-
+# This constraints file is required for unit tests.
+# List all library dependencies and extras in this file.
+spannerlib-python
diff --git a/packages/google-cloud-spanner-dbapi-driver/tests/__init__.py b/packages/google-cloud-spanner-dbapi-driver/tests/__init__.py
new file mode 100644
index 000000000000..aeaeaa42f43f
--- /dev/null
+++ b/packages/google-cloud-spanner-dbapi-driver/tests/__init__.py
@@ -0,0 +1,15 @@
+# Copyright 2026 Google LLC
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+# This file is intentionally left blank to mark this directory as a package.
diff --git a/packages/google-cloud-spanner-dbapi-driver/tests/system/__init__.py b/packages/google-cloud-spanner-dbapi-driver/tests/system/__init__.py
new file mode 100644
index 000000000000..aeaeaa42f43f
--- /dev/null
+++ b/packages/google-cloud-spanner-dbapi-driver/tests/system/__init__.py
@@ -0,0 +1,15 @@
+# Copyright 2026 Google LLC
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+# This file is intentionally left blank to mark this directory as a package.
diff --git a/packages/google-cloud-spanner-dbapi-driver/tests/system/test_placeholder.py b/packages/google-cloud-spanner-dbapi-driver/tests/system/test_placeholder.py
new file mode 100644
index 000000000000..f099f454e2b2
--- /dev/null
+++ b/packages/google-cloud-spanner-dbapi-driver/tests/system/test_placeholder.py
@@ -0,0 +1,18 @@
+# Copyright 2026 Google LLC
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+
+class TestPlaceholder:
+ def test_placeholder(self):
+ assert True
diff --git a/packages/google-cloud-spanner-dbapi-driver/tests/unit/__init__.py b/packages/google-cloud-spanner-dbapi-driver/tests/unit/__init__.py
new file mode 100644
index 000000000000..aeaeaa42f43f
--- /dev/null
+++ b/packages/google-cloud-spanner-dbapi-driver/tests/unit/__init__.py
@@ -0,0 +1,15 @@
+# Copyright 2026 Google LLC
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+# This file is intentionally left blank to mark this directory as a package.
diff --git a/packages/google-cloud-spanner-dbapi-driver/tests/unit/test_placeholder.py b/packages/google-cloud-spanner-dbapi-driver/tests/unit/test_placeholder.py
new file mode 100644
index 000000000000..f099f454e2b2
--- /dev/null
+++ b/packages/google-cloud-spanner-dbapi-driver/tests/unit/test_placeholder.py
@@ -0,0 +1,18 @@
+# Copyright 2026 Google LLC
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+
+class TestPlaceholder:
+ def test_placeholder(self):
+ assert True