项目作者: f-teruhisa

项目描述 :
Stooqifier is an automatic stock price Slack notification with chart image script that with pandas-datareader call Stooq.com API
高级语言: Python
项目地址: git://github.com/f-teruhisa/stooqifier.git
创建时间: 2020-12-30T10:05:38Z
项目社区:https://github.com/f-teruhisa/stooqifier

开源协议:

下载


Stooqifier

Pylint
pytest
codecov

Stooqifier is an automatic stock price Slack notification with chart image script that with pandas-datareader call Stooq.com API.

example

(ex. 6095.JP‘s stock price configured)

Description

architecture

  • Notification script written in Python 3.9 that runs on Google Cloud Functions
  • This script can be executed periodically by setting up with Google Cloud Scheduler.
  • Can freely set the stock code and the Slack channel to be notified
  • The stock price update timing depends on Stooq.com
    • As of January 2021, stock prices up to the previous day can be obtained in most cases

※日本語解説記事はこちら(Japanese Description is here 👉): https://zenn.dev/t_fukumoto/articles/e5e0fe753d5726

Install

  1. $ git clone git@github.com:f-teruhisa/stooqifier.git

Usage

Deploy to Google Cloud Functions

  • Deploy to Cloud Functions in project root with gcloud command
  1. $ gcloud functions deploy #{FUNCTION_NAME} --entry-point main --project #{PROJECT_ID} --region #{REGION} --runtime python39 --trigger-topic #{PUBUSB_TOPIC_NAME}

Set some variables in .env

set_env_variables

  • Change the file name of .sample.env to .env
  • Create Bots with Slack Bots and generate SLACK_API_TOKEN
  • SLACK_CHANNEL ID is being shown via the web browser of Slack
  1. # .sample.env => .env
  2. STOCK_CODE=
  3. SLACK_API_TOKEN=
  4. SLACK_CHANNEL_ID=

Then, the function test will pass.

Set up scheduled execution in Cloud Scheduler

Requirement

Contribution

  1. Fork it
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Add some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. Create new Pull Request

Licence

MIT

Author

f-teruhisa