unicorn_fy package

Submodules

unicorn_fy.unicorn_fy module

class unicorn_fy.unicorn_fy.UnicornFy(debug=False)[source]

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.us

  • trBinance.com

  • Binance.org

static binance_com_coin_futures_websocket(stream_data_json)[source]

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)[source]

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)[source]

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)[source]

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)[source]

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)[source]

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_org_websocket(stream_data_json)[source]

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)[source]

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)[source]

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()[source]

Get infos about the latest available release

Returns:

dict or False

get_latest_version()[source]

Get the version of the latest available release (cache time 1 hour)

Returns:

str or False

static get_version()[source]

Get the package/module version

Returns:

str

static is_json(data)[source]

Is the string in json format?

Parameters:

data (str) – the data to verify

Returns:

True or False

Return type:

bool

is_update_available()[source]

Is a new release of this package available?

Returns:

bool

static set_to_false_if_not_exist(value, key)[source]

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)[source]

unicorn_fy trbinance.com (TR) raw_stream_data

Parameters:

stream_data_json (json) – The received raw stream data from the Binance websocket

Returns:

dict

Module contents