diff --git a/python/lib/sift_py/data_import/__init__.py b/python/lib/sift_py/data_import/__init__.py index 0810b483..0aec3738 100644 --- a/python/lib/sift_py/data_import/__init__.py +++ b/python/lib/sift_py/data_import/__init__.py @@ -32,7 +32,40 @@ This example assumes several things about how the data is formatted. For example, that first column contains datetime formatted time stamps. See docstring for `simple_upload` to see what can be overridden. -## Custom CSV Upload +## TDMS Upload + +TDMS files can be uploaded like so: +```python +from sift_py.data_import.csv import TdmsUploadService +from sift_py.data_import.status import DataImportService +from sift_py.rest import SiftRestConfig + +rest_config: SiftRestConfig = { + "uri": sift_uri, + "apikey": apikey, +} + +asset_name = "Your Asset Name" +csv_upload_service = CsvUploadService(rest_config) +import_service: DataImportService = csv_upload_service.simple_upload(asset_name, "sample_data.tdms") + +# Blocks until the import is completed. +import_service.wait_until_complete() +``` + +If you want to upload TDMS groups as sift Components set `group_into_components` to True: +```python +csv_upload_service.simple_upload(asset_name, "sample_data.tdms", group_into_components=True) +``` + +Some times there are TDMS channels without valid data or timing information, you can skip these channels by +setting `ignore_errors` to True: +```python +csv_upload_service.simple_upload(asset_name, "sample_data.tdms", ignore_errors=True) +``` +The channels being skipped will be printed out to stdout. + +## CSV Upload with custom CSV config If your data is formatted a specific way you can create a CsvConfig that will be used to properly parse your data: