module generic.column_type

Inheritance diagram of pysqllike.generic.column_type

Short summary

module pysqllike.generic.column_type

Classes which defines column for class IterRow

source on GitHub

Classes

class

truncated documentation

CFT

defines a function

ColumnConstantType

defines a constant as a column

ColumnGroupType

defines a column which processes a group of rows (after a groupby)

ColumnTableType

defines a table column (not coming from an expression)

ColumnType

Defines a column of a table.

Functions

function

truncated documentation

private_function_type

no documentation

Properties

property

truncated documentation

Func

property

Func

property

Func

property

Func

property

Func

property

Name

property

Name

property

Name

property

Name

property

Name

property

Parent

property

Parent

property

Parent

property

Parent

property

Parent

property

ShortName

a short name (tells the column type)

ShortName

a short name (tells the column type)

ShortName

a short name (tells the column type)

ShortName

a short name (tells the column type)

ShortName

a short name (tells the column type)

Type

property

Type

property

Type

property

Type

property

Type

property

Methods

method

truncated documentation

__add__

These operators should be able to translate an expression into function operating on the values.

__add__

These operators should be able to translate an expression into function operating on the values.

__add__

forbidden

__add__

These operators should be able to translate an expression into function operating on the values.

__add__

These operators should be able to translate an expression into function operating on the values.

__and__

these operators should be able to translate an expression into function operating on the values

__and__

these operators should be able to translate an expression into function operating on the values

__and__

these operators should be able to translate an expression into function operating on the values

__and__

these operators should be able to translate an expression into function operating on the values

__and__

these operators should be able to translate an expression into function operating on the values

__call__

returns func(value)

__call__

return the constant

__call__

returns the content

__call__

returns the content

__call__

returns func(value)

__eq__

these operators should be able to translate an expression into function operating on the values

__eq__

these operators should be able to translate an expression into function operating on the values

__eq__

these operators should be able to translate an expression into function operating on the values

__eq__

these operators should be able to translate an expression into function operating on the values

__eq__

these operators should be able to translate an expression into function operating on the values

__floordiv__

These operators should be able to translate an expression into function operating on the values.

__floordiv__

These operators should be able to translate an expression into function operating on the values.

__floordiv__

forbidden

__floordiv__

These operators should be able to translate an expression into function operating on the values.

__floordiv__

These operators should be able to translate an expression into function operating on the values.

__ge__

these operators should be able to translate an expression into function operating on the values

__ge__

these operators should be able to translate an expression into function operating on the values

__ge__

these operators should be able to translate an expression into function operating on the values

__ge__

these operators should be able to translate an expression into function operating on the values

__ge__

these operators should be able to translate an expression into function operating on the values

__gt__

these operators should be able to translate an expression into function operating on the values

__gt__

these operators should be able to translate an expression into function operating on the values

__gt__

these operators should be able to translate an expression into function operating on the values

__gt__

these operators should be able to translate an expression into function operating on the values

__gt__

these operators should be able to translate an expression into function operating on the values

__init__

constructor (a function cannot accept keywords)

__init__

__init__

constructor

__init__

constructor

__init__

initiates the column

__le__

these operators should be able to translate an expression into function operating on the values

__le__

these operators should be able to translate an expression into function operating on the values

__le__

these operators should be able to translate an expression into function operating on the values

__le__

these operators should be able to translate an expression into function operating on the values

__le__

these operators should be able to translate an expression into function operating on the values

__lt__

these operators should be able to translate an expression into function operating on the values

__lt__

these operators should be able to translate an expression into function operating on the values

__lt__

these operators should be able to translate an expression into function operating on the values

__lt__

these operators should be able to translate an expression into function operating on the values

__lt__

these operators should be able to translate an expression into function operating on the values

__mod__

these operators should be able to translate an expression into function operating on the values

__mod__

these operators should be able to translate an expression into function operating on the values

__mod__

forbidden

__mod__

these operators should be able to translate an expression into function operating on the values

__mod__

these operators should be able to translate an expression into function operating on the values

__mul__

These operators should be able to translate an expression into function operating on the values.

__mul__

These operators should be able to translate an expression into function operating on the values.

__mul__

forbidden

__mul__

These operators should be able to translate an expression into function operating on the values.

__mul__

These operators should be able to translate an expression into function operating on the values.

__ne__

these operators should be able to translate an expression into function operating on the values

__ne__

these operators should be able to translate an expression into function operating on the values

__ne__

these operators should be able to translate an expression into function operating on the values

__ne__

