Skip to content

Python SDK for Openfeed v1.4.0

Latest
Compare
Choose a tag to compare
@mvberg mvberg released this 20 Sep 20:08
· 2 commits to master since this release

Added the following:

  • support for streaming and filtering User Defined Spreads (eg T8^UDS)
  • support for streaming Equity Options (eg AAPL^EO)
  • support for logon via JWT
  • added a global on_message callback/listener

UDS Example:

# subscribe to UDS an filter by type (optional)
of_client.add_symbol_subscription(
    "T8^UDS", callback=on_message, subscription_type=["QUOTE"], spread_type_filter=["RR", "JR"])

EO Example:

of_client.add_symbol_subscription("AAPL^EO", callback=on_message])

JWT Auth Example:

# new client with JWT
of_client = openfeed.OpenfeedClient("", "", jtw="YOUR_TOKEN")

Global Message Handler:

# add a global message handler for all incoming OF messages
of_client.on_message = lambda msg: print("Global Message:", msg)