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, *args)

Bases: ColumnType

defines a function

source on GitHub

constructor (a function cannot accept keywords)

Parameters:
  • func – contained function

  • args – list of ColumnType

source on GitHub

property ShortName

a short name (tells the column type)

source on GitHub

__init__(func, *args)

constructor (a function cannot accept keywords)

Parameters:
  • func – contained function

  • args – list of ColumnType

source on GitHub

__str__()

usual

source on GitHub

set_none()

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

source on GitHub

class pysqllike.generic.column_type.ColumnConstantType(const)

Bases: ColumnType

defines a constant as a column

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

property ShortName

a short name (tells the column type)

source on GitHub

__call__()

return the constant

source on GitHub

__init__(const)

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__()

usual

source on GitHub

set(value)

do nothing (it is a constant)

Parameters:

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

source on GitHub

set_none()

do nothing (it is a constant)

source on GitHub

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

Bases: 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)

forbidden

source on GitHub

__call__()

returns the content

source on GitHub

__floordiv__(column)

forbidden

source on GitHub

__init__(name, typ, parent, op)

constructor

Parameters:
  • name – name of the column

  • typ – type of the column

  • owner – owner of this column

  • op – operator

source on GitHub

__mod__(column)

forbidden

source on GitHub

__mul__(column)

forbidden

source on GitHub

__pow__(column)

forbidden

source on GitHub

__str__()

usual

source on GitHub

__sub__(column)

forbidden

source on GitHub

__truediv__(column)

forbidden

source on GitHub

set(value)

sets a value for this column

Parameters:

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

source on GitHub

set_none()

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)

Bases: 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__()

returns the content

source on GitHub

__init__(name, typ, owner)

constructor

Parameters:
  • name – name of the column

  • typ – type of the column

  • owner – owner of this column

source on GitHub

__str__()

usual

source on GitHub

set_none()

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)

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)

and cannot be overriden

source on GitHub

property Func

property

source on GitHub

IsColumnType()

checks it is a column type which used by an operator

source on GitHub

property Name

property

source on GitHub

Not()

not cannot be overriden

source on GitHub

Or(column)

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)

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)

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__()

returns func(value)

source on GitHub

__eq__(column)

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)

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)

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)

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)

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)

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)

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)

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)

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)

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__()

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

Returns:

a ColumnType

source on GitHub

__or__(column)

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)

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__()

usual

source on GitHub

__sub__(column)

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)

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()

returns a group columns to return an average

source on GitHub

copy(new_owner)

Returns a copy of this class.

Parameters:

new_owner – new owner

Returns:

ColumnType

source on GitHub

count()

returns a group columns to count the number of observations

source on GitHub

len()

returns a group columns to count the number of observations

source on GitHub

print_parent()

Returns a string showing the dependencies of this columns.

Example:

this_columns
    parent1
        parent11
        parent12
    parent2

source on GitHub

set(value)

Sets a value for this column.

Parameters:

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

source on GitHub

set_name(new_name)

Changes the name of the column.

Parameters:

newname – new name

source on GitHub

set_none()

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

source on GitHub

set_owner(new_owner)

Changes the owner of the column.

Parameters:

newname – new name

source on GitHub

pysqllike.generic.column_type.private_function_type()

no documentation