I encountered an issue while trying to use the WebSocketHandler class from the thefirstock module in my script. It seems that the module does not contain the WebSocketHandler attribute, resulting in an AttributeError

from thefirstock import thefirstock

handler = thefirstock.WebSocketHandler("USER_NAME")
listOfTradingSymbol = ["Nifty Bank", "Nifty 50"]

def subscribe_feed_data(data):
    thefirstock.subscribe_symbol(handler, "ACC-EQ")
    print(data)

# Modify the websocket_connection function to accept the handler as an argument
thread = thefirstock.websocket_connection(
    handler,
    listOfTradingSymbol,
    socket_connection=1,
    activate_sub_feed=True,
    callback_sub_feed=subscribe_feed_data
)

Error

Traceback (most recent call last):
  File "/home/akash/Desktop/Oxygen/w.py", line 4, in <module>
    handler = thefirstock.WebSocketHandler("HS1765")
AttributeError: module 'thefirstock.thefirstock' has no attribute 'WebSocketHandler'

Hi @Akash_Yadav ,

Its working for us. Please install the package again pip install thefirstock and let us know if you are still facing the issue.