Skip to content

Operation parse.date_array in plugin tabular v0.5.0

Create an array of date objects from an array of strings.

This module is very simplistic at the moment, more functionality and options will be added in the future.

At its core, this module uses the standard parser from the dateutil package to parse strings into dates. As this parser can't handle complex strings, the input strings can be pre-processed in the following ways:

  • 'cut' non-relevant parts of the string (using 'min_index' & 'max_index' input/config options)
  • remove matching tokens from the string, and replace them with a single whitespace (using the 'remove_tokens' option)

By default, if an input string can't be parsed this module will raise an exception. This can be prevented by setting this modules 'force_non_null' config option or input to 'False', in which case un-parsable strings will appear as 'NULL' value in the resulting array.

Author(s) Markus Binsteiner (markus@frkl.io)
Tags tabular
Operation type custom_module

Inputs

Name Description Type Required? Default
array

The input array.

array true null
max_index

The maximum index until whic to parse the string(s).

integer false null
min_index

The minimum index from where to start parsing the string(s).

integer false null
remove_tokens

A list of tokens/characters to replace with a single white-space before parsing the input.

list false null
force_non_null

If set to 'True', raise an error if any of the strings in the array can't be parsed.

boolean false true

Outputs

Name Description Type Required? Default
date_array

The resulting array with items of a date data type.

array true null

Module configuration

Module parse.date_array

No configuration options set