Hi William,
I'm sorry but I'm not aware of any current Python implementation for Cityindex.
Anyway, reading through their documentation, it should not be so hard to adapt our example to fit Cityindex specific features, with something like the following (for what related to connection and authentication):
[SYNTAX=PYTHON]lightstreamer_client = LSClient(base_url="
https://push.cityindex.com/", user="<your user name>", password="<your security token>", adapter_set="CITYINDEXSTREAMINGDEFAULTPRICES")
[/SYNTAX]
After that, you could submit your subscription as per your requirements (solution based on information available on the Cityindex discussion forum);
[SYNTAX=PYTHON]
# Making a new Subscription to "PRICES" Data Adapter
subscription = Subscription(
adapter="PRICES"
mode="MERGE",
items=["AC2347"],
fields=["MarketId", "TickDate", "Bid", "Offer", "Price"]
)
# A simple function acting as a Subscription listener
def on_item_update(item_update):
print("{MarketId}, {TickDate}, {Bid}, {Offer}, {Price}".format(**item_update["values"]))
# Adding the "on_item_update" function to Subscription
subscription.addlistener(on_item_update)
[/SYNTAX]
Let me know if this helps.
Regards,
Gianluca