This section describes the three parts of the Python API: the tuple, publisher, and subscriber classes.
The Python API consists of three parts:
A Tuple class for manipulating Sybase CEP messages.
A Publisher class for sending data to Sybase CEP Server.
A Subscriber class for receiving data from Sybase CEP Server.
With this combination, you can write input or output adapters. For example, in an input adapter, you read data from the data source, transform it into an appropriate format, and then use a Publisher object to send the data to the server. Similarly, in an output adapter, you use a Subscriber object to read data from the server, then transform the data into the external data format and write the data to its destination.
The complete Sybase CEP Python SDK, including example source code, is available in the sdk/python subfolder of your Sybase CEP Server installation. The primary files are:
sdk/python/c8.py, which contains the Tuple, Publisher, and Subscriber classes.
sdk/python/examples/c8-pubsub.py, which contains example code using a Publisher and a Subscriber.
sdk/python/examples/c8-server.py, which contains example code to start and stop Sybase CEP Server.