cpl_query.extension
cpl_query.extension.iterable_abc
- class cpl_query.extension.iterable_abc.IterableABC(t: Optional[type] = None, values: Optional[list] = None)
Bases:
abc.ABC
,list
ABC to define functions on list
- abstract all(func: Callable) bool
Checks if every element of list equals result found by function
- func:
Callable
selected value
bool
- func:
- abstract any(func: Callable) bool
Checks if list contains result found by function
- func:
Callable
selected value
bool
- func:
- append(_IterableABC__object: object) None
Adds element to list
- __object:
object
value
- __object:
- abstract average(func: Optional[Callable] = None) Union[int, float, complex]
Returns average value of list
- func:
Callable
selected value
Union[int, float, complex]
- func:
- abstract contains(value: object) bool
Checks if list contains value given by function
- value:
object
value
bool
- value:
- abstract count(func: Callable) int
Returns length of list or count of found elements
- func:
Callable
selected value
int
- func:
- abstract distinct(func: Callable) cpl_query.extension.iterable_abc.IterableABC
Returns list without redundancies
- func:
Callable
selected value
- class
cpl_query.extension.iterable_abc.IterableABC
- func:
- abstract element_at(index: int) cpl_query.extension.iterable_abc.IterableABC.any
Returns element at given index
- index:
int
index
Value at index: any
- index:
- abstract element_at_or_default(index: int) Optional[cpl_query.extension.iterable_abc.IterableABC.any]
Returns element at given index or None
- index:
int
index
Value at index: Optional[any]
- index:
- extend(_IterableABC__iterable: Iterable) None
Adds elements of given list to list
- __iterable: :class: cpl_query.extension.iterable.Iterable
index
- abstract first() cpl_query.extension.iterable_abc.IterableABC.any
Returns first element
First element of list: any
- abstract first_or_default() cpl_query.extension.iterable_abc.IterableABC.any
Returns first element or None
First element of list: Optional[any]
- abstract for_each(func: Callable)
Runs given function for each element of list
- func: :class: Callable
function to call
- abstract last() cpl_query.extension.iterable_abc.IterableABC.any
Returns last element
Last element of list: any
- abstract last_or_default() cpl_query.extension.iterable_abc.IterableABC.any
Returns last element or None
Last element of list: Optional[any]
- abstract max(func: Optional[Callable] = None) Union[int, float, complex]
Returns highest value
- func:
Callable
selected value
Union[int, float, complex]
- func:
- abstract min(func: Optional[Callable] = None) Union[int, float, complex]
Returns highest value
- func:
Callable
selected value
Union[int, float, complex]
- func:
- abstract order_by(func: Callable) cpl_query.extension.iterable_abc.IterableABC
Sorts elements by function in ascending order
- func:
Callable
selected value
- class
cpl_query.extension.iterable_abc.IterableABC
- func:
- abstract order_by_descending(func: Callable) cpl_query.extension.iterable_abc.IterableABC
Sorts elements by function in descending order
- func:
Callable
selected value
- class
cpl_query.extension.iterable_abc.IterableABC
- func:
- abstract reverse() cpl_query.extension.iterable_abc.IterableABC
Reverses list
- class
cpl_query.extension.iterable_abc.IterableABC
- abstract single() cpl_query.extension.iterable_abc.IterableABC.any
Returns one single element of list
Found value: any
ArgumentNoneException: when argument is None Exception: when argument is None or found more than one element
- abstract single_or_default() Optional[cpl_query.extension.iterable_abc.IterableABC.any]
Returns one single element of list
Found value: Optional[any]
- abstract skip(index: int) cpl_query.extension.iterable_abc.IterableABC
Skips all elements from index
- index:
int
index
- class
cpl_query.extension.iterable_abc.IterableABC
- index:
- abstract skip_last(index: int) cpl_query.extension.iterable_abc.IterableABC
Skips all elements after index
- index:
int
index
- class
cpl_query.extension.iterable_abc.IterableABC
- index:
- abstract sum(func: Optional[Callable] = None) Union[int, float, complex]
Sum of all values
- func:
Callable
selected value
Union[int, float, complex]
- func:
- abstract take(index: int) cpl_query.extension.iterable_abc.IterableABC
Takes all elements from index
- index:
int
index
- class
cpl_query.extension.iterable_abc.IterableABC
- index:
- abstract take_last(index: int) cpl_query.extension.iterable_abc.IterableABC
Takes all elements after index
- index:
int
index
- class
cpl_query.extension.iterable_abc.IterableABC
- index:
- to_list() list
Converts :class: cpl_query.extension.iterable_abc.IterableABC to :class: list
- class
list
- abstract where(func: Callable) cpl_query.extension.iterable_abc.IterableABC
Select element by function
- func:
Callable
selected value
- class
cpl_query.extension.iterable_abc.IterableABC
- func:
cpl_query.extension.iterable
- class cpl_query.extension.iterable.Iterable(t: Optional[type] = None, values: Optional[list] = None)
Bases:
cpl_query.extension.iterable_abc.IterableABC
- all(func: Callable) bool
Checks if every element of list equals result found by function
- func:
Callable
selected value
bool
- func:
- any(func: Callable) bool
Checks if list contains result found by function
- func:
Callable
selected value
bool
- func:
- average(func: Optional[Callable] = None) Union[int, float, complex]
Returns average value of list
- func:
Callable
selected value
Union[int, float, complex]
- func:
- contains(value: object) bool
Checks if list contains value given by function
- value:
object
value
bool
- value:
- count(func: Optional[Callable] = None) int
Returns length of list or count of found elements
- func:
Callable
selected value
int
- func:
- distinct(func: Callable) cpl_query.extension.iterable_abc.IterableABC
Returns list without redundancies
- func:
Callable
selected value
- class
cpl_query.extension.iterable_abc.IterableABC
- func:
- element_at(index: int) cpl_query.extension.iterable.Iterable.any
Returns element at given index
- index:
int
index
Value at index: any
- index:
- element_at_or_default(index: int) Optional[cpl_query.extension.iterable.Iterable.any]
Returns element at given index or None
- index:
int
index
Value at index: Optional[any]
- index:
- first() cpl_query.extension.iterable.Iterable.any
Returns first element
First element of list: any
- first_or_default() Optional[cpl_query.extension.iterable.Iterable.any]
Returns first element or None
First element of list: Optional[any]
- for_each(func: Callable)
Runs given function for each element of list
- func: :class: Callable
function to call
- last() cpl_query.extension.iterable.Iterable.any
Returns last element
Last element of list: any
- last_or_default() Optional[cpl_query.extension.iterable.Iterable.any]
Returns last element or None
Last element of list: Optional[any]
- max(func: Optional[Callable] = None) Union[int, float, complex]
Returns highest value
- func:
Callable
selected value
Union[int, float, complex]
- func:
- min(func: Optional[Callable] = None) Union[int, float, complex]
Returns highest value
- func:
Callable
selected value
Union[int, float, complex]
- func:
- order_by(func: Callable) cpl_query.extension.ordered_iterable_abc.OrderedIterableABC
Sorts elements by function in ascending order
- func:
Callable
selected value
- class
cpl_query.extension.iterable_abc.IterableABC
- func:
- order_by_descending(func: Callable) cpl_query.extension.ordered_iterable_abc.OrderedIterableABC
Sorts elements by function in descending order
- func:
Callable
selected value
- class
cpl_query.extension.iterable_abc.IterableABC
- func:
- reverse() cpl_query.extension.iterable_abc.IterableABC
Reverses list
- class
cpl_query.extension.iterable_abc.IterableABC
- single() cpl_query.extension.iterable.Iterable.any
Returns one single element of list
Found value: any
ArgumentNoneException: when argument is None Exception: when argument is None or found more than one element
- single_or_default() Optional[cpl_query.extension.iterable.Iterable.any]
Returns one single element of list
Found value: Optional[any]
- skip(index: int) cpl_query.extension.iterable_abc.IterableABC
Skips all elements from index
- index:
int
index
- class
cpl_query.extension.iterable_abc.IterableABC
- index:
- skip_last(index: int) cpl_query.extension.iterable_abc.IterableABC
Skips all elements after index
- index:
int
index
- class
cpl_query.extension.iterable_abc.IterableABC
- index:
- sum(func: Optional[Callable] = None) Union[int, float, complex]
Sum of all values
- func:
Callable
selected value
Union[int, float, complex]
- func:
- take(index: int) cpl_query.extension.iterable_abc.IterableABC
Takes all elements from index
- index:
int
index
- class
cpl_query.extension.iterable_abc.IterableABC
- index:
- take_last(index: int) cpl_query.extension.iterable_abc.IterableABC
Takes all elements after index
- index:
int
index
- class
cpl_query.extension.iterable_abc.IterableABC
- index:
- where(func: Callable) cpl_query.extension.iterable_abc.IterableABC
Select element by function
- func:
Callable
selected value
- class
cpl_query.extension.iterable_abc.IterableABC
- func:
cpl_query.extension.list
- class cpl_query.extension.list.List(t: Optional[type] = None, values: Optional[list] = None)
Bases:
cpl_query.extension.iterable.Iterable
Implementation of :class: cpl_query.extension.iterable.Iterable
cpl_query.extension.ordered_iterable_abc
- class cpl_query.extension.ordered_iterable_abc.OrderedIterableABC(_func: Optional[collections.abc.Callable] = None)
Bases:
cpl_query.extension.iterable_abc.IterableABC
- abstract then_by(func: collections.abc.Callable) cpl_query.extension.ordered_iterable_abc.OrderedIterableABC
Sorts OrderedList in ascending order by function
func:
Callable
list of
cpl_query.extension.OrderedIterableABC
- abstract then_by_descending(func: collections.abc.Callable) cpl_query.extension.ordered_iterable_abc.OrderedIterableABC
Sorts OrderedList in descending order by function
func:
Callable
list of
cpl_query.extension.OrderedIterableABC
cpl_query.extension.ordered_iterable
- class cpl_query.extension.ordered_iterable.OrderedIterable
Bases:
cpl_query.extension.iterable.Iterable
,cpl_query.extension.ordered_iterable_abc.OrderedIterableABC
Implementation of :class: cpl_query.extension.Iterable cpl_query.extension.OrderedIterableABC
- then_by(_func: collections.abc.Callable) cpl_query.extension.ordered_iterable_abc.OrderedIterableABC
Sorts OrderedList in ascending order by function
func:
Callable
list of
cpl_query.extension.OrderedIterableABC
- then_by_descending(_func: collections.abc.Callable) cpl_query.extension.ordered_iterable_abc.OrderedIterableABC
Sorts OrderedList in descending order by function
func:
Callable
list of
cpl_query.extension.OrderedIterableABC