Get sensor data from home assistant to custom python script

how I can get sensor data from home assistant to python script. I would like to send some sensor data with http post using python. Later I would also like to change HVAC temperature using http get. Can someone help with this?

So, will you run a python server and you want home assistant to call it when something happened? Or, you will run python code regularly to get the values from home assistant?

This is going to be one way to control the heating at my holiday apartment. I have home assistant running there and touch screen where you can control heating and see temperatures. I have one raspberry pi home and mysql server running on different machine on cloud. Http get and post are methods to change and read values there. Home assistant should someway notify the python script when someone changes values from the touch screen and then the python would send http post to the cloud. Then if i change temperature from my phone python script should notify home assistant to change the heating temperature.
I hope that you understand what im trying to do.

either the REST API or WebSocket-API might provide the methods you are looking for