You have to use the PyRFC and SAP NW RFC SDK.
Let us assume I like to call the function module STFC_CONNECTION:
from pyrfc import Connection
conn = Connection(ashost='123', sysnr='00', client='100', user='user', passwd='secret')
conn.call('STFC_CONNECTION', REQUTEXT=u'Hello SAP!')
I have created an Anaconda environment to have the libraries I need. Currently I am still waiting for the SAP NW RFC SDK. Would it work like this?
Flow:
FlowExecuteStreamCommand