This project is a library for remote controlling Samsung televisions via a TCP/IP connection. It currently supports modern (post-2016) TVs with Ethernet or Wi-Fi connectivity.
$ pip3 install git+https://github.com/marysieek/samsung-tv-api.git
or
$ git clone https://github.com/marysieek/samsung-tv-api.git
$ pip3 install ./samsung-tv-api
from samsungtv import SamsungTV
tv = SamsungTV('192.168.xxx.xxx')
tv.power() # toggle power
MIT