New level of functionality and performance in data access via Python
Project description
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.
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.1
- Added support for Python 3.14
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distributions
Built Distributions
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file devart_googlesheets_connector-1.1.0-cp314-cp314-win_amd64.whl.
File metadata
- Download URL: devart_googlesheets_connector-1.1.0-cp314-cp314-win_amd64.whl
- Upload date:
- Size: 5.6 MB
- Tags: CPython 3.14, Windows x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.11.4
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
d82217a8a2a3a84ed6a40d5de4b1a02706231d388d5f36afe292e71fd2e95b9f
|
|
| MD5 |
b7f1c47e0e9869c4a06eaa44cea2fac9
|
|
| BLAKE2b-256 |
c1168881883b067e4c2f83f94a948703ef1af61b99ef1c7cdf7c71e2fa10e51e
|
File details
Details for the file devart_googlesheets_connector-1.1.0-cp314-cp314-win32.whl.
File metadata
- Download URL: devart_googlesheets_connector-1.1.0-cp314-cp314-win32.whl
- Upload date:
- Size: 5.3 MB
- Tags: CPython 3.14, Windows x86
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.11.4
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
4d68a5bdd368f3e4d34793372e047ad3415f6afb27a946413618f56ce5cff028
|
|
| MD5 |
c792ea4a2110757d2cfea1b85ae35a93
|
|
| BLAKE2b-256 |
41a39850e58ff79265a1b8cfae43433b79f82cacb641beb062271929ce8137d6
|
File details
Details for the file devart_googlesheets_connector-1.1.0-cp313-cp313-win_amd64.whl.
File metadata
- Download URL: devart_googlesheets_connector-1.1.0-cp313-cp313-win_amd64.whl
- Upload date:
- Size: 5.5 MB
- Tags: CPython 3.13, Windows x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.11.4
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
0c73ed57ad82303bbf9b4a0ce13e406576da4fd2e7d7f90a30b9b7af93687514
|
|
| MD5 |
31bc56f8baac984db6f184c1dae612bb
|
|
| BLAKE2b-256 |
3a1d9d6cce8224fab1c816805f05e3079449a81b96e12c064b3ba80223993394
|
File details
Details for the file devart_googlesheets_connector-1.1.0-cp313-cp313-win32.whl.
File metadata
- Download URL: devart_googlesheets_connector-1.1.0-cp313-cp313-win32.whl
- Upload date:
- Size: 5.3 MB
- Tags: CPython 3.13, Windows x86
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.11.4
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
214dbe4a0322b74a2b5155c31b7fcdef802cea245c7e53a9500d3a71f7d97a21
|
|
| MD5 |
92de87d5efab47921c07e1c9d946cc75
|
|
| BLAKE2b-256 |
2a358c5b174823f3a12745aa38fbc913ba892ec09ea184746bef1484713616ae
|
File details
Details for the file devart_googlesheets_connector-1.1.0-cp312-cp312-win_amd64.whl.
File metadata
- Download URL: devart_googlesheets_connector-1.1.0-cp312-cp312-win_amd64.whl
- Upload date:
- Size: 5.5 MB
- Tags: CPython 3.12, Windows x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.11.4
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
f8556759b2c713debd39abf023d9f6b96df9da372b7102fa710f0c3877fd0321
|
|
| MD5 |
e6afec640946a42f6e358363c1812041
|
|
| BLAKE2b-256 |
34b12138150ab0b0c43f5ca7bf4e8a3ed65ed965572f9430c5a58a27d95937c1
|
File details
Details for the file devart_googlesheets_connector-1.1.0-cp312-cp312-win32.whl.
File metadata
- Download URL: devart_googlesheets_connector-1.1.0-cp312-cp312-win32.whl
- Upload date:
- Size: 5.3 MB
- Tags: CPython 3.12, Windows x86
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.11.4
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
71c1ab09c1d7e88069e29212adbec0054993a1e89b93be8d3925edaa56c82490
|
|
| MD5 |
e75c415505a59927859c9d367184756c
|
|
| BLAKE2b-256 |
cf7dc1d97350cd845e08a85509b5f9608e3fc5af8e4c940a41e1d0b440a0b7df
|
File details
Details for the file devart_googlesheets_connector-1.1.0-cp311-cp311-win_amd64.whl.
File metadata
- Download URL: devart_googlesheets_connector-1.1.0-cp311-cp311-win_amd64.whl
- Upload date:
- Size: 5.5 MB
- Tags: CPython 3.11, Windows x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.11.4
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
53332281e5c67febd5413c103650decd6b20b6a398f416d025c1d5d33f9e44bf
|
|
| MD5 |
991c62ea29f0530e5092a65bc8b4d22e
|
|
| BLAKE2b-256 |
aac495590df4de2744b27ee1b10b219a4dd6d1c5afd7dac49593c8443fd967f4
|
File details
Details for the file devart_googlesheets_connector-1.1.0-cp311-cp311-win32.whl.
File metadata
- Download URL: devart_googlesheets_connector-1.1.0-cp311-cp311-win32.whl
- Upload date:
- Size: 5.3 MB
- Tags: CPython 3.11, Windows x86
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.11.4
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
88b38cdd26a1d77a282f57bd42c8b9373d282db8f8ad1414856c6719372d7c7b
|
|
| MD5 |
830b6cdc6b008b65a68f171ebebd3e8b
|
|
| BLAKE2b-256 |
cfa2f2f388f320df7c3e5985955a321940535cebd01216fc4832a7d063a65ac2
|
File details
Details for the file devart_googlesheets_connector-1.1.0-cp310-cp310-win_amd64.whl.
File metadata
- Download URL: devart_googlesheets_connector-1.1.0-cp310-cp310-win_amd64.whl
- Upload date:
- Size: 5.5 MB
- Tags: CPython 3.10, Windows x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.11.4
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
f08c464264d6af2ebe0fb85bfcb6349b9463170dbb84e459004b5acbdd1e60cf
|
|
| MD5 |
38e6ff3b92741357d223c92bc3d51edd
|
|
| BLAKE2b-256 |
77fc336b003cda31ee36c8e7f66ac081d45163c053abebadf237a0d182933cc4
|
File details
Details for the file devart_googlesheets_connector-1.1.0-cp310-cp310-win32.whl.
File metadata
- Download URL: devart_googlesheets_connector-1.1.0-cp310-cp310-win32.whl
- Upload date:
- Size: 5.3 MB
- Tags: CPython 3.10, Windows x86
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.11.4
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
0dc51a65f9a4f17fff6d63118c49095e59eecbcd57b542fdda86c0942e8a8be1
|
|
| MD5 |
b83ba1fdd82f62267e84600971f98d95
|
|
| BLAKE2b-256 |
339965fd8eb6cf26b4627e571f6a102aaccceae94f83d0f64dc388bb8cd4c4e5
|
File details
Details for the file devart_googlesheets_connector-1.1.0-cp39-cp39-win_amd64.whl.
File metadata
- Download URL: devart_googlesheets_connector-1.1.0-cp39-cp39-win_amd64.whl
- Upload date:
- Size: 5.5 MB
- Tags: CPython 3.9, Windows x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.11.4
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
95ccdc0c80b68ff3a1ab61c66805d4a8d8cbec0907964d75a3ebec80b0d4dd20
|
|
| MD5 |
2c2e1fb3c147b05b5c62b8819c208c51
|
|
| BLAKE2b-256 |
64e1c8bdae3e18880084e93c6ee0e9b232e2057906099f3aaef31b67e8f462a0
|
File details
Details for the file devart_googlesheets_connector-1.1.0-cp39-cp39-win32.whl.
File metadata
- Download URL: devart_googlesheets_connector-1.1.0-cp39-cp39-win32.whl
- Upload date:
- Size: 5.3 MB
- Tags: CPython 3.9, Windows x86
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.11.4
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
e3914934014d915ab0cad14c4151f6836c74404a791205a5c8448ec15bdb01ee
|
|
| MD5 |
a789731288e45829754244414360c059
|
|
| BLAKE2b-256 |
d4e2e7efbe757a388afedc283227457bcb5b68fbe9fdfaa7c9f4605e00e6be75
|
File details
Details for the file devart_googlesheets_connector-1.1.0-cp38-cp38-win_amd64.whl.
File metadata
- Download URL: devart_googlesheets_connector-1.1.0-cp38-cp38-win_amd64.whl
- Upload date:
- Size: 5.5 MB
- Tags: CPython 3.8, Windows x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.11.4
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
30995a993e5210357668b5b2d04879bb43b41dcbac51bfad824feeec1400d08d
|
|
| MD5 |
e8fd380b7c26d26aa37cf77383fdb6fd
|
|
| BLAKE2b-256 |
ae653735b4fe8eba723f5267e223156ad5bb8c4249a451a649d41ddc757d4344
|
File details
Details for the file devart_googlesheets_connector-1.1.0-cp38-cp38-win32.whl.
File metadata
- Download URL: devart_googlesheets_connector-1.1.0-cp38-cp38-win32.whl
- Upload date:
- Size: 5.3 MB
- Tags: CPython 3.8, Windows x86
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.11.4
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
252270ed19f3a55937eb6aa53e91345c3288a6a3306559ded129db78682e392d
|
|
| MD5 |
1f181b281159bb79de75eb721f76ae57
|
|
| BLAKE2b-256 |
898d7f8389117d1dd15ca7fb22a78eb069631c059faebfad0f391145bd64a745
|
File details
Details for the file devart_googlesheets_connector-1.1.0-cp37-cp37m-win_amd64.whl.
File metadata
- Download URL: devart_googlesheets_connector-1.1.0-cp37-cp37m-win_amd64.whl
- Upload date:
- Size: 5.5 MB
- Tags: CPython 3.7m, Windows x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.11.4
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
a6c466e11d9db5766a6ea9810c35624e55270ea2f1a5ee136555ae3ed2aeb4dc
|
|
| MD5 |
b38d404de8cefd6c6568efbbd8df9f5e
|
|
| BLAKE2b-256 |
72e50890423d9afa922ccad5ed34aea7054d3f9a5c194db68c8bf758d77377d1
|
File details
Details for the file devart_googlesheets_connector-1.1.0-cp37-cp37m-win32.whl.
File metadata
- Download URL: devart_googlesheets_connector-1.1.0-cp37-cp37m-win32.whl
- Upload date:
- Size: 5.3 MB
- Tags: CPython 3.7m, Windows x86
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.11.4
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
bdee79744eec88365681ecfd5ea1f50127bd0d278e8b8bd8e45f08d0c4521986
|
|
| MD5 |
9110388be4f87e3cc0972d5c69af3b1b
|
|
| BLAKE2b-256 |
5b54d4b28de0ac1df39e789995d1efab14187921f2aa6c0f443b585332630a1a
|