Giter Site home page Giter Site logo

python-interact-with-google-sheet's Introduction

Python-interact-with-Google-sheet

obtain per min stock data through market data api in google sheet

With the google sheet api credential JSON file, the code could interact with a google sheet file with "market data" api installed (more info.: https://www.marketdata.app/).

"market data" api allows the user to input add-in formulas to obtain the basic price and volume data of a specified stock in a specified time interval and period. Each of the data point (datetime, price, volume) will automatically show in each of the blanks in the sheet.

However, this api could only generate the data in 60 consecutive days every time, so the formula will need to be updated for certain times when the specified period exceeds 60 days.

In this case, pygsheets updates the formula inside the cell A1 repeatedly and captures the data generated afterwards as a dataframe, then multiple dataframes will be consecutively generated and integrated to be a single completed dataframe by pandas, eventually pandas makes the dataframe into a csv file.

Within the code

gc = pygsheets.authorize(service_account_file= "path to credential JSON file")

survey_url = "the link of that google sheet (market data api installed)"

There are also 5 stock data CSV files generated by the code as examples, please find them in this repository. (e.g. GOOG_from 1-1-2017 to 6-24-2022_5)

python-interact-with-google-sheet's People

Contributors

benny-ll avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.