Skip to main content

Export google spreadsheet to csv, you can filter data with SQL statement.

Project description

googlesheets2csv

Export google spreadsheet to csv, you can filter data with SQL statement.

Installation

pip install googlesheets2csv

Development

git clone https://github.com/YuChunTsao/googlesheets2csv.git

cd googlesheets2csv

pip install -e .

How to get credential json?

  1. Create Google Cloud project.
  2. Enable "Google Sheets API" and "Google Drive API".
  3. Go to "APIs & Services > Credentials" and choose "CREATE CREDENTIALS > Service account".
  4. Fill out the form and click "Create" and "Done".
  5. Go to "IAM & Admin > Service Accounts > Keys" and click "ADD KEY > Create new key".
  6. Select JSON key type and press "Create". (The file will be downloaded automatically.)

CLI usage

usage: googlesheets2csv [-h] [-v] -c  -sn  -wn  [-sql] output

Export google spreadsheet to csv, you can filter data with SQL statement.

positional arguments:
  output                Output csv file path

options:
  -h, --help            show this help message and exit
  -v, --version         show program's version number and exit
  -c, --credential_file 
                        Google Cloud service account JSON file with credentials
  -sn, --spreadsheet_name 
                        spreadsheet name which you want to access
  -wn, --worksheet_name 
                        worksheet name which you want to access
  -sql                  You can filter data with SQL statement. (default "SELECT * FROM your_worksheet_name")

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

googlesheets2csv-0.1.0.tar.gz (4.2 kB view hashes)

Uploaded Source

Built Distribution

googlesheets2csv-0.1.0-py3-none-any.whl (5.5 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page