LSEG Data Library for Python

stream.get_snapshot

Returns a snapshot of the instruments stored in the in-memory data cache of the stream. When the stream is opened, this data cache is kept up-to-date with the latest updates received from the platform.

Module

lseg.data.content.pricing

Syntax

stream.get_snapshot(universe, fields)

Parameters

Value Description Data type Optional Default value
universe Single instrument or list of instruments. str, list[str] Yes None
fields Single field or list of fields to return. str, list[str] Yes None
convert If True - force numeric conversion to all values. bool Yes True

Returned value

pandas.DataFrame

Usage

The following example demonstrates how to get the data snapshot for MSFT.O and GOOG.O for BID and ASK fields, using a previously created definition that also includes the other instruments and fields:

definition = pricing.Definition(
    universe=["MSFT.O", "GOOG.O", "IBM.N"],
    fields=["BID", "ASK", "OPEN_PRC"]
)

stream = definition.get_stream()
data = stream.get_snapshot(["MSFT.O", "GOOG.O"], ["BID", "ASK"])

None

114 words (0:36 mins)