prozorro_sale.tools.utils module

prozorro_sale.tools.utils.aiohttp_apps_iterator(app)[source]

Iterating aiohttp Sub Application :param app: aiohttp Application

Returns

yield iterator

async prozorro_sale.tools.utils.close_not_complited_response(request)[source]

Close response :param request:

Returns:

prozorro_sale.tools.utils.is_resp_start_send(request)[source]

Check start send response :param request:

Returns:

prozorro_sale.tools.utils.math_round(value, decimals=2) -> (<class 'float'>, <class 'int'>)[source]

Custom round method.

Parameters
  • value (Any) – Bool, Int, Float or Str converted to Float value.

  • decimals (int) – Coma separated decimals.

Returns

Rounded value.

Return type

value (float)

Examples

native method

>>> round(950.025, 2)
950.02
>>> round(950.026, 2)
950.03

custom method

>>> math_round(950.025, 2)
950.03
>>> math_round(950.026, 2)
950.03
>>> math_round(250, -2)
200
>>> math_round('950.026', 2)
950.03
>>> math_round('Some_string', 2)
'Some_string'