funpack.exporting

This module provides functions for exporting data to a file.

funpack.exporting.defaultDateTimeFormat(dtable, column, series)[source]

Default format converter for date and time columns.

funpack.exporting.escapeString(dtable, column, series)[source]

Encodes every value of series as a string, with any escape characters (\n, \t, etc) formatted literally. This has the effect that the series is coerced to a string type (if not already).

funpack.exporting.exportData(dtable, outfile, fileFormat, **kwargs)[source]

Export the data contained in dtable to outfile using the specified fileFormat.

Parameters:
  • dtableDataTable containing the data to export.

  • outfile – File to export data to.

  • fileFormat – File format to export to - the name of a @exporter plugin.

All other arguments are passed through to the exporter plugin.

funpack.exporting.formatColumn(col, dtable, dateFormat, timeFormat, formatters, logmsg=None)[source]

Formats the data for the specified column. The dtable is updated in-place.

Parameters:
  • colColumn to format

  • dtableDataTable containing the data

  • dateFormat – Name of formatter to use for date columns.

  • timeFormat – Name of formatter to use for time columns.

  • formatters – Dict of { [vid|column] : formatter } mappings, specifying custom formatters to use for specific variables.

  • logmsg – Message to include in log message.

Returns:

A reference to dtable.

funpack.exporting.formatCompound(dtable, column, series, delim=',')[source]

Format a compound (multi-valued) column which is stored in-memory as a list or numpy array.