Stooqifier is an automatic stock price Slack notification with chart image script that with pandas-datareader call Stooq.com API.
(ex. 6095.JP's stock price configured)
- 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
$ git clone git@github.com:f-teruhisa/stooqifier.git
- 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}
- 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.
- Configure the periodic execution settings in Cloud Scheduler
- Specify
#{TOPIC_NAME}
which was created in Deploy to Google Cloud Functions, as the topic - Official documentation: https://cloud.google.com/scheduler/docs/quickstart#create_a_job
- pandas-datareader: https://github.com/pydata/pandas-datareader
- To request API of Stooq.com
- mplfinance: https://github.com/matplotlib/mplfinance
- To generate price chart image
- Fork it
- Create your feature branch (
git checkout -b my-new-feature
) - Commit your changes (
git commit -am 'Add some feature'
) - Push to the branch (
git push origin my-new-feature
) - Create new Pull Request