Python Connector for Google Sheets
Python Connector for Google Sheets is a connectivity solution for accessing Google Sheets Customer Engagement from Python applications to read and update data. It fully implements the Python DB API 2.0 specification. The connector is distributed as a wheel package for Windows and Windows Server.
Standard SQL syntax
The connector fully supports the ANSI SQL standard and lets you execute SQL statements against your Google Sheets data just like you would normally work with relational databases. Simple queries are directly converted to Google Sheets API calls and executed on the Google Sheets side. Complex queries are transformed into simpler queries, which are then converted to Google Sheets API calls. The embedded SQL engine then processes the results in the local cache and applies advanced SQL features from the original complex query.
Connecting
To establish a connection to Google Sheets, import the connector and use
the connect() method with your connection parameters.
Import the connector
First, import the Google Sheets connector module:
import devart.googlesheets as googlesheets
Establish a connection
Call the connect() method and obtain a connection object.
response = googlesheets.signin()
my_spreadsheet = googlesheets.getspreadsheet("RefreshToken=" + response["Refresh Token"])
my_connection = googlesheets.connect(
SpreadsheetId=my_spreadsheet["Spreadsheet Id"]
RefreshToken=response["Refresh Token"]
)
Replace the example values with your actual connection values.
Querying data
Once connected to Google Sheets, you can execute SQL queries to retrieve data from your spreadsheets.
Execute a query
Create a cursor object using the cursor() connection method.
my_cursor = my_connection.cursor()
Execute a SQL query using the execute() cursor method.
my_cursor.execute("SELECT * FROM Company")
Retrieve results using one of the fetch*() methods.
for row in my_cursor.fetchall():
print(row)
Parameterized queries
You can use parameterized queries to pass variable values to your SQL statements. This allows you to reuse the same query with different data and helps to prevent SQL injection attacks.
Pass parameters as a list or tuple to the execute() method:
query = "SELECT Id, Name FROM Contact WHERE Name = ? AND Email = ?"
params = ["Jordan Sanders", "jordansanders@example.com"]
my_cursor.execute(query, params)
results = my_cursor.fetchall()
for row in results:
print(row)
Each placeholder ? in the query is replaced with a corresponding value from the parameter list.
Ordering and activating the license
You can purchase a license for the connector on the ordering page:
https://www.devart.com/python/googlesheets/ordering.html
To activate the license, follow the instructions in the documentation:
https://docs.devart.com/python/googlesheets/activate-a-license.htm
What's new
Python Connector for Google Sheets 1.2
- Added support for Python 3.15
Metadata
Release files for devart-googlesheets-connector 1.2.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Built distributions (wheels)
Total release size: 65.3 MB
Release files / devart_googlesheets_connector-1.2.0-cp315-cp315-win_amd64.whl
| Download URL | devart_googlesheets_connector-1.2.0-cp315-cp315-win_amd64.whl |
|---|---|
| Size | 5.6 MB |
| Tags | CPython 3.15 Windows x86-64 |
|
SHA-256 checksum How to use checksums |
493a591422bfa55fa8c5ae78f80ae8a66bf0ed7ab01bc313d63b9ea7a753292e
|
|
BLAKE2b-256 checksum How to use checksums |
22959d73c1ddae6515daa44ba81994ea5b015da89afe4a0fb59dafac9f8c25dd
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.11.4
|
Release files / devart_googlesheets_connector-1.2.0-cp315-cp315-win32.whl
| Download URL | devart_googlesheets_connector-1.2.0-cp315-cp315-win32.whl |
|---|---|
| Size | 5.3 MB |
| Tags | CPython 3.15 Windows x86-32 |
|
SHA-256 checksum How to use checksums |
d4303308977ccfe0e1107c8d53ce15efc7fcdd54efbad472e1cf5cb43f4ee638
|
|
BLAKE2b-256 checksum How to use checksums |
0c0f0bd968dc3b55081ce67c940968ccc842b20bbb7c2b7812dd4db9c2b67a78
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.11.4
|
Release files / devart_googlesheets_connector-1.2.0-cp314-cp314-win_amd64.whl
| Download URL | devart_googlesheets_connector-1.2.0-cp314-cp314-win_amd64.whl |
|---|---|
| Size | 5.6 MB |
| Tags | CPython 3.14 Windows x86-64 |
|
SHA-256 checksum How to use checksums |
232fb589dafb7caae3c2503575b40fb0bf548c5e872ad3256fb5f01468b8e174
|
|
BLAKE2b-256 checksum How to use checksums |
b6ff1de362dd74ecadba6c419b5b0fe2c0c97689f934e265e3b08d9ad39e1da6
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.11.4
|
Release files / devart_googlesheets_connector-1.2.0-cp314-cp314-win32.whl
| Download URL | devart_googlesheets_connector-1.2.0-cp314-cp314-win32.whl |
|---|---|
| Size | 5.3 MB |
| Tags | CPython 3.14 Windows x86-32 |
|
SHA-256 checksum How to use checksums |
826d3de34aa303b10d4ad1d83422ff37d6b993485eac081fff79d7e57d501a1f
|
|
BLAKE2b-256 checksum How to use checksums |
3cec2b3b4e4fff019cb9a8be14f0c98de0a5cd406d804a66bf45d8fa1e22e8b8
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.11.4
|
Release files / devart_googlesheets_connector-1.2.0-cp313-cp313-win_amd64.whl
| Download URL | devart_googlesheets_connector-1.2.0-cp313-cp313-win_amd64.whl |
|---|---|
| Size | 5.6 MB |
| Tags | CPython 3.13 Windows x86-64 |
|
SHA-256 checksum How to use checksums |
ea6b3ae8e56478540a6f62a2fdc1d96786ed22054af00199f4c5169af0e1d19f
|
|
BLAKE2b-256 checksum How to use checksums |
e29a04c4a6791aa7820745312a20662417aca147280431b736d6579407590333
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.11.4
|
Release files / devart_googlesheets_connector-1.2.0-cp313-cp313-win32.whl
| Download URL | devart_googlesheets_connector-1.2.0-cp313-cp313-win32.whl |
|---|---|
| Size | 5.3 MB |
| Tags | CPython 3.13 Windows x86-32 |
|
SHA-256 checksum How to use checksums |
33e450bbf48971940c50417e6c33f380b72196afb6df32578d4d8599e89c7667
|
|
BLAKE2b-256 checksum How to use checksums |
e80be4b6bbd48069d776af3e438b10193921814ff95476d50fabafc78eb9ac47
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.11.4
|
Release files / devart_googlesheets_connector-1.2.0-cp312-cp312-win_amd64.whl
| Download URL | devart_googlesheets_connector-1.2.0-cp312-cp312-win_amd64.whl |
|---|---|
| Size | 5.6 MB |
| Tags | CPython 3.12 Windows x86-64 |
|
SHA-256 checksum How to use checksums |
8c05e94cd7e10a7601de1a9b9bb220c9d62c16cb7191138711df07d472316da3
|
|
BLAKE2b-256 checksum How to use checksums |
07ab8f1f70839ef9d32243b7e16af4a06256e0f538836509a1d12645c8f78da0
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.11.4
|
Release files / devart_googlesheets_connector-1.2.0-cp312-cp312-win32.whl
| Download URL | devart_googlesheets_connector-1.2.0-cp312-cp312-win32.whl |
|---|---|
| Size | 5.3 MB |
| Tags | CPython 3.12 Windows x86-32 |
|
SHA-256 checksum How to use checksums |
b8633674def3717aa5b57a4f5b43ecd806735562c0d2259c7be0021f322bd0b8
|
|
BLAKE2b-256 checksum How to use checksums |
78f014d9fc62d02f96b017432c476f21b232fbf325562e1871905501a8d1100d
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.11.4
|
Release files / devart_googlesheets_connector-1.2.0-cp311-cp311-win_amd64.whl
| Download URL | devart_googlesheets_connector-1.2.0-cp311-cp311-win_amd64.whl |
|---|---|
| Size | 5.6 MB |
| Tags | CPython 3.11 Windows x86-64 |
|
SHA-256 checksum How to use checksums |
ac46af0ea96fa01a9fd6e74d63a212372301f0573d1562a73eab3dd72ddda4f8
|
|
BLAKE2b-256 checksum How to use checksums |
79477493f4a037262e1fc889e8a167913848d225134fe620885a8443025ff33e
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.11.4
|
Release files / devart_googlesheets_connector-1.2.0-cp311-cp311-win32.whl
| Download URL | devart_googlesheets_connector-1.2.0-cp311-cp311-win32.whl |
|---|---|
| Size | 5.3 MB |
| Tags | CPython 3.11 Windows x86-32 |
|
SHA-256 checksum How to use checksums |
07883a3b2cf8e01bb1af5f144a395eb5a0d27b65e84074626dbb4158323af663
|
|
BLAKE2b-256 checksum How to use checksums |
635a4e84026ac483993bb781bab2a2bec3162f6535ac43c7659f919db097372d
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.11.4
|
Release files / devart_googlesheets_connector-1.2.0-cp310-cp310-win_amd64.whl
| Download URL | devart_googlesheets_connector-1.2.0-cp310-cp310-win_amd64.whl |
|---|---|
| Size | 5.6 MB |
| Tags | CPython 3.10 Windows x86-64 |
|
SHA-256 checksum How to use checksums |
77736fcda567eebe628df3e5e48c9d5667dcd324a55c11b38270ebbdeb193bb7
|
|
BLAKE2b-256 checksum How to use checksums |
f0a87b2651932fa55e87ba5aa800fd96ca77ac9c070789a8eac9b766c2bd1f51
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.11.4
|
Release files / devart_googlesheets_connector-1.2.0-cp310-cp310-win32.whl
| Download URL | devart_googlesheets_connector-1.2.0-cp310-cp310-win32.whl |
|---|---|
| Size | 5.3 MB |
| Tags | CPython 3.10 Windows x86-32 |
|
SHA-256 checksum How to use checksums |
ac24f3afe723cbebcf5cb1d06c882ab3e293575651378e2f6c10f92be3ded1fc
|
|
BLAKE2b-256 checksum How to use checksums |
b8dd734aa6f986b50a2b311b96d251de78dcbeeb3eb31f4ed42472668903ce75
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.11.4
|
Security for devart-googlesheets-connector 1.2.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.