Skip to main content
Time series is in Beta. Contact your Encord support representative to enable the feature for your Organization.

Prepare Your CSV

Encord does not validate time series CSVs on upload. upload_time_series() succeeds even when the CSV cannot be displayed correctly, because the Label Editor only parses the file when you open it. Before you upload, check that:
  • The timestamp column is either the first column or has a header of t, time, or timestamp, optionally followed by _ or - and a unit suffix.
  • The header suffix sets the unit: _ns, _us, _ms, _s, or _iso. A header without a recognized suffix, such as frame, is treated as a frame index.
  • Nanosecond, microsecond, millisecond, and second timestamps are whole numbers. Rows with decimal values in these columns are skipped.
  • Channel headers are unique.
If the time series shares a timeline with a video, for example in a Data Group, index it by video frame. Put a frame column first and set each value to the matching video frame, starting at 0. Unit-based timestamps such as time_ms are measured from the first CSV row, and they can drift from the video. See Align Time Series with Video for details and an example.
For the full parsing rules and a troubleshooting table, see Time Series.

Channel View Settings

Time-series items are CSV files that hold one or more channels of values over time. Each column other than the timestamp column is a channel, and each channel is plotted as a chart in the Label Editor timeline. With the SDK you can:
  1. Upload a CSV file to a storage folder.
  2. Set how each channel is displayed (line or points, color, label, visibility) when you upload.
  3. Read and update those display settings on items you have already uploaded.

Before You Start

You need:
  • SDK v0.1.205 or later. Earlier versions require label and color on every channel.
  • The SSH private key associated with your Encord account.
  • The ID of the storage folder you want to upload to.
  • A CSV file that follows the supported format: a header row, a timestamp column, and at least one channel column. Header names must be unique.
Example CSV
If your CSV files are already in cloud storage (AWS, GCP, Azure, or another integration), you can register them instead of uploading them from your machine. See Register Time Series Data.

How Channel View Settings Work

Channel view settings control how each channel appears in the Label Editor. They are defined with TimeSeriesViewSettings, which maps each channel to its display style:
  • Channel keys are the CSV header names. For example, the speed column is configured with the key "speed".
  • A view can define at most 100 channels.
  • Channels you do not include use the default style.
Each channel is either a TimeSeriesLineChannelViewSettings (rendered as a line) or a TimeSeriesPointsChannelViewSettings (rendered as points). Both accept: Line channels also take line_width (0.5–6). Points channels also take point_radius (1–8).
New in SDK v0.1.205: label and color are optional. Omit label and the channel uses its CSV header name. Omit color and it uses the editor’s palette. Omitting the style renders the channel as a line.

Upload and Configure Time-series Data

The example script below runs through the full process from start to finish. Each section of the script is marked with a # --- comment that matches the steps below.

Step 1: Connect to Encord

Authenticate with your SSH private key and get the storage folder you want to upload to. Replace SSH_PATH, FOLDER_ID, and CSV_PATH in the Configuration section with your own values.

Step 2: Build channel view settings

Create a TimeSeriesViewSettings object with one entry for each channel you want to style. The example shows four common cases:
  • speed: A line channel with a custom label, color, and line width.
  • rpm: A line channel with no options, so it uses the CSV header name and the editor’s palette.
  • gear: A channel rendered as points instead of a line.
  • debug_flag: A channel hidden from the default view.
You only need the cases that apply to your data.

Step 3: Upload the time-series file

Call folder.upload_time_series() with the path to your CSV file, a title, and the settings you built. The method returns the UUID of the new storage item. settings is optional. If you leave it out, every channel uses the default style.

Step 4: Read the current settings

Get the storage item with user_client.get_storage_item() and read item.timeseries_settings to check which settings are applied.

Step 5: Update the settings on an existing item

Call item.update(timeseries_settings=...) to change the display settings of a file you have already uploaded. You do not need to upload the file again.
The settings you pass to item.update() replace the existing settings. Include every channel you want to keep styled, not only the channels you are changing.

Example Script

Configure Time-series Channel View Settings

Next Steps

  • Annotate time series data in the Label Editor.
  • Add a Time range object to your Ontology so annotators can label intervals on the timeline.