NumpyType
- class NumpyType[source]
Numpy Type for sql databases when using sqlalchemy.
This handles the IO with a sql database and sqlalchemy.
Inside the database, an numpy array is stored as LargeBinary. sqlalchemy handles loading and storing of entries for columns marked with this custom type. All arrays are converted to numpy arrays when loading and converted to binary when storing in the database automatically.
Methods
bind_processor
(dialect)Provide a bound value processing function for the given
Dialect
.alias of
LargeBinary
result_processor
(dialect, coltype)Provide a result value processing function for the given
Dialect
.- bind_processor(dialect)[source]
Provide a bound value processing function for the given
Dialect
.This is the method that fulfills the
TypeEngine
contract for bound value conversion which normally occurs via the_types.TypeEngine.bind_processor()
method.Note
User-defined subclasses of
_types.TypeDecorator
should not implement this method, and should instead implement_types.TypeDecorator.process_bind_param()
so that the “inner” processing provided by the implementing type is maintained.- Parameters
dialect – Dialect instance in use.
- impl
alias of
LargeBinary
- result_processor(dialect, coltype)[source]
Provide a result value processing function for the given
Dialect
.This is the method that fulfills the
TypeEngine
contract for bound value conversion which normally occurs via the_types.TypeEngine.result_processor()
method.Note
User-defined subclasses of
_types.TypeDecorator
should not implement this method, and should instead implement_types.TypeDecorator.process_result_value()
so that the “inner” processing provided by the implementing type is maintained.- Parameters
dialect – Dialect instance in use.
coltype – A SQLAlchemy data type