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

abstract any(func: Callable)bool

Checks if list contains result found by function

func: Callable

selected value

bool

append(_IterableABC__object: object)None

Adds element to list

__object: object

value

abstract average(func: Optional[Callable] = None)Union[int, float, complex]

Returns average value of list

func: Callable

selected value

Union[int, float, complex]

abstract contains(value: object)bool

Checks if list contains value given by function

value: object

value

bool

abstract count(func: Callable)int

Returns length of list or count of found elements

func: Callable

selected value

int

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

abstract element_at(index: int)cpl_query.extension.iterable_abc.IterableABC.any

Returns element at given index

index: int

index

Value at index: any

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]

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]

abstract min(func: Optional[Callable] = None)Union[int, float, complex]

Returns highest value

func: Callable

selected value

Union[int, float, complex]

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

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

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

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

abstract sum(func: Optional[Callable] = None)Union[int, float, complex]

Sum of all values

func: Callable

selected value

Union[int, float, complex]

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

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

to_list()list

Converts :class: cpl_query.extension.iterable_abc.IterableABC to :class: list

class

list

property type
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

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

any(func: Callable)bool

Checks if list contains result found by function

func: Callable

selected value

bool

average(func: Optional[Callable] = None)Union[int, float, complex]

Returns average value of list

func: Callable

selected value

Union[int, float, complex]

contains(value: object)bool

Checks if list contains value given by function

value: object

value

bool

count(func: Optional[Callable] = None)int

Returns length of list or count of found elements

func: Callable

selected value

int

distinct(func: Callable)cpl_query.extension.iterable_abc.IterableABC

Returns list without redundancies

func: Callable

selected value

class

cpl_query.extension.iterable_abc.IterableABC

element_at(index: int)cpl_query.extension.iterable.Iterable.any

Returns element at given index

index: int

index

Value at index: any

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]

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]

min(func: Optional[Callable] = None)Union[int, float, complex]

Returns highest value

func: Callable

selected value

Union[int, float, complex]

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

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

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

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

sum(func: Optional[Callable] = None)Union[int, float, complex]

Sum of all values

func: Callable

selected value

Union[int, float, complex]

take(index: int)cpl_query.extension.iterable_abc.IterableABC

Takes all elements from index

index: int

index

class

cpl_query.extension.iterable_abc.IterableABC

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

where(func: Callable)cpl_query.extension.iterable_abc.IterableABC

Select element by function

func: Callable

selected value

class

cpl_query.extension.iterable_abc.IterableABC

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(_t: type, _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(_t: Optional[type] = None)

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