Package gavo :: Package formats :: Module texttable
[frames] | no frames]

Module texttable

source code

Writing data as plain text.

Currently, we only do TSV. It would probably be nice to support "formatted ASCII as well, though that may be a bit tricky given that we do not really store sane formatting hints for most columns.

Functions
 
humanDatesFactory(colDesc) source code
 
humanTimesFactory(colDesc) source code
 
jdMapperFactory(colDesc)
maps JD, MJD, unix timestamp, and julian year columns to human-readable datetimes.
source code
 
renderAsColumns(table, target, acquireSamples=False)
writes a fixed-column representation of table to target.
source code
 
renderAsText(table, target, acquireSamples=True)
writes a text (TSV) rendering of table to the file target.
source code
 
getAsText(data) source code
 
readTSV(inFile)
returns a list of tuples for a tab-separated-values file.
source code
Variables
  displayMFRegistry = <gavo.utils.serializers.ValueMapperFactory...
  floatTypes = set(['double', 'double precision', 'float', 'real'])
  __package__ = 'gavo.formats'
Function Details

jdMapperFactory(colDesc)

source code 

maps JD, MJD, unix timestamp, and julian year columns to human-readable datetimes.

MJDs are caught by inspecting the UCD or the name.

readTSV(inFile)

source code 

returns a list of tuples for a tab-separated-values file.

Lines starting with # and lines containing only whitespace are ignored. Whitespace at front and back is stripped.

No checks are done at this point, i.e., the tuples could be of varying lengths.


Variables Details

displayMFRegistry

Value:
<gavo.utils.serializers.ValueMapperFactoryRegistry object>