Datetime parsing

Overview

This page outlines our guidelines for parsing datetime values from raw files to a primary model.

Guidelines

  • Always use the task_script_utils datetime_parser.DatetimeParser.to_tsformat() method to parse raw datetime strings to ISO-8601 strings

  • The possible formats should be explicitly defined in the formats argument of the DatetimeParser object, in the form of pendulum tokens.

  • A mapping of timezone abbreviations to UTC offsets can be provided in the tz_dict argument of the DatetimeParser object.