unicorn_fy package¶
Submodules¶
unicorn_fy.unicorn_fy module¶
- class unicorn_fy.unicorn_fy.UnicornFy¶
Bases:
object
Unify received data from crypto exchanges
- Supported exchanges:
Binance.com
Binance-com-futures
Binance-com-coin_futures
Binance-com-margin
Binance-com-isolated_margin
Binance.je
Binance.us
trBinance.com
Binance.org
Jex.com
- VERSION = '0.12.2.dev'¶
- static binance_coin_futures_websocket(stream_data_json, exchange='binance.com-coin_futures', show_deprecated_warning=False)¶
unicorn_fy binance.com-coin_futures raw_stream_data
- Parameters
stream_data_json (json) – The received raw stream data from the Binance websocket
exchange (str) – Exchange endpoint.
show_deprecated_warning (bool) – Show or hide warning
- Returns
dict
- static binance_com_coin_futures_websocket(stream_data_json)¶
unicorn_fy binance.com-coin_futures raw_stream_data
- Parameters
stream_data_json (json) – The received raw stream data from the Binance websocket
- Returns
dict
- static binance_com_futures_websocket(stream_data_json)¶
unicorn_fy binance.com-futures raw_stream_data
- Parameters
stream_data_json (json) – The received raw stream data from the Binance websocket
- Returns
dict
- static binance_com_isolated_margin_websocket(stream_data_json)¶
unicorn_fy binance.com-isolated_margin raw_stream_data
- Parameters
stream_data_json (json) – The received raw stream data from the Binance websocket
- Returns
dict
- static binance_com_margin_websocket(stream_data_json)¶
unicorn_fy binance.com-margin raw_stream_data
- Parameters
stream_data_json (json) – The received raw stream data from the Binance websocket
- Returns
dict
- static binance_com_websocket(stream_data_json)¶
unicorn_fy binance.com raw_stream_data
- Parameters
stream_data_json (json) – The received raw stream data from the Binance websocket
- Returns
dict
- static binance_futures_websocket(stream_data_json, exchange='binance.com-futures', show_deprecated_warning=False)¶
unicorn_fy binance.com-futures raw_stream_data
- Parameters
stream_data_json (json) – The received raw stream data from the Binance websocket
exchange (str) – Exchange endpoint.
show_deprecated_warning (bool) – Show or hide warning
- Returns
dict
- static binance_je_websocket(stream_data_json)¶
unicorn_fy binance.je (Jersey) raw_stream_data
- Parameters
stream_data_json (json) – The received raw stream data from the Binance websocket
- Returns
dict
- static binance_org_websocket(stream_data_json)¶
unicorn_fy binance.org (incl testnet) raw_stream_data
- Parameters
stream_data_json (json) – The received raw stream data from the Binance websocket
- Returns
dict
- static binance_us_websocket(stream_data_json)¶
unicorn_fy binance.us (US) raw_stream_data
- Parameters
stream_data_json (json) – The received raw stream data from the Binance websocket
- Returns
dict
- static binance_websocket(stream_data_json, exchange='binance', show_deprecated_warning=True)¶
unicorn_fy binance.com raw_stream_data
- Parameters
stream_data_json (json) – The received raw stream data from the Binance websocket
exchange (str) – Exchange endpoint.
show_deprecated_warning (bool) – Show or hide warning
- Returns
dict
- static get_latest_release_info()¶
Get infos about the latest available release
- Returns
dict or False
- get_latest_version()¶
Get the version of the latest available release (cache time 1 hour)
- Returns
str or False
- static get_version()¶
Get the package/module version
- Returns
str
- static is_json(data)¶
Is the string in json format?
- Parameters
data (str) – the data to verify
- Returns
True or False
- Return type
bool
- is_update_available()¶
Is a new release of this package available?
- Returns
bool
- static jex_com_websocket(stream_data_json)¶
unicorn_fy jex.com raw_stream_data
- Parameters
stream_data_json (json) – The received raw stream data from the Binance websocket
- Returns
dict
- static set_to_false_if_not_exist(value, key)¶
some vars are non existent if they would be empty, so we create the missing vars with default values
- Parameters
value (str) – default value
key (str) – the key name
- Returns
final value
- Return type
str
- static trbinance_com_websocket(stream_data_json)¶
unicorn_fy trbinance.com (TR) raw_stream_data
- Parameters
stream_data_json (json) – The received raw stream data from the Binance websocket
- Returns
dict