From 1910c4e7c10fed39b924d9b495f75f57b3731003 Mon Sep 17 00:00:00 2001 From: mohamedemad4 Date: Wed, 2 Sep 2020 03:37:45 +0200 Subject: [PATCH] added docs to README --- README.rst | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/README.rst b/README.rst index 355d65a..f7f5b43 100644 --- a/README.rst +++ b/README.rst @@ -135,6 +135,23 @@ To receive results in ``pandas`` format, use the ``get_dataframe()`` method: startDate='2017-01-01', endDate='2018-05-31') +Websocket support:: + +.. code-block:: python + from tiingo import TiingoWebsocketClient + + def cb_fn(msg): + print(msg) + + subscribe = { + 'eventName':'subscribe', + 'authorization':'API_KEY_GOES_HERE', + 'eventData': { + 'thresholdLevel':5 + } + } + + client=TiingoWebsocketClient(subscribe,endpoint="iex",on_msg_cb=cb_fn) You can specify any of the end of day frequencies (daily, weekly, monthly, and annually) or any intraday frequency for both the ``get_ticker_price`` and ``get_dataframe`` methods. Weekly frequencies resample to the end of day on Friday, monthly frequencies resample to the last day of the month, and annually frequencies resample to the end of day on 12-31 of each year. The intraday frequencies are specified using an integer followed by "Min" or "Hour", for example "30Min" or "1Hour".