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.

Installation:

pip install oauth2client
pip install pyopenssl

3.4.2. 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
  -h, --help              Show this message and exit.

3.4.3. Example

$ sqlitebiter gs credentials-xxxxxxxxxxxx.json samplebook -o sample.sqlite
convert 'samplebook' to 'sheet3' table
convert 'samplebook' to 'sheet1' table
$ ls sample.sqlite
sample.sqlite