Formatters

Dump a dynts.TimeSeries instance into different formats. Let’s say we have a time series object ts:

s = ts.dump('flot', **kwargs)

will create a dynts.web.flot.MultiPlot instance for producing nice looking javascript graphs with flot.

check dynts.DynData.dump.

Registering Formatters

To register new way of formatting timeseries:

from dynts import Formatters

Formatters['newformat'] = your_formatting_function

where your_formatting_function takes the ts as positional input and any other key-value parameters.

You can use the new function:

ts.dump('newformat')

Available Formatters

There are two JSON formatters: flot and vba. They both return JSON strings but in different formats.

Flot

The flot format is used by the ecoplot jQuery plugin in dynts.web module. The dump function accepts the following key-value parameters:

  • desc if True the order of dates will be descending. Default False.
  • series_info dictionary with additional series parameters for flot.

VBA

The flot format is used to send JSON to VBA for displaying in an excel Worksheet.

CSV

XLS

Dump timeseries into spreadsheet files that are are compatible with Excel, OpenOffice.org Calc, and Gnumeric. It requires the xlwt python package.

Table Of Contents

Previous topic

Functions

Next topic

Internals

This Page