3.4. Create a SQLite database from Google Sheets

sqlitebiter gs is a subcommand to convert Google Sheets to a SQLite database file.

3.4.1. Requirements

Following python packages are required to use Google Sheets feature.

Dependency Python package installation:

pip install oauth2client
pip install pyopenssl

3.4.2. Example

$ sqlitebiter gs credentials-xxxxxxxxxxxx.json samplebook -o sample.sqlite
[INFO] sqlitebiter gs: convert 'google sheets' to 'sheet3' table
[INFO] sqlitebiter gs: convert 'google sheets' to 'sheet1' table
$ sqlite3 sample.sqlite
$ sqlite> .schema
CREATE TABLE 'sheet3' (a INTEGER, b REAL, c TEXT);
CREATE TABLE 'sheet1' (a INTEGER, b REAL, c TEXT);

3.4.3. sqlitebiter gs subcommand help

Usage: sqlitebiter gs [OPTIONS] CREDENTIALS TITLE

  Convert a spreadsheet in Google Sheets to a SQLite database file.

  CREDENTIALS: OAuth2 Google credentials file. TITLE: Title of the Google
  Sheets to convert.

Options:
  -o, --output-path PATH  Output path of the SQLite database file. Defaults to
                          'out.sqlite'.
  -h, --help              Show this message and exit.