Get sensors data from external server using websoket

I want to try to make custom component to get sensors communicating external server using websoket. Could you please advise which Python library better to use and maybe some starting point. I had look into websocket_api and samsungtv codes, but could not figureout anything.