these operators should be able to translate an expression into function operating on the values

__ne__

these operators should be able to translate an expression into function operating on the values

__not__

these operators should be able to translate an expression into function operating on the values

__not__

these operators should be able to translate an expression into function operating on the values

__not__

these operators should be able to translate an expression into function operating on the values

__not__

these operators should be able to translate an expression into function operating on the values

__not__

these operators should be able to translate an expression into function operating on the values

__or__

these operators should be able to translate an expression into function operating on the values

__or__

these operators should be able to translate an expression into function operating on the values

__or__

these operators should be able to translate an expression into function operating on the values

__or__

these operators should be able to translate an expression into function operating on the values

__or__

these operators should be able to translate an expression into function operating on the values

__pow__

these operators should be able to translate an expression into function operating on the values

__pow__

these operators should be able to translate an expression into function operating on the values

__pow__

forbidden

__pow__

these operators should be able to translate an expression into function operating on the values

__pow__

these operators should be able to translate an expression into function operating on the values

__str__

usual

__str__

usual

__str__

usual

__str__

usual

__str__

usual

__sub__

These operators should be able to translate an expression into function operating on the values.

__sub__

These operators should be able to translate an expression into function operating on the values.

__sub__

forbidden

__sub__

These operators should be able to translate an expression into function operating on the values.

__sub__

These operators should be able to translate an expression into function operating on the values.

__truediv__

These operators should be able to translate an expression into function operating on the values.

__truediv__

These operators should be able to translate an expression into function operating on the values.

__truediv__

forbidden

__truediv__

These operators should be able to translate an expression into function operating on the values.

__truediv__

These operators should be able to translate an expression into function operating on the values.

And

and cannot be overriden

And

and cannot be overriden

And

and cannot be overriden

And

and cannot be overriden

And

and cannot be overriden

avg

returns a group columns to return an average

avg

returns a group columns to return an average

avg

returns a group columns to return an average

avg

returns a group columns to return an average

avg

returns a group columns to return an average

copy

Returns a copy of this class.

copy

Returns a copy of this class.

copy

Returns a copy of this class.

copy

Returns a copy of this class.

copy

Returns a copy of this class.

count

returns a group columns to count the number of observations

count

returns a group columns to count the number of observations

count

returns a group columns to count the number of observations

count

returns a group columns to count the number of observations

count

returns a group columns to count the number of observations

IsColumnType

checks it is a column type which used by an operator

IsColumnType

checks it is a column type which used by an operator

IsColumnType

checks it is a column type which used by an operator

IsColumnType

checks it is a column type which used by an operator

IsColumnType

checks it is a column type which used by an operator

len

returns a group columns to count the number of observations

len

returns a group columns to count the number of observations

len

returns a group columns to count the number of observations

len

returns a group columns to count the number of observations

len

returns a group columns to count the number of observations

Not

not cannot be overriden

Not

not cannot be overriden

Not

not cannot be overriden

Not

not cannot be overriden

Not

not cannot be overriden

Or

or cannot be overriden

Or

or cannot be overriden

Or

or cannot be overriden

Or

or cannot be overriden

Or

or cannot be overriden

print_parent

Returns a string showing the dependencies of this columns. Example

print_parent

Returns a string showing the dependencies of this columns. Example

print_parent

Returns a string showing the dependencies of this columns. Example

print_parent

Returns a string showing the dependencies of this columns. Example

print_parent

Returns a string showing the dependencies of this columns. Example

set

Sets a value for this column.

set

do nothing (it is a constant)

set

sets a value for this column

set

Sets a value for this column.

set

Sets a value for this column.

set_name

Changes the name of the column.

set_name

Changes the name of the column.

set_name

Changes the name of the column.

set_name

Changes the name of the column.

set_name

Changes the name of the column.

set_none

after a loop on a database, we should put None back as a value

set_none

do nothing (it is a constant)

set_none

after a loop on a database, we should put None back as a value

set_none

after a loop on a database, we should put None back as a value

set_none

After a loop on a database, we should put None back as a value.

set_owner

Changes the owner of the column.

set_owner

Changes the owner of the column.

set_owner

Changes the owner of the column.

set_owner

Changes the owner of the column.

set_owner

Changes the owner of the column.

Documentation

Classes which defines column for class IterRow

source on GitHub

class pysqllike.generic.column_type.CFT(func, *l)[source]

Bases: pysqllike.generic.column_type.ColumnType

defines a function

source on GitHub

constructor (a function cannot accept keywords)

Parameters
  • func – contained function

  • l – list of ColumnType

