module generic.column_type
¶
Short summary¶
module pysqllike.generic.column_type
Classes which defines column for class IterRow
Classes¶
class |
truncated documentation |
---|---|
defines a function |
|
defines a constant as a column |
|
defines a column which processes a group of rows (after a groupby) |
|
defines a table column (not coming from an expression) |
|
Defines a column of a table. |
Functions¶
function |
truncated documentation |
---|---|
no documentation |
Properties¶
property |
truncated documentation |
---|---|
|
property |
|
property |
|
property |
|
property |
property |
|
|
property |
|
property |
|
property |
|
property |
property |
|
|
property |
|
property |
|
property |
|
property |
property |
|
a short name (tells the column type) |
|
a short name (tells the column type) |
|
a short name (tells the column type) |
|
a short name (tells the column type) |
|
a short name (tells the column type) |
|
|
property |
|
property |
|
property |
|
property |
property |
Methods¶
method |
truncated documentation |
---|---|
|
These operators should be able to translate an expression into function operating on the values. |
|
These operators should be able to translate an expression into function operating on the values. |
forbidden |
|
|
These operators should be able to translate an expression into function operating on the values. |
These operators should be able to translate an expression into function operating on the values. |
|
|
these operators should be able to translate an expression into function operating on the values |
|
these operators should be able to translate an expression into function operating on the values |
|
these operators should be able to translate an expression into function operating on the values |
|
these operators should be able to translate an expression into function operating on the values |
these operators should be able to translate an expression into function operating on the values |
|
|
returns func(value) |
return the constant |
|
returns the content |
|
returns the content |
|
returns func(value) |
|
|
these operators should be able to translate an expression into function operating on the values |
|
these operators should be able to translate an expression into function operating on the values |
|
these operators should be able to translate an expression into function operating on the values |
|
these operators should be able to translate an expression into function operating on the values |
these operators should be able to translate an expression into function operating on the values |
|
|
These operators should be able to translate an expression into function operating on the values. |
|
These operators should be able to translate an expression into function operating on the values. |
forbidden |
|
|
These operators should be able to translate an expression into function operating on the values. |
These operators should be able to translate an expression into function operating on the values. |
|
|
these operators should be able to translate an expression into function operating on the values |
|
these operators should be able to translate an expression into function operating on the values |
|
these operators should be able to translate an expression into function operating on the values |
|
these operators should be able to translate an expression into function operating on the values |
these operators should be able to translate an expression into function operating on the values |
|
|
these operators should be able to translate an expression into function operating on the values |
|
these operators should be able to translate an expression into function operating on the values |
|
these operators should be able to translate an expression into function operating on the values |
|
these operators should be able to translate an expression into function operating on the values |
these operators should be able to translate an expression into function operating on the values |
|
constructor (a function cannot accept keywords) |
|
constructor |
|
constructor |
|
initiates the column |
|
|
these operators should be able to translate an expression into function operating on the values |
|
these operators should be able to translate an expression into function operating on the values |
|
these operators should be able to translate an expression into function operating on the values |
|
these operators should be able to translate an expression into function operating on the values |
these operators should be able to translate an expression into function operating on the values |
|
|
these operators should be able to translate an expression into function operating on the values |
|
these operators should be able to translate an expression into function operating on the values |
|
these operators should be able to translate an expression into function operating on the values |
|
these operators should be able to translate an expression into function operating on the values |
these operators should be able to translate an expression into function operating on the values |
|
|
these operators should be able to translate an expression into function operating on the values |
|
these operators should be able to translate an expression into function operating on the values |
forbidden |
|
|
these operators should be able to translate an expression into function operating on the values |
these operators should be able to translate an expression into function operating on the values |
|
|
These operators should be able to translate an expression into function operating on the values. |
|
These operators should be able to translate an expression into function operating on the values. |
forbidden |
|
|
These operators should be able to translate an expression into function operating on the values. |
These operators should be able to translate an expression into function operating on the values. |
|
|
these operators should be able to translate an expression into function operating on the values |
|
these operators should be able to translate an expression into function operating on the values |
|
these operators should be able to translate an expression into function operating on the values |
|
these operators should be able to translate an expression into function operating on the values |
these operators should be able to translate an expression into function operating on the values |
|
|
these operators should be able to translate an expression into function operating on the values |
|
these operators should be able to translate an expression into function operating on the values |
|
these operators should be able to translate an expression into function operating on the values |
|
these operators should be able to translate an expression into function operating on the values |
these operators should be able to translate an expression into function operating on the values |
|
|
these operators should be able to translate an expression into function operating on the values |
|
these operators should be able to translate an expression into function operating on the values |
|
these operators should be able to translate an expression into function operating on the values |
|
these operators should be able to translate an expression into function operating on the values |
these operators should be able to translate an expression into function operating on the values |
|
|
these operators should be able to translate an expression into function operating on the values |
|
these operators should be able to translate an expression into function operating on the values |
forbidden |
|
|
these operators should be able to translate an expression into function operating on the values |
these operators should be able to translate an expression into function operating on the values |
|
usual |
|
usual |
|
usual |
|
usual |
|
usual |
|
|
These operators should be able to translate an expression into function operating on the values. |
|
These operators should be able to translate an expression into function operating on the values. |
forbidden |
|
|
These operators should be able to translate an expression into function operating on the values. |
These operators should be able to translate an expression into function operating on the values. |
|
|
These operators should be able to translate an expression into function operating on the values. |
|
These operators should be able to translate an expression into function operating on the values. |
forbidden |
|
|
These operators should be able to translate an expression into function operating on the values. |
These operators should be able to translate an expression into function operating on the values. |
|
|
|
|
|
|
|
|
|
|
|
|
returns a group columns to return an average |
|
returns a group columns to return an average |
|
returns a group columns to return an average |
|
returns a group columns to return an average |
returns a group columns to return an average |
|
|
Returns a copy of this class. |
|
Returns a copy of this class. |
|
Returns a copy of this class. |
|
Returns a copy of this class. |
Returns a copy of this class. |
|
|
returns a group columns to count the number of observations |
|
returns a group columns to count the number of observations |
|
returns a group columns to count the number of observations |
|
returns a group columns to count the number of observations |
returns a group columns to count the number of observations |
|
|
checks it is a column type which used by an operator |
|
checks it is a column type which used by an operator |
|
checks it is a column type which used by an operator |
|
checks it is a column type which used by an operator |
checks it is a column type which used by an operator |
|
|
returns a group columns to count the number of observations |
|
returns a group columns to count the number of observations |
|
returns a group columns to count the number of observations |
|
returns a group columns to count the number of observations |
returns a group columns to count the number of observations |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Returns a string showing the dependencies of this columns. Example |
|
Returns a string showing the dependencies of this columns. Example |
|
Returns a string showing the dependencies of this columns. Example |
|
Returns a string showing the dependencies of this columns. Example |
Returns a string showing the dependencies of this columns. Example |
|
|
Sets a value for this column. |
do nothing (it is a constant) |
|
sets a value for this column |
|
|
Sets a value for this column. |
Sets a value for this column. |
|
|
Changes the name of the column. |
|
Changes the name of the column. |
|
Changes the name of the column. |
|
Changes the name of the column. |
Changes the name of the column. |
|
after a loop on a database, we should put None back as a value |
|
do nothing (it is a constant) |
|
after a loop on a database, we should put None back as a value |
|
after a loop on a database, we should put None back as a value |
|
After a loop on a database, we should put None back as a value. |
|
|
Changes the owner of the column. |
|
Changes the owner of the column. |
|
Changes the owner of the column. |
|
Changes the owner of the column. |
Changes the owner of the column. |
Documentation¶
Classes which defines column for class IterRow
- class pysqllike.generic.column_type.CFT(func, *args)¶
Bases:
ColumnType
defines a function
constructor (a function cannot accept keywords)
- Parameters:
func – contained function
args – list of
ColumnType
- property ShortName¶
a short name (tells the column type)
- __init__(func, *args)¶
constructor (a function cannot accept keywords)
- Parameters:
func – contained function
args – list of
ColumnType
- __str__()¶
usual
- set_none()¶
after a loop on a database, we should put None back as a value
- class pysqllike.generic.column_type.ColumnConstantType(const)¶
Bases:
ColumnType
defines a constant as a column
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
- property ShortName¶
a short name (tells the column type)
- __call__()¶
return the constant
- __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
- __str__()¶
usual
- set(value)¶
do nothing (it is a constant)
- Parameters:
value – anything in [int,float,long,str, function ]
- set_none()¶
do nothing (it is a constant)
- class pysqllike.generic.column_type.ColumnGroupType(name, typ, parent, op)¶
Bases:
ColumnType
defines a column which processes a group of rows (after a groupby)
constructor
- Parameters:
name – name of the column
typ – type of the column
owner – owner of this column
op – operator
- property ShortName¶
a short name (tells the column type)
- __add__(column)¶
forbidden
- __call__()¶
returns the content
- __floordiv__(column)¶
forbidden
- __init__(name, typ, parent, op)¶
constructor
- Parameters:
name – name of the column
typ – type of the column
owner – owner of this column
op – operator
- __mod__(column)¶
forbidden
- __mul__(column)¶
forbidden
- __pow__(column)¶
forbidden
- __str__()¶
usual
- __sub__(column)¶
forbidden
- __truediv__(column)¶
forbidden
- set(value)¶
sets a value for this column
- Parameters:
value – anything in [int,float,long,str, function ]
- set_none()¶
after a loop on a database, we should put None back as a value
- class pysqllike.generic.column_type.ColumnTableType(name, typ, owner)¶
Bases:
ColumnType
defines a table column (not coming from an expression)
constructor
- Parameters:
name – name of the column
typ – type of the column
owner – owner of this column
- property ShortName¶
a short name (tells the column type)
- __call__()¶
returns the content
- __init__(name, typ, owner)¶
constructor
- Parameters:
name – name of the column
typ – type of the column
owner – owner of this column
- __str__()¶
usual
- set_none()¶
after a loop on a database, we should put None back as a value
- class pysqllike.generic.column_type.ColumnType(name, typ, func=None, parent=(), op=None, owner=None)¶
Bases:
object
Defines a column of a table.
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
- And(column)¶
and
cannot be overriden
- property Func¶
property
- IsColumnType()¶
checks it is a column type which used by an operator
- property Name¶
property
- Not()¶
not
cannot be overriden
- Or(column)¶
or
cannot be overriden
- property Parent¶
property
- property ShortName¶
a short name (tells the column type)
- property Type¶
property
- __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
- __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
- __call__()¶
returns func(value)
- __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
- __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
- __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
- __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
- __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
- __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
- __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
- __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
- __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
- __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
- __not__()¶
these operators should be able to translate an expression into function operating on the values
- Returns:
a ColumnType
- __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
- __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
- __str__()¶
usual
- __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
- __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
- _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
- copy(new_owner)¶
Returns a copy of this class.
- Parameters:
new_owner – new owner
- Returns:
ColumnType
- count()¶
returns a group columns to count the number of observations
- len()¶
returns a group columns to count the number of observations
- print_parent()¶
Returns a string showing the dependencies of this columns.
Example:
this_columns parent1 parent11 parent12 parent2
- set(value)¶
Sets a value for this column.
- Parameters:
value – anything in
[int, float, long, str, function]
- set_name(new_name)¶
Changes the name of the column.
- Parameters:
newname – new name
- set_none()¶
After a loop on a database, we should put None back as a value.
- set_owner(new_owner)¶
Changes the owner of the column.
- Parameters:
newname – new name
- pysqllike.generic.column_type.private_function_type()¶
no documentation