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
,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: Optional[Callable] = None) int
Returns length of list or count of found elements
- func:
Callable
selected value
int
- func:
- abstract distinct(func: Optional[Callable] = None) IterableABC
Returns list without redundancies
- func:
Callable
selected value
- class
cpl_query.extension.iterable_abc.IterableABC
- func:
- abstract element_at(index: int) any
Returns element at given index
- index:
int
index
Value at index: any
- index:
- abstract element_at_or_default(index: int) Optional[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() any
Returns first element
First element of list: any
- abstract first_or_default() 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() any
Returns last element
Last element of list: any
- abstract last_or_default() 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) 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) IterableABC
Sorts elements by function in descending order
- func:
Callable
selected value
- class
cpl_query.extension.iterable_abc.IterableABC
- func:
- abstract reverse() IterableABC
Reverses list
- class
cpl_query.extension.iterable_abc.IterableABC
- abstract single() 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[any]
Returns one single element of list
Found value: Optional[any]
- abstract skip(index: int) IterableABC
Skips all elements from index
- index:
int
index
- class
cpl_query.extension.iterable_abc.IterableABC
- index:
- abstract skip_last(index: int) 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) IterableABC
Takes all elements from index
- index:
int
index
- class
cpl_query.extension.iterable_abc.IterableABC
- index:
- abstract take_last(index: int) 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
- property type: type
- abstract where(func: Callable) 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:
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: Optional[Callable] = None) IterableABC
Returns list without redundancies
- func:
Callable
selected value
- class
cpl_query.extension.iterable_abc.IterableABC
- func:
- element_at(index: int) any
Returns element at given index
- index:
int
index
Value at index: any
- index:
- element_at_or_default(index: int) Optional[any]
Returns element at given index or None
- index:
int
index
Value at index: Optional[any]
- index:
- first() any
Returns first element
First element of list: any
- first_or_default() Optional[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() any
Returns last element
Last element of list: any
- last_or_default() Optional[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) 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) OrderedIterableABC
Sorts elements by function in descending order
- func:
Callable
selected value
- class
cpl_query.extension.iterable_abc.IterableABC
- func:
- reverse() IterableABC
Reverses list
- class
cpl_query.extension.iterable_abc.IterableABC
- single() 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[any]
Returns one single element of list
Found value: Optional[any]
- skip(index: int) IterableABC
Skips all elements from index
- index:
int
index
- class
cpl_query.extension.iterable_abc.IterableABC
- index:
- skip_last(index: int) 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) IterableABC
Takes all elements from index
- index:
int
index
- class
cpl_query.extension.iterable_abc.IterableABC
- index:
- take_last(index: int) IterableABC
Takes all elements after index
- index:
int
index
- class
cpl_query.extension.iterable_abc.IterableABC
- index:
- where(func: Callable) IterableABC
Select element by function
- func:
Callable
selected value
- class
cpl_query.extension.iterable_abc.IterableABC
- func:
cpl_query.extension.list
cpl_query.extension.ordered_iterable_abc
- class cpl_query.extension.ordered_iterable_abc.OrderedIterableABC(_t: type, _func: Optional[Callable] = None)
Bases:
IterableABC
- abstract then_by(func: Callable) OrderedIterableABC
Sorts OrderedList in ascending order by function
func:
Callable
list of
cpl_query.extension.OrderedIterableABC
- abstract then_by_descending(func: Callable) 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(_t: Optional[type] = None)
Bases:
Iterable
,OrderedIterableABC
Implementation of :class: cpl_query.extension.Iterable cpl_query.extension.OrderedIterableABC
- then_by(_func: Callable) OrderedIterableABC
Sorts OrderedList in ascending order by function
func:
Callable
list of
cpl_query.extension.OrderedIterableABC
- then_by_descending(_func: Callable) OrderedIterableABC
Sorts OrderedList in descending order by function
func:
Callable
list of
cpl_query.extension.OrderedIterableABC