In this article we introduce Python EPL plug-in. How to invoke the Python code from within Apama EPL. We demonstrate how to call Python code from EPL using sample code snippet that returns the reverse of a string from Python program
Now Customer can execute the machine Learning code developed in Python scripts as part of their Apama applications to make use use of Streaming analytics
A Python EPL plug-in allows developers to call Python code in an EPL application. The Python EPL plug-in will execute the python file.
Current EPL plug-in supports Python 3.6.6
Install Apama and Designer from Software AG Installer. Python 3 comes with the installation of Apama
EPL In Action:
Following EPL and Python code snippet demonstrates how to call Python from EPL.
Python program from apama.eplplugin should import EPLAction, EPLPluginBase. Python class should have a constructor. For example:
|from apama.eplplugin import EPLAction, EPLPluginBase|
Sample Python Code :
Member functions that can be accessed by EPL needs to be declared with signature. For example:
In the CorrelatorConfig.yaml file, user needs to configure the plug-ins:
Sample Apama Code :
Apama Project folder structure exhibiting the CorrelatorConfig.yaml, TestPlugin.mon inside the monitor and TestPlugin.py inside plugins folder
In this article, we just demonstrated how to use Python EPL plug-in. User can create a complex Python application using NumPy, SciPy, Pandas, Matplotlib,Keras, TensorFlow etc and make use of these in Apama directly.
Please see the attachement section for working python and Apama mon.