Skip to content

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

Notifications You must be signed in to change notification settings

f-teruhisa/stooqifier

Repository files navigation

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

$ 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
$ 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
# .sample.env => .env
STOCK_CODE=
SLACK_API_TOKEN=
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

About

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

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published