source on GitHub

property ShortName

a short name (tells the column type)

source on GitHub

__init__(func, *l)[source]

constructor (a function cannot accept keywords)

Parameters
  • func – contained function

  • l – list of ColumnType

source on GitHub

__str__()[source]

usual

source on GitHub

set_none()[source]

after a loop on a database, we should put None back as a value

source on GitHub

class pysqllike.generic.column_type.ColumnConstantType(const)[source]

Bases: pysqllike.generic.column_type.ColumnType

defines a constant as a column

source on GitHub

property ShortName

a short name (tells the column type)

source on GitHub

__call__()[source]

return the constant

source on GitHub

__init__(const)[source]

initiates the column

Parameters
  • name – name of the column

  • typ – type of the data it will contain (can be None)

  • func – a function, if None, if will be the identity

  • parent – precise a list of parents if this column was part of a formula

  • op – operator to apply between the column

  • owner – table which contains the column (only for further validation)

function is a function: f: x --> y

source on GitHub

__str__()[source]

usual

source on GitHub

set(value)[source]

do nothing (it is a constant)

Parameters

value – anything in [int,float,long,str, function ]

source on GitHub

set_none()[source]

do nothing (it is a constant)

source on GitHub

class pysqllike.generic.column_type.ColumnGroupType(name, typ, parent, op)[source]

Bases: pysqllike.generic.column_type.ColumnType

defines a column which processes a group of rows (after a groupby)

source on GitHub

constructor

Parameters
  • name – name of the column

  • typ – type of the column

  • owner – owner of this column

  • op – operator

source on GitHub

property ShortName

a short name (tells the column type)

source on GitHub

__add__(column)[source]

forbidden

source on GitHub

__call__()[source]

returns the content

source on GitHub

__floordiv__(column)[source]

forbidden

source on GitHub

__init__(name, typ, parent, op)[source]

constructor

Parameters
  • name – name of the column

  • typ – type of the column

  • owner – owner of this column

  • op – operator

source on GitHub

__mod__(column)[source]

forbidden

source on GitHub

__mul__(column)[source]

forbidden

source on GitHub

__pow__(column)[source]

forbidden

source on GitHub

__str__()[source]

usual

source on GitHub

__sub__(column)[source]

forbidden

source on GitHub

__truediv__(column)[source]

forbidden

source on GitHub

set(value)[source]

sets a value for this column

Parameters

value – anything in [int,float,long,str, function ]

source on GitHub

set_none()[source]

after a loop on a database, we should put None back as a value

source on GitHub

class pysqllike.generic.column_type.ColumnTableType(name, typ, owner)[source]

Bases: pysqllike.generic.column_type.ColumnType

defines a table column (not coming from an expression)

source on GitHub

constructor

Parameters
  • name – name of the column

  • typ – type of the column

  • owner – owner of this column

source on GitHub

property ShortName

a short name (tells the column type)

source on GitHub

__call__()[source]

returns the content

source on GitHub

__init__(name, typ, owner)[source]

constructor

Parameters
  • name – name of the column

  • typ – type of the column

  • owner – owner of this column

source on GitHub

__str__()[source]

usual

source on GitHub

set_none()[source]

after a loop on a database, we should put None back as a value

source on GitHub

class pysqllike.generic.column_type.ColumnType(name, typ, func=None, parent=(), op=None, owner=None)[source]

Bases: object

Defines a column of a table.

source on GitHub

initiates the column

Parameters
  • name – name of the column

  • typ – type of the data it will contain (can be None)

  • func – a function, if None, if will be the identity

  • parent – precise a list of parents if this column was part of a formula

  • op – operator to apply between the column

  • owner – table which contains the column (only for further validation)

function is a function: f: x --> y

source on GitHub

And(column)[source]

and cannot be overriden

source on GitHub

property Func

property

source on GitHub

IsColumnType()[source]

checks it is a column type which used by an operator

source on GitHub

property Name

property

source on GitHub

Not()[source]

not cannot be overriden

source on GitHub

Or(column)[source]

or cannot be overriden

source on GitHub

property Parent

property

source on GitHub

property ShortName

a short name (tells the column type)

source on GitHub

property Type

property

source on GitHub

__add__(column)[source]

These operators should be able to translate an expression into function operating on the values.

Parameters

column – a function or an int or a float or a long or a str or a ColumnType

Returns

a ColumnType

source on GitHub

__and__(column)[source]

these operators should be able to translate an expression into function operating on the values

Parameters

column – a function or an int or a float or a long or a str or a ColumnType

