[PYTHON] Easy analysis sharing with re: dash, an open source data visualization tool Part 3 ~ Google Spreadsheets

Until the last time, it was connected to MySQL, but this time I will connect it to Google Spreadsheets

How Google Spreadsheets can be handled with re: dash

There is a document in here, but in re: dash from Google Spreadsheets using python modules gspread and oauth2client I'm getting the data.

Procedure outline

  1. Create a project in Google Developer Console
  2. Issuance of Service account key
  3. Enable the API
  4. Creating a Google Spreadsheets data source
  5. Prepare the dataset and give it to Google Spreadsheets
  6. Visualization

Create a project in the Google Developer Console

To connect from re: dash to Google Spreadsheets, you need to issue a Service account key from the Google Developer Console.

First, create a project. This time I named it redash-sample.

Home_-_redash-sample.png

Issuance of Service account key

Next, issue a Service account key in the API menu. This procedure will eventually download the json format file. Save it in a suitable location as you will use it later.

Home_-_redash-sample.png

Credentials_-_redash-sample.png

Create_service_account_key_-_redash-sample_と_Dash.png

Enable API

Next, find the Drive API from Overview and set it to enalbed.

API_Library_-_redash-sample.png

Creating a data source for Google Spreadsheets

Create as follows

re_dash___Data_Sources.png

Prepare a dataset and give it to Google Spreadsheets

Middle classification index (January 1970) on the page of 2010 Consumer Price Index ~ Latest month) is downloaded by csv and posted on Google Spreadsheet.

After that, format the data as follows. I changed A1 because I thought that YYYYMM would be more appropriate.

平成22年基準消費者物価指数_-_Google_Sheets.png

Then share this to the email inside the json of your Service account key

平成22年基準消費者物価指数_-_Google_Sheets.png

Visualization

The URL of Google Spreadsheet is as follows.

平成22年基準消費者物価指数_-_Google_Sheets.png

At that time, enter the following in the value created by New Query. You can separate the "key in the URL" and the "spreadsheet number (starting with 0)" with a "|".

re_dash___New_Query.png

With proper visualization, it looks like this: On the other hand, the rent is going down, isn't it?

re_dash___New_Query.png

Summary

I got the data of Google Spreadsheets with re: dash and went to visualization. It seems that it is possible to import Google Analytics with Google Spreadsheets and visualize it with re: dash. The downside is that Spreadsheets load slowly. When I used it this time, it took more than 20 seconds to import.

Recommended Posts

Easy analysis sharing with re: dash, an open source data visualization tool Part 3 ~ Google Spreadsheets
Easy analysis sharing with re: dash, an open source data visualization tool Part 2 ~ Graph
Easy analysis sharing with re: dash, an open source data visualization tool Part 4 ~ pivot table
Easy analysis and sharing with re: dash, an open source data visualization tool Part 1-Installation
Try to get CloudWatch metrics with re: dash python data source
Easy data visualization with Python seaborn.
Data analysis starting with python (data visualization 1)
Data analysis starting with python (data visualization 2)
Python visualization tool for data analysis work
Beautiful graph drawing with python -seaborn makes data analysis and visualization easier Part 1
Beautiful graph drawing with python -seaborn makes data analysis and visualization easier Part 2