Skip to content

Commit

Permalink
Update docs
Browse files Browse the repository at this point in the history
  • Loading branch information
marcsiftstack committed Oct 16, 2024
1 parent 0a9e736 commit 9aca8d2
Showing 1 changed file with 34 additions and 1 deletion.
35 changes: 34 additions & 1 deletion python/lib/sift_py/data_import/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down

0 comments on commit 9aca8d2

Please sign in to comment.