Returns

a ColumnType

source on GitHub

__call__()[source]

returns func(value)

source on GitHub

__eq__(column)[source]

these operators should be able to translate an expression into function operating on the values

Parameters

column – a function or an int or a float or a long or a str or a ColumnType

Returns

a ColumnType

source on GitHub

__floordiv__(column)[source]

These operators should be able to translate an expression into function operating on the values.

Parameters

column – a function or an int or a float or a long or a str or a ColumnType

Returns

a ColumnType

source on GitHub

__ge__(column)[source]

these operators should be able to translate an expression into function operating on the values

Parameters

column – a function or an int or a float or a long or a str or a ColumnType

Returns

a ColumnType

source on GitHub

__gt__(column)[source]

these operators should be able to translate an expression into function operating on the values

Parameters

column – a function or an int or a float or a long or a str or a ColumnType

Returns

a ColumnType

source on GitHub

__hash__ = None
__init__(name, typ, func=None, parent=(), op=None, owner=None)[source]

initiates the column

Parameters
  • name – name of the column

  • typ – type of the data it will contain (can be None)

  • func – a function, if None, if will be the identity

  • parent – precise a list of parents if this column was part of a formula

  • op – operator to apply between the column

  • owner – table which contains the column (only for further validation)

function is a function: f: x --> y

source on GitHub

__le__(column)[source]

these operators should be able to translate an expression into function operating on the values

Parameters

column – a function or an int or a float or a long or a str or a ColumnType

Returns

a ColumnType

source on GitHub

__lt__(column)[source]

these operators should be able to translate an expression into function operating on the values

Parameters

column – a function or an int or a float or a long or a str or a ColumnType

Returns

a ColumnType

source on GitHub

__mod__(column)[source]

these operators should be able to translate an expression into function operating on the values

Parameters

column – a function or an int or a float or a long or a str or a ColumnType

Returns

a ColumnType

source on GitHub

__mul__(column)[source]

These operators should be able to translate an expression into function operating on the values.

Parameters

column – a function or an int or a float or a long or a str or a ColumnType

Returns

a ColumnType

source on GitHub

__ne__(column)[source]

these operators should be able to translate an expression into function operating on the values

Parameters

column – a function or an int or a float or a long or a str or a ColumnType

Returns

a ColumnType

source on GitHub

__not__()[source]

these operators should be able to translate an expression into function operating on the values

Returns

a ColumnType

source on GitHub

__or__(column)[source]

these operators should be able to translate an expression into function operating on the values

Parameters

column – a function or an int or a float or a long or a str or a ColumnType

Returns

a ColumnType

source on GitHub

__pow__(column)[source]

these operators should be able to translate an expression into function operating on the values

Parameters

column – a function or an int or a float or a long or a str or a ColumnType

Returns

a ColumnType

source on GitHub

__str__()[source]

usual

source on GitHub

__sub__(column)[source]

These operators should be able to translate an expression into function operating on the values.

Parameters

column – a function or an int or a float or a long or a str or a ColumnType

Returns

a ColumnType

source on GitHub

__truediv__(column)[source]

These operators should be able to translate an expression into function operating on the values.

Parameters

column – a function or an int or a float or a long or a str or a ColumnType

Returns

a ColumnType

source on GitHub

_default_name = '__unk__'
_str_type = {<class 'int'>: 'int', <class 'pysqllike.generic.others_types.long'>: 'long', <class 'pysqllike.generic.others_types.NA'>: 'NA', <class 'float'>: 'float', <class 'str'>: 'str', <class 'function'>: 'func'}
avg()[source]

returns a group columns to return an average

source on GitHub

copy(new_owner)[source]

Returns a copy of this class.

Parameters

new_owner – new owner

Returns

ColumnType

source on GitHub

count()[source]

returns a group columns to count the number of observations

source on GitHub

len()[source]

returns a group columns to count the number of observations

source on GitHub

print_parent()[source]

Returns a string showing the dependencies of this columns.

Example:

this_columns
    parent1
        parent11
        parent12
    parent2

source on GitHub

set(value)[source]

Sets a value for this column.

Parameters

value – anything in [int, float, long, str, function]

source on GitHub

set_name(new_name)[source]

Changes the name of the column.

Parameters

newname – new name

source on GitHub

set_none()[source]

After a loop on a database, we should put None back as a value.

source on GitHub

set_owner(new_owner)[source]

Changes the owner of the column.

Parameters

newname – new name

source on GitHub

pysqllike.generic.column_type.private_function_type()[source]

no documentation