Google Spreadsheets FDW
Multicorn based PostgreSQL foreign data wrapper for Google Spreadsheets
Installation
Requirements
PostgreSQL 9.1+ with Multicorn extension installed.
If you haven't used Multicorn yet, enable it with:
create extension multicorn;
From source:
git clone https://github.com/TheDeadJoe/google_spreadsheets_fdw
cd google_spreadsheets_fdw
python setup.py install
Usage
create server multicorn_srv foreign data wrapper multicorn options (
wrapper 'google_spreadsheets_fdw.GoogleSpreadsheetFDW'
);
create foreign table my_table (
id int default nextval('my_seq'),
foo varchar,
bar int,
baz float
) server multicorn_srv options (
gskey 'zVshdGDuaQKKaQoXqNOwjeTWcxcUtOlSJDZoLeIMUsYx',
keyfile '/path/to/credentials.json',
sheet '0',
row_id 'id'
);
Options
gskey- "ID" of a spreadsheet (the 44 char length part between/spreadsheets/d/and/edit/from spreadsheet URL)keyfile- path to Google Cloud Services credentials json filesheet- index of a sheetrow_id- name of the column which value will be treated as an ID of the whole row
Example
We start with an empty spreadsheet:
Let's insert some data into it:
insert into my_table(foo, bar, baz) values ('a', 1, 0.1);
insert into my_table(foo, bar, baz) values ('b', 2, 0.2);
insert into my_table(foo, bar, baz) values ('c', 3, 0.3);
insert into my_table(baz, bar, foo) values (0.4, 4, 'd') returning *;
Spreadsheet contains our data.
Now let's try retrieve the data:
select * from my_table;
The result:
Of course, we can also perform other SQL operations e.g.:
update my_table set bar = 9, baz = 0.9 where bar = 2;
delete from my_table where bar > 5;
Metadata
Release files for google-spreadsheets-fdw 1.0.3
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| google_spreadsheets_fdw-1.0.3.tar.gz | 4.9 kB | Without provenance | Details for google_spreadsheets_fdw-1.0.3.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| google_spreadsheets_fdw-1.0.3-py3-none-any.whl | Python 3 | none | any | Details for google_spreadsheets_fdw-1.0.3-py3-none-any.whl |
Total release size: 10.2 kB
Release files / google_spreadsheets_fdw-1.0.3.tar.gz
| Download URL | google_spreadsheets_fdw-1.0.3.tar.gz |
|---|---|
| Size | 4.9 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
a953a10ec5f384f09368103700fd5ed22fb2eb3c2017fb2d48009bdafa755924
|
|
BLAKE2b-256 checksum How to use checksums |
38aaac57a4db5467ab518a4515045e3bb6ad7c1185c6c59201cefa75535121c3
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/5.1.0 CPython/3.12.3
|
Release files / google_spreadsheets_fdw-1.0.3-py3-none-any.whl
| Download URL | google_spreadsheets_fdw-1.0.3-py3-none-any.whl |
|---|---|
| Size | 5.3 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
80a91d303f99dc10b7cb3c593b1ca535b88f00c86cf6d45a4635e16b175370f3
|
|
BLAKE2b-256 checksum How to use checksums |
b3b6ead91f7b25cfa1aa439bbdb597e7a8af64446ac3518f26a010a53654dc5f
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/5.1.0 CPython/3.12.3
|
Security for google-spreadsheets-fdw 1.0.3
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.