geoslurp.types package
Submodules
geoslurp.types.columnmapper module
geoslurp.types.json module
- class geoslurp.types.json.DataArrayJSONType(*args: Any, **kwargs: Any)
Bases:
TypeDecoratorConverts a column of xarray Dataarrays to an in db JSON representation
- impl
alias of
JSONB
- process_bind_param(value, dialect)
Stores an xarray DataArray to a JSON object
- process_result_value(value, dialect)
Receive a result-row column value to be converted.
Custom subclasses of
_types.TypeDecoratorshould override this method to provide custom behaviors for data values being received in result rows coming from the database. This method is called at result fetching time and is passed the literal Python data value that’s extracted from a database result row.The operation could be anything desired to perform custom behavior, such as transforming or deserializing data.
- Parameters:
value – Data to operate upon, of any type expected by this method in the subclass. Can be
None.dialect – the
Dialectin use.
See also
types_typedecorator
_types.TypeDecorator.process_bind_param()
geoslurp.types.numpy module
- class geoslurp.types.numpy.datetime64Type(*args: Any, **kwargs: Any)
Bases:
TypeDecoratorConverts a column of numpy datetime64[ns] to a DateTime representation
- impl
alias of
DateTime
- process_bind_param(value, dialect)
Converts a numpy datetime64 object to a python datetime
- process_result_value(value, dialect)
Receive a result-row column value to be converted.
Custom subclasses of
_types.TypeDecoratorshould override this method to provide custom behaviors for data values being received in result rows coming from the database. This method is called at result fetching time and is passed the literal Python data value that’s extracted from a database result row.The operation could be anything desired to perform custom behavior, such as transforming or deserializing data.
- Parameters:
value – Data to operate upon, of any type expected by this method in the subclass. Can be
None.dialect – the
Dialectin use.
See also
types_typedecorator
_types.TypeDecorator.process_bind_param()
- geoslurp.types.numpy.np_to_datetime(value)
geoslurp.types.xar module
- class geoslurp.types.xar.XarDBType(parentds, outofdb=None, groupby=None, writeoutofdb=True)
Bases:
UserDefinedTypeConverts a column of xarray group to a database column representation (JSON)
- bind_processor(dialect)
Return a conversion function for processing bind values.
Returns a callable which will receive a bind parameter value as the sole positional argument and will return a value to send to the DB-API.
If processing is not necessary, the method should return
None.Tip
This method is only called relative to a dialect specific type object, which is often private to a dialect in use and is not the same type object as the public facing one, which means it’s not feasible to subclass a
types.TypeEngineclass in order to provide an alternate_types.TypeEngine.bind_processor()method, unless subclassing the_types.UserDefinedTypeclass explicitly.To provide alternate behavior for
_types.TypeEngine.bind_processor(), implement a_types.TypeDecoratorclass and provide an implementation of_types.TypeDecorator.process_bind_param().See also
types_typedecorator
- Parameters:
dialect – Dialect instance in use.
- get_col_spec(**kw)
- result_processor(dialect, coltype)
Return a conversion function for processing result row values.
Returns a callable which will receive a result row column value as the sole positional argument and will return a value to return to the user.
If processing is not necessary, the method should return
None.Tip
This method is only called relative to a dialect specific type object, which is often private to a dialect in use and is not the same type object as the public facing one, which means it’s not feasible to subclass a
types.TypeEngineclass in order to provide an alternate_types.TypeEngine.result_processor()method, unless subclassing the_types.UserDefinedTypeclass explicitly.To provide alternate behavior for
_types.TypeEngine.result_processor(), implement a_types.TypeDecoratorclass and provide an implementation of_types.TypeDecorator.process_result_value().See also
types_typedecorator
- Parameters:
dialect – Dialect instance in use.
coltype – DBAPI coltype argument received in cursor.description.
- geoslurp.types.xar.custom_encoder(inval)
geoslurp.types.zarr module
- class geoslurp.types.zarr.OutDBZarrType(defaultZstore=None, modifyUri=None, append_dim=None)
Bases:
UserDefinedTypeConverts a column of xarray Dataarrays to an out-of-db data representation
- bind_processor(dialect)
Return a conversion function for processing bind values.
Returns a callable which will receive a bind parameter value as the sole positional argument and will return a value to send to the DB-API.
If processing is not necessary, the method should return
None.Tip
This method is only called relative to a dialect specific type object, which is often private to a dialect in use and is not the same type object as the public facing one, which means it’s not feasible to subclass a
types.TypeEngineclass in order to provide an alternate_types.TypeEngine.bind_processor()method, unless subclassing the_types.UserDefinedTypeclass explicitly.To provide alternate behavior for
_types.TypeEngine.bind_processor(), implement a_types.TypeDecoratorclass and provide an implementation of_types.TypeDecorator.process_bind_param().See also
types_typedecorator
- Parameters:
dialect – Dialect instance in use.
- get_col_spec(**kw)
- result_processor(dialect, coltype)
Return a conversion function for processing result row values.
Returns a callable which will receive a result row column value as the sole positional argument and will return a value to return to the user.
If processing is not necessary, the method should return
None.Tip
This method is only called relative to a dialect specific type object, which is often private to a dialect in use and is not the same type object as the public facing one, which means it’s not feasible to subclass a
types.TypeEngineclass in order to provide an alternate_types.TypeEngine.result_processor()method, unless subclassing the_types.UserDefinedTypeclass explicitly.To provide alternate behavior for
_types.TypeEngine.result_processor(), implement a_types.TypeDecoratorclass and provide an implementation of_types.TypeDecorator.process_result_value().See also
types_typedecorator
- Parameters:
dialect – Dialect instance in use.
coltype – DBAPI coltype argument received in cursor.description.
- geoslurp.types.zarr.getAttr(ds, key)
- geoslurp.types.zarr.get_append_dim(ds)
- geoslurp.types.zarr.get_storage(ds)