Giter Club home page Giter Club logo

lightstreamer-example-stocklist-client-python's Introduction

Lightstreamer - Basic Stock-List Demo - Python Client

This project contains a simple Python script that shows a minimal client-side implementation of the Lightstreamer Server Text mode Protocol.

screenshot

Details

The example provides a very simple version of the Stock-List Demos, where a single subscription to 12 items is submitted. The updates are then formatted and displayed on the console.

The script shows all the basic steps required to establish an interaction to Lightstreamer Server. More specifically, the code comprises these actions:

  • Connection to Lightstreamer server and session creation
  • Subscription to items with specified fields
  • Notification about real time updates
  • Unsubscription from items
  • Final disconnection

It is important to highlight that the example is not meant to be a complete and robust Lightstreamer Client Python library, but it could be used as a starting point to build more complex interactions with the Lightstreamer server to manage all the possible scenarios included in the protocol.

Install

If you want to install a version of this demo pointing to your local Lightstreamer Server, follow these steps:

  • Note that, as prerequisite, the Lightstreamer - Stock- List Demo - Java Adapter has to be deployed on your local Lightstreamer Server instance. Please check out that project and follow the installation instructions provided with it.
  • Launch Lightstreamer Server.
  • Go to http://python.org/download/ and download the appropriate Python (tested since version 2.6.3) for your OS and follow the instructions to install it on your system. Note that the demo currently can not be launched from IDLE.

You can now run the Python script simply executing the following commands on different OS:

  • Windows machines:
start python /path/to/example/stock_list_demo.py
  • Linux machines:
python /path/to/example/stock_list_demo.py

or, alternatively, you can make the script executable:

chmod +x /path/to/example/stock_list_demo.py

and then type:

/path/to/example/stock_list_demo.py

The example is configured to connect to http://push.lightstreamer.com:80, but you can easily change these settings modifying the following line:

lightstreamer_client = LSClient("http://push.lightstreamer.com:80", "DEMO")

to connect to the correct combination of host and port of your Lightstreamer server.

See Also

Lightstreamer Adapters Needed by this Demo Client

Related Projects

Lightstreamer Compatibility Notes

  • Compatible with Lightstreamer server since version 6.0.
  • Ensure that Generic Client API is supported by Lightstreamer Server license configuration.
  • For a version of this example compatible with Lightstreamer server version 5.1.2, please refer to this tag.

lightstreamer-example-stocklist-client-python's People

Contributors

gfinocchiaro avatar dario-weswit avatar

Watchers

James Cloos avatar Bo Ma avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.