Hello ketan sir,
I am switching from windows to linux based distro. So for that I have to install protobuf and compile files. Please provide me steps regarding the installation. No instructions are given on github page for linux users.
Hello ketan sir,
I am switching from windows to linux based distro. So for that I have to install protobuf and compile files. Please provide me steps regarding the installation. No instructions are given on github page for linux users.
If you use streamer functions you would not need to install protobuf and complie files
For more information about the streamer functions and usage, refer to the SDK documentation:
If you are switching from Windows to a Linux-based distribution, here are the steps to install Protocol Buffers (Protobuf) and set up the Upstox Market Stream Feed WebSocket client.
Check your Python version:
python3 --version
If Python is not installed, you can install it using your package manager:
Ubuntu/Debian:
sudo apt update && sudo apt install python3 python3-pip
Fedora:
sudo dnf install python3 python3-pip
Install the dependencies using pip:
pip3 install websockets asyncio protobuf requests
protoc-<version>-linux-x86_64.zip.unzip protoc-<version>-linux-x86_64.zip -d protoc
bin directory to your system PATH:export PATH=$PATH:/path/to/protoc/bin
protoc --version
It should print the installed protoc version.
.proto files.proto files.protoc --python_out=. *.proto
This will generate .py files for each .proto file.
import MarketDataFeedV3_pb2 as pb
(Assuming you have MarketDataFeedV3.proto which generates MarketDataFeedV3_pb2.py.)
Open your Python script and replace the placeholder with your actual access token:
access_token = 'ACCESS_TOKEN'
Navigate to the script directory and run:
python3 websocket_client.py
Replace websocket_client.py with your actual script filename.
Following these steps on Linux will set up your environment to connect to the Upstox Market Stream Feed, fetch live market data, and decode protobuf messages to JSON format.
Thanks!
Thank you ketan sir…