Package gavo :: Package votable :: Module paramval
[frames] | no frames]

Module paramval

source code


Serialisation of python values to VOTable PARAM values.

This has two aspects:

- Guessing proper VOTable type descriptors for python values
  (use guessParamAttrsForValue)
- Serialising the python values to strings suitable for the PARAM.
  (use serializeToParam)

Classes
  PrimitiveAnnotatedColumn
A stand-in for serializers.AnnotatedColumn.
Functions
 
guessParamAttrsForValue(pythonVal)
returns a dict of proposed attributes for a PARAM to keep pythonVal.
source code
 
getVOTSerializer(*args)
returns a function serializing for values of params with the attributes given.
source code
 
serializeToParam(param, val)
changes the VOTable PARAM param such that val is represented.
source code
 
getVOTParser(*args)
returns a function deserializing values in a param with datatype, arraysize, and xtype.
source code
Variables
  __package__ = 'gavo.votable'
Function Details

guessParamAttrsForValue(pythonVal)

source code 

returns a dict of proposed attributes for a PARAM to keep pythonVal.

There is, of course, quite a bit of heuristics involved. For instance, we assume sequences are homogeneous.

getVOTSerializer(*args)

source code 

returns a function serializing for values of params with the attributes given.

Decorators:
  • @utils.memoized

serializeToParam(param, val)

source code 

changes the VOTable PARAM param such that val is represented.

This may involve adding a null value.

getVOTParser(*args)

source code 

returns a function deserializing values in a param with datatype, arraysize, and xtype.

Decorators:
  • @utils.memoized