Skip to main content

Greendeck Test to plot graph using gsheets

Project description

Installation

Installation with pip

pip install GreenDeck-GsheetsTest==0.0.17

To run the file clients_secrets.json file is required in the root directory. For example in a Mac the root directory is "/Users/username" therefore the "client_secrets.json" file will be searched at this location.
Download the client_secrets.json file from the github repository and save it in the root directory.

Dependency

matplot
pandas
gsheets

Usage

To use the package in the terminal the following steps need to be performed. First enter the python environment before brginning to execute these commands.

In order to use the package it needs to be imported using the command

import GreenDeck

After this the module needs to be imported using the command

from GreenDeck import GsheetsTest

Lastly you need to call the login method in order to start using the package.

GsheetsTest.login()

Sample

screenshot-run-program

Run-through

After calling the login() method if the user has not logged in then the default browser is opened where user can login using his/her Google Account and the data is stored in the storage.json file which then omits the process of logging in again every time the program is run.

screenshot-login-screen

Result

screenshot-login-success

After getting this result on the web browser. Close the browser and go back to the terminal where the program was being executed. You will see a list of all the sheets that are present or have been added to that Google Account. These sheets are numbered and for further operations you can select one of the sheets from the list by entering their corresponding number.

screenshot-list-sheet

The sheet corresponding to the entered number is accessed and the column names of that sheet are displayed. Following which user is asked to select the column to be taken as x-axis and y-axis.

screenshot-list-column

The columns entered are then plot on the graph with the corresponding columns for x-axis and y-axis.

screenshot-result-graph

Methods

login()

This method is used for logging in the user. After logging in the user this method gets all the sheets available at the GoogleSheets account and calls the list_sheet() method.

list_sheet()

This method takes a list of all sheets as the input and prints all these sheet objects and asks the user to select one of the sheets. This selected sheet is then passed onto the plot_graph method.

plot_graph()

This method takes the google sheet object as the input and then displays all the column names in the sheet. Then the user is asked to select a column for x-axis and y-axis. The cholumns selected are then plot on a graph.

License

MIT License . For more details, please read the LICENSE file.

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

GreenDeck_GsheetsTest-0.0.17.tar.gz (3.1 kB view hashes)

Uploaded Source

Built Distribution

GreenDeck_GsheetsTest-0.0.17-py3-none-any.whl (4.2 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