Convtools

Latest version: v1.14.3

Safety actively analyzes 682404 Python packages for vulnerabilities to keep your Python projects secure.

Scan your dependencies

Page 14 of 18

0.12.1

**Bugfix**

- fixed sporadic issues caused by code substring replacements (now it uses word
replacements)

0.12.0

**Bugfix**

- ``.filter`` was unified across the library to work with previous step results
only, no longer injecting conditions inside comprehensions & reducers.
Now to pass conditions to comprehensions & reducers, use the following:

python
REPLACE THIS
c.ReduceFuncs.Array(c.item("a")).filter(c.item("b") == "bar")
WITH THAT
c.ReduceFuncs.Array(c.item("a"), where=c.item("b") == "bar")
if the condition is to be applied before the aggregation
or leave as is if you want to filter the resulting array



- ``c.generator_comp(...).filter(condition)`` no longer pushes condition inside
the comprehension, the filtering works on resulting generator

python
REPLACE THIS
c.generator_comp(c.item("a")).filter(c.item("b") == "bar")
WITH THAT
c.generator_comp(c.item("a"), where=c.item("b") == "bar")
if the condition is to be put to the IF clause of the comprehension to
work with the input elements or leave it as is if you want to filter the
resulting generator


The same applies to:

* ``c.list_comp``
* ``c.tuple_comp``
* ``c.set_comp``
* ``c.dict_comp``


----

0.11.2

**Features**

- introduced ``c.sort`` & ``(...).sort`` conversions, which are helpers for
``sorted``; this is done for the sake of unification with methods of
comprehension conversions

**Misc**

- implemented ``GroupBy.filter``, which returns generator of results without
creating an intermediate list

0.11.1

**Bugfix**

- fixed complex conversion cases where there are multiple aggregations
[convtools-ita 27 ](https://github.com/itechart/convtools/issues/27)

0.11.0

**Bugfix**

- fixed ``GroupBy.filter`` method to return generator by default, instead of
list

0.10.0

**Features**

[convtools-ita 25 by Anexen ](https://github.com/itechart/convtools/issues/25)

- introduced ``c.ReduceFuncs.Average`` - arithmetic mean or weighted mean
- introduced ``c.ReduceFuncs.Median``
- introduced ``c.ReduceFuncs.Mode`` - most frequent value; last one if there are
many of the same frequency
- introduced ``c.ReduceFuncs.TopK`` - list of most frequent values

Page 14 of 18

© 2024 Safety CLI Cybersecurity Inc. All Rights Reserved.