API Reference¶
ESP¶
The ESP
class is used to create the connection to the ESP server.
Once you have a connection to the server, you can query it for information
about projects (running and stopped) and the server itself. You can
also create, load, start, stop, and delete projects.
Other objects in the server can also be introspected such as windows, events, loggers, MAS modules, routers, and algorithms.
Finally, you can also save and reload server configurations, as well as shut the server down.
Server Methods¶
These methods correspond to server configuration and shutting down.
|
Save the server state |
|
Reset the server model to the model used at startup |
|
Shutdown the server |
Project Methods¶
The project methods allow you to adminster projects.
|
Create a new Project object |
|
Load a project from a project definition |
|
Load a project from a project definition |
|
Project statistics subscriber |
|
Retrieve the specified project |
|
Retrieve projects from the server |
|
Start specified project |
|
Start projects |
|
Stop specified project |
|
Stop projects |
|
Delete specified project |
|
Delete projects |
|
Retrieve the specified running project |
|
Retrieve running project information |
|
Retrieve specified stopped project |
|
Retrieve stopped projects |
|
Validate project definition |
The get_project_stats()
method returns an object which subscribes
to the project statistics: ProjectStats
. The stats
attribute of that object
is a pandas.DataFrame
of the current statistics.
Window Methods¶
|
Retrieve specified window |
|
Retrieve windows from the server |
Event Methods¶
|
Retrieve events from the server |
|
Retrieve events residing in open patterns in the server |
|
Retrieve the state of the specified event generator |
|
Retrieve all event generators in the server |
Logging Methods¶
|
Retrieve the specified logger |
|
Retrieve all loggers in the system |
Enable capturing of server log messages |
|
Disable capturing of server log messages |
|
|
Return all stored server log messages |
|
Return the current state of the server log capture |
MAS Module Methods¶
|
Retrieve all MAS modules |
Router Methods¶
|
Create a new router |
|
Retrieve the specified router |
|
Retrieve all routers in the server |
|
Retrieve router statistics |
Event Generator Methods¶
|
Create an event generator |
|
Delete the specified event generator |
Delete all event generators in the server |
Algorithm Methods¶
|
Retrieve information for the specified algorithm |
|
Retrieve information for all algorithms of the specified type |
Project Definitions¶
The classes in this section allow you to programmatically create
projects. Once you have a Project
object, you can load it
in the server and administer it.
Projects¶
|
ESP Project |
|
Retrieve project statistics subscriber |
|
Start the project |
|
Stop the project |
|
Save the project |
|
Restore the project |
|
Update project definition |
|
Delete the project |
|
Return a copy of the object |
|
Sync the project definition to the server |
|
Validate the project definition |
|
Retrieve specified window |
|
Retrieve windows from the server |
|
Retrieve specified MAS modules |
|
Retrieve all MAS modules |
|
Create project from XML definition |
|
Export project definition to XML |
|
Save the project XML to a file |
|
Export project definition to graphviz.Digraph |
Project Construction Methods¶
|
Add a continuous query object |
|
Add a continuous query object |
|
Add a continuous query object |
|
Add a template object |
|
Add one or more templates to the project |
|
Add a window to the project |
|
Add connector edges |
|
Add connectors to a group |
|
Start the connectors for the project |
|
Create a MAS module object |
|
Replace the specified MAS module |
Dictionary Methods¶
|
|
|
|
|
|
|
|
|
If key is not found, d is returned if given, otherwise KeyError is raised. |
|
as a 2-tuple; but raise KeyError if D is empty. |
|
|
|
Continuous Queries¶
|
Continuous Query |
|
Add a template object |
|
Delete templates and related windows |
|
Delete templates and related windows |
|
Retrieve specified window |
|
Retrieve windows from the server |
|
Add a window to the continuous query |
|
Add one or more windows to the continuous query |
|
Rename a window and update targets |
|
Delete windows and update targets |
|
Delete windows and update targets |
|
Return a copy of the object |
|
Create continous query from XML definition |
|
Export continuous query definition to XML |
|
Save the continuous query XML to a file |
|
Export continuous query definition to graphviz.Digraph |
Templates¶
|
ESP Template |
|
Create a TextEmbedding template |
|
Create a Logistic template |
|
Create a ObjectDetection template |
|
Create a KeypointsDetection template |
|
Add input_windows |
|
Delete input_windows |
|
Add output_windows |
|
Delete output_windows |
|
Set parameters |
|
Set inputs |
|
Set outputs |
|
Add target for Template |
|
Delete targets for Template |
|
Add a window to the template |
|
Add one or more windows to the template |
|
import a template object |
|
Rename a window and update targets |
|
Delete windows and update targets |
|
Delete windows and update targets |
|
Return a copy of the template |
|
Create template from XML definition |
|
Export template definition to XML |
|
Save the template XML to a file |
|
Export template definition to graphviz.Digraph |
Windows¶
Base Window Methods¶
The base window class is an abstract class that defines methods used by all window classes. It should not be instantiated directly. The common methods are described below.
Monitoring¶
|
Enable console tracing for the window |
|
Disable console tracing for the window |
Creating Events¶
|
Create an event generator |
|
Create a publisher for the given window |
|
Publish events to the window |
Retrieving Events¶
|
Subscribe to events |
|
Stop event processing |
|
Create a new websocket subscriber for the window |
|
Retrieve events from the window |
|
Retrieve events residing in open patterns in the window |
Transforming Events¶
|
Add an transformer to apply for each event |
|
Apply current set of data transformers to given data |
Plotting¶
|
Display a streaming bar plot in a Jupyter notebook |
|
Display a streaming horizontal bar plot in a Jupyter notebook |
|
Display a streaming histogram in a Jupyter notebook |
|
Display a streaming line plot in a Jupyter notebook |
|
Display a streaming area plot in a Jupyter notebook |
|
Display a streaming scatter plot in a Jupyter notebook |
|
Display a streaming bubble plot in a Jupyter notebook |
|
Display a streaming scatter plot in a Jupyter notebook |
|
Display a streaming donut plot in a Jupyter notebook |
|
Display a streaming pie plot in a Jupyter notebook |
|
Display streaming images in a Jupyter notebook |
Project Construction¶
|
Add a connector to the window |
|
Add windows as targets |
|
Add windows as targets |
|
Remove windows as targets |
|
Remove windows as targets |
|
Add a schema field |
|
Delete schema fields |
|
Set schema fields as key |
|
Set Finalized Callback |
|
Set splitter function using a shared library and function name |
|
Set expression to direct events to one of n different output slots |
Utilities¶
|
Return a copy of the object |
|
Construct window from XML definition |
|
Export window definition to XML |
|
Save the window XML to a file |
|
Export window definition to graphviz.Digraph |
Source Windows¶
|
Source Window |
|
Retention |
Calculation Windows¶
|
Calculation Window |
|
Set parameters |
|
Set input map fields |
|
Set output map fields |
|
Add MAS Window Map |
Aggregation Windows¶
|
Aggregate window |
|
Add aggregate field expression |
|
Add aggregate field expression |
|
Add aggregate field expression |
Add aggregate field expression |
|
|
Add aggregate field plugin |
Computation Windows¶
|
Compute window |
|
Add new field expressions |
|
Add new field expressions |
|
Add new field expressions |
|
Add new field expressions |
|
Add a field plugin |
|
Set a context plugin |
|
Set initialization expression |
Set initialization expression |
Copying Windows¶
|
Copy window |
|
Retention |
Counting Windows¶
|
Counter window |
Filtering Windows¶
|
Filter window |
|
Set initialization expression |
Set initialization expression |
|
|
Set the expression |
|
Set plugin |
Functional Windows¶
|
Functional window |
Set expressions |
|
Set properties |
|
Set functions |
|
Add a Regex Event Loop |
|
|
Add an XML Event Loop |
|
JSON Event Loop |
Create a new function context for use in event loops |
The FunctionalWindow.create_function_context()
method returns
a FunctionConext
instance with the following methods.
|
Function Context |
|
Set expressions |
|
Set properties |
|
Set functions |
Geofence Windows¶
|
Geofence window |
|
Set geometry parameters |
|
Set position parameters |
|
Set output parameters |
|
Object Tracker window |
|
|
|
Set the tracker output |
|
Set the tracker input |
|
Set the tracker input |
|
Set the tracker input |
Joining Windows¶
|
Join window |
Set initialization expression |
|
|
Add a join condition |
|
Add a field expression |
|
Add a field expression |
|
Add an expression |
|
Add an expression |
|
Add a field selection |
|
Add a selection |
|
Add a field plugin |
|
Set initialization expression |
Miscellaneous Windows¶
|
RemoveStateWindow Window |
|
Transpose Window |
Model Reading Windows¶
|
Model reader window |
Model Supervisor Windows¶
|
Model supervisor window |
Notification Windows¶
|
Notification window |
|
Set the SMTP server settings |
|
Add an email notifier |
|
Add an SMS notifier |
|
Add an SMS notifier |
Set expressions |
|
Set properties |
|
Set functions |
Pattern Windows¶
|
Pattern window |
|
Create Pattern object and add it to the patterns list |
The patterns
attribute of PatternWindow
contains
Pattern
objects which have the following methods.
|
Add a Pattern Event |
|
Set logic expression |
|
Add a Pattern Field Expression |
|
Add a Pattern Field Selection |
|
Add a Pattern Time Field |
Procedural Windows¶
|
Procedural window |
|
Add a C++ Plugin |
Set C++ Plugin Context |
|
|
Add a C++ Plugin |
|
Add a DS External |
Scoring Windows¶
|
Score window |
|
Set model inputs |
|
Set model outputs |
|
Online model |
|
Offline model |
Import a schema from the astore CAS action output format |
Text Category Windows¶
|
Text category window |
Text Context Windows¶
|
Text context window |
Text Sentiment Windows¶
|
Text sentiment window |
Text Topic Windows¶
|
Text topic window |
Training Windows¶
|
Train window |
|
Set input map fields |
|
Set parameters |
Union Windows¶
|
Union window |
Python Helpers¶
|
Python Window |
|
Add the information needed to create a MAS module and add MAS window map. |
Keras Helpers¶
|
Keras Window |
|
Add the information of a Keras model |
Tensorflow Helpers¶
|
Tensorflow Window |
|
Add the information of a Tensorflow model |
JMP Helpers¶
|
JMP Window |
|
Add the information of a JMP model |
Schemas¶
|
Schema definition |
|
Add a schema field |
|
Create schema from XML definition |
|
Export schema definition to XML |
|
Create schema from schema-string element |
|
Create schema from string definition |
Schema Fields¶
|
Schema field |
|
Create schema from XML definition |
|
Export schema definition to XML |
Subscriber¶
Subscriber objects are returned by the Window.create_subscriber()
method.
They are used to subscribe to event streams.
|
Create a subscriber for the given window |
|
Initialize the web socket and start it in its own thread |
|
Stop processing events and close the web socket |
|
Stop processing events and close the web socket |
Publisher¶
Publisher objects are returned by the Window.create_publisher()
method.
They are used to publish events.
|
Create a publisher for the given window |
|
Send data to the web socket |
|
Close the web socket connection |
Streaming Charts¶
Streaming charts are a wrapper around Chart.js charts which include features for making animated figures in a Jupyter notebook easier.
|
Streaming Chart |
|
Create an area chart |
|
Create a bar chart |
|
Create a horizontal bar chart |
|
Create a bubble chart |
|
Create a line chart |
|
Create a scatter chart |
|
Create a pie chart |
|
Create a donut chart |
|
Create a donut chart |
Streaming Images¶
Streaming images allow you to view a series of images in a Jupyter notebook cell.
|
Streaming Images |
Chart Layouts¶
Chart layouts allow you to create complex layouts of multiple streaming chart and image components. These layouts will display in a single output cell in a Jupyter notebook. All of the components in the layout are controlled from a single set of transport buttons.
|
Create a layout of charts / images |
Event Generators¶
|
Event generator |
|
Add values to initialize when event generator starts |
|
Add fields to generate |
|
Add map resources |
|
Add list resources |
|
Add set resources |
|
Add map URL resources |
Add list URL resources |
|
|
Add set URL resources |
|
Start the generator |
|
Stop the event generator |
Initialize the event generator |
|
|
Delete the event generator |
|
Save the event generator |
|
Create event generator from XML definition |
|
Export the event generator definition to XML |
Loggers¶
|
Server logger |
|
Set the log level |
MAS Modules¶
|
MAS Module |
|
Save the module |
|
Create MAS module from XML definition |
|
Convert MAS module to XML definition |
Routers¶
Router¶
|
Router definition |
|
Add a new router engine |
|
Add a new router publish destination |
|
Add a new router writer destination |
|
Add a new route |
|
Save the router definition to the server |
|
Delete the router |
|
Initalize router destination |
|
Create router from XML definition |
|
Convert Router to XML definition |
Engine¶
Note
Engine
objects are typically instantiated using
the Router.add_engine()
method.
|
ESP Engine Configuration |
|
|
|
PublishDestination¶
Note
PublishDestination
objects are typically instantiated using
the Router.add_publish_destination()
method.
|
Router Publish Destination |
Initialize the destination |
|
Convert destination to Element definition |
|
|
Convert destination to XML definition |
WriterDestination¶
Note
WriterDestination
objects are typically instantiated using
the Router.add_writer_destination()
method.
|
Route Writer Destination |
Initialize the destination |
|
Convert the destination to an Element definition |
|
|
Convert the destination to an XML definition |
Route¶
Note
Route
objects are typically instantiated using
the Router.add_route()
method.
|
|
|
Convert Route to an Element definition |
|
Convert Route to an XML definition |
Connectors¶
The Connector
class is the base class for all connectors.
|
Window connector |
|
Set connector properties |
|
Export connector definition to XML |
The following connectors are concrete implementations of the connectors available to ESP.
|
Publish Bacnet events |
|
Publish using an adapter |
|
Subscribe using an adapter |
|
Subscribe events to a database |
|
Subscribe to database events |
|
Publish events from a file |
|
Subscribe to events from a file |
|
Publish events from a socket |
|
Subscribe to events from a socket |
|
Subscribe to events from a Kafka broker |
|
Publish events to a Kafka broker |
|
Subscribe to MQ Telemetry Transport (MQTT) |
|
Subscribe to MQ Telemetry Transport (MQTT) |
|
Subscribe to Modbus events |
|
Publish Modbus events |
|
Subscribe to Nurego metering window |
|
Subscribe to OPC-UA operations |
|
Publish OPC-UA operations |
|
Subscribe to operations from a PI Asset Framework (AF) server |
|
Publish operations to a PI Asset Framework (AF) server |
|
ESP window event publisher |
|
Publish Basler GigE camera captured frames |
|
Subscribe to Rabbit MQ events |
|
Publish Rabbit MQ events |
|
Subscribe to Simple Mail Transfer Protocol (SMTP) events |
|
Publish local area network packet events |
|
Subscribe to Solace events |
|
Publish events to Solace |
|
Subscribe to Teradata operations |
|
Subscribe to Teradata Listener events |
|
Subscribe to Tervela Data Fabric events |
|
Subscribe to Tervela Data Fabric events |
|
Subscribe to Tibco Rendezvous (RV) events |
|
Subscribe to Tibco Rendezvous (RV) events |
|
Publish events on regular intervals |
|
Publish URL events |
|
Publish photos taken by a V4L2 compatible |
|
Publish websocket events |
|
Subscribe to IBM WebSphere MQ events |
|
Publish IBM WebSphere MQ events |
Algorithms¶
|
Base class for all ESP algorithms |
|
Create algorithm object from XML definition |
Project Statistics¶
The ProjectStats
class subscribes to the statistics stream on
the server. It acts like a pandas.DataFrame
and contains the
current project statistics.
|
Project statistics subscriber |
|
Initialize the web socket and start it in its own thread |
|
Stop processing events and close the web socket |
|
Stop processing events and close the web socket |
Configuration Options¶
The options
object at the top-level of the package allows you to
get and set options as attributes. For example, to set the
display.image_scale
option to 0.5, you would do the following:
In [1]: esppy.options.display.image_scale = 0.5
This is equivalent to:
In [2]: esppy.set_option('display.image_scale', 0.5)
You can get help for an option using the describe_option
function
or IPython’s help system:
In [3]: esppy.describe_option('display.image_scale')
display.image_scale : float
Specifies the scale factor for rendering project diagrams.
[default: 1.0] [currently: 0.5]
To get help for all options, execute describe_option
without any arguments.
|
Get the value of an option |
|
Set the value of an option |
|
Print the description of one or more options |
|
Reset one or more options back to their default value |
|
Create a context for setting option temporarily |