Skip to content

Python realtime engine demonstration

An example realtime engine that uses a Python function in the upd and demonstrates multidependency service for QPacker

Dependencies

As QPacker relies on a requirements.txt in the project root directory for creating the Docker image, the Machine Learning Toolkit requirements.txt has been copied in.

Build

The engine can be built with qp build.

Run

Local

The engine can be run standalone and locally with qp run.

Connection to a tickerplant can be specified in the command line.

qp run prte -binlinux -- tp :localhost:5000

Docker standalone

qp run prte

Networking will have to be managed if it is run standalone in Docker. Again, command-line arguments can supply tickerplant details.

qp run prte -- tp :tickerplant:5000

Docker Compose

If Docker Compose is used, the service can be specified to interact with basic-tick-system.

Using the docker-compose.yaml in the root dir:

docker-compose up

Data format

The service can receive data into upd in the format (table;data) where data is a table with columns time, sym, and price.

The result of upd is a table with columns time, sym, and price. The Python function prints the number of rows received and double the price column.

Interaction with basic-tick-system

The data format matches that of basic-tick-system, so can be connected to the basic-tick-system’s tickerplant.