Skip to content

Jench2103/tw-stock-linebot

Repository files navigation

Taiwan Stock Tracker - TOC Project Fall 2022

Table of Contents

Features

  • Collect stocks : add, delete, and check the list.
  • Look up the name of a stock by its ID and vice versa.
  • Check the current price, daily trading statistics, and the latest ex-dividend information about the collected stocks.
  • Support multi-user execution.

Technique

Finite State Machine in the Linebot

Deployment

  1. Clone this repository.
    $ git clone https://github.com/Jench2103/tw-stock-linebot.git
    $ cd tw-stock-linebot
  2. Create your own config.json and fill the parameters.
    $ cd /path/to/tw-stock-linebot
    $ cp config.example.json config.json
  3. Execute the server with Docker Compose. The server will be running on port 5000.
    $ cd /path/to/tw-stock-linebot
    $ docker compose up -d
  4. Stop the server.
    $ docker compose down

Repository Structure

tw-stock-linebot/
├── config/
│   └── __init__.py
├── config.example.json
├── config.json                     # copy from `config.example.json`
├── data/                           # database and other temp files
├── docs/
├── flask_line/
│   ├── __init__.py
│   └── entrypoint.py
├── fsm/                            # the implementation of the Linebot FSM
│   ├── __init__.py
│   ├── linebot_machine.py
│   ├── states.py
│   └── transistions.py
├── models/                         # the schema of the database tables
│   ├── __init__.py
│   ├── data_update_history.py
│   ├── stock_info.py
│   ├── user_state.py
│   └── user_stock.py
├── pyproject.toml
├── requirements.txt
├── server.py                       # the entrypoint of this system
└── stock_api/                      # the interfaces for accessing third-party APIs
    ├── __init__.py
    ├── fin_mind.py
    └── twse.py

Reference

About

Taiwan Stock Tracker - TOC Project Fall 2022

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published