Bases: object
The base class for all converters. Each subclass handles converting a specific VOTABLE data type to/from the TABLEDATA and BINARY on-disk representations.
Parameters : | field : Field
config : dict
pos : tuple
|
---|
Methods Summary
binparse(read) | Reads some number of bytes from the BINARY format representation by calling the function read, and returns the native in-memory object representation for the datatype handled by self. |
parse(value[, config, pos]) | Convert the string value from the TABLEDATA format into an object with the correct native in-memory datatype and mask flag. |
output(value, mask) | Convert the object value (in the native in-memory datatype) to a unicode string suitable for serializing in the TABLEDATA format. |
parse_scalar(value[, config, pos]) | Parse a single scalar of the underlying type of the converter. |
binoutput(value, mask) | Convert the object value in the native in-memory datatype to a string of bytes suitable for serialization in the BINARY format. |
Methods Documentation
Reads some number of bytes from the BINARY format representation by calling the function read, and returns the native in-memory object representation for the datatype handled by self.
Parameters : | read : function
|
---|---|
Returns : | native : tuple (value, mask)
|
Convert the string value from the TABLEDATA format into an object with the correct native in-memory datatype and mask flag.
Parameters : | value : str
|
---|---|
Returns : | native : tuple (value, mask)
|
Convert the object value (in the native in-memory datatype) to a unicode string suitable for serializing in the TABLEDATA format.
Parameters : | value : native type corresponding to this converter
mask : bool
|
---|---|
Returns : | tabledata_repr : unicode |
Parse a single scalar of the underlying type of the converter. For non-array converters, this is equivalent to parse. For array converters, this is used to parse a single element of the array.
Parameters : | value : str
|
---|---|
Returns : | native : tuple (value, mask)
|
Convert the object value in the native in-memory datatype to a string of bytes suitable for serialization in the BINARY format.
Parameters : | value : native type corresponding to this converter
mask : bool
|
---|---|
Returns : | bytes : byte string
|