import shioaji as sj

api = sj.Shioaji()
api.login()

@api.quote.on_quote
def quote_callback(topic: str, quote: dict):
    print(f"Topic: {topic}, Quote: {quote}")
    

api.quote.subscribe(api.Contracts.Stocks["2330"])
      pip install shioaji
import shioaji as sj

api = sj.Shioaji()
api.login()

@api.quote.on_quote
def quote_handler(topic: str, quote: dict):
    print(f"Topic: {topic}, Quote: {quote}")
    

api.quote.subscribe(api.Contracts.Stocks["2330"])
pip install shioaji