Yes a python interface is available from NetSim v11 onwards.
In terms of simulation control, the interface allows users to pause, pause at a specified time, continue with the simulation, stop the simulation, reconnect the device console, and exit the simulation. Users can access modify and remove entries from the route tables of the devices using various route commands like the windows route commands. It also allows configuring access control rules on the go to filter traffic at the routers. ICMP ping can be initiated from the device console using Device name or IP address and the same can be visualized using Wireshark packet capture option.
Connections are made using the port and IP address/Loop back address of the system running NetSim. NetSim provides a TCP socket with which a socket program/application written in any programming language can establish a connection. Client programs can connect to NetSim socket using the loop back/IP address of the system running NetSim along with the port number 8999.
A client socket program written in Python can connect to NetSim Server process in a similar way as depicted here.
You can see https://tetcos.freshdesk.com/support/solutions/articles/14000096743-location-aware-routing-using-python-interface-in-netsim for more information