viam-sdk 0.45.1__py3-none-linux_armv6l.whl → 0.46.0__py3-none-linux_armv6l.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of viam-sdk might be problematic. Click here for more details.
- viam/app/app_client.py +178 -9
- viam/app/data_client.py +167 -148
- viam/gen/app/v1/app_pb2.py +511 -511
- viam/gen/app/v1/app_pb2.pyi +37 -18
- viam/gen/module/v1/module_pb2.py +4 -4
- viam/gen/module/v1/module_pb2.pyi +7 -2
- viam/gen/robot/v1/robot_pb2.pyi +1 -1
- viam/gen/service/slam/v1/slam_pb2.pyi +1 -1
- viam/rpc/libviam_rust_utils.so +0 -0
- viam/version_metadata.py +2 -2
- {viam_sdk-0.45.1.dist-info → viam_sdk-0.46.0.dist-info}/METADATA +1 -1
- {viam_sdk-0.45.1.dist-info → viam_sdk-0.46.0.dist-info}/RECORD +14 -14
- {viam_sdk-0.45.1.dist-info → viam_sdk-0.46.0.dist-info}/WHEEL +0 -0
- {viam_sdk-0.45.1.dist-info → viam_sdk-0.46.0.dist-info}/licenses/LICENSE +0 -0
viam/app/data_client.py
CHANGED
|
@@ -92,10 +92,10 @@ LOGGER = logging.getLogger(__name__)
|
|
|
92
92
|
class DataClient:
|
|
93
93
|
"""gRPC client for uploading and retrieving data from app.
|
|
94
94
|
|
|
95
|
-
|
|
96
|
-
|
|
95
|
+
This class's constructor instantiates relevant service stubs. Always make :class:`DataClient` method calls through an instance of
|
|
96
|
+
:class:`ViamClient`.
|
|
97
97
|
|
|
98
|
-
Establish a
|
|
98
|
+
Establish a connection::
|
|
99
99
|
|
|
100
100
|
import asyncio
|
|
101
101
|
|
|
@@ -159,10 +159,10 @@ class DataClient:
|
|
|
159
159
|
"""The resource name"""
|
|
160
160
|
|
|
161
161
|
resource_api: str
|
|
162
|
-
"""The resource API.
|
|
162
|
+
"""The resource API. For example, rdk:component:sensor"""
|
|
163
163
|
|
|
164
164
|
method_name: str
|
|
165
|
-
"""The method used for data capture.
|
|
165
|
+
"""The method used for data capture. For example, Readings"""
|
|
166
166
|
|
|
167
167
|
time_captured: datetime
|
|
168
168
|
"""The time at which the data point was captured"""
|
|
@@ -221,7 +221,7 @@ class DataClient:
|
|
|
221
221
|
return self.resource_api
|
|
222
222
|
|
|
223
223
|
def __init__(self, channel: Channel, metadata: Mapping[str, str]):
|
|
224
|
-
"""Create a
|
|
224
|
+
"""Create a :class:`DataClient` that maintains a connection to app.
|
|
225
225
|
|
|
226
226
|
Args:
|
|
227
227
|
channel (grpclib.client.Channel): Connection to app.
|
|
@@ -249,9 +249,8 @@ class DataClient:
|
|
|
249
249
|
include_internal_data: bool = False,
|
|
250
250
|
dest: Optional[str] = None,
|
|
251
251
|
) -> Tuple[List[TabularData], int, str]:
|
|
252
|
-
"""Filter and download tabular data. The data will be paginated into pages of
|
|
253
|
-
|
|
254
|
-
If the file is not empty, it will be overwritten.
|
|
252
|
+
"""Filter and download tabular data. The data will be paginated into pages of ``limit`` items; the returned tuple will include
|
|
253
|
+
the pagination ID. If a destination is provided, this method saves returned data to that file, overwriting any existing file content.
|
|
255
254
|
|
|
256
255
|
::
|
|
257
256
|
|
|
@@ -269,23 +268,23 @@ class DataClient:
|
|
|
269
268
|
print(f"My data: {my_data}")
|
|
270
269
|
|
|
271
270
|
Args:
|
|
272
|
-
filter (viam.proto.app.data.Filter): Optional
|
|
273
|
-
data.
|
|
271
|
+
filter (~viam.proto.app.data.Filter): Optional, specifies tabular data to retrieve. If missing, matches all tabular data.
|
|
274
272
|
limit (int): The maximum number of entries to include in a page. Defaults to 50 if unspecified.
|
|
275
|
-
sort_order (viam.proto.app.data.Order): The desired sort order of the data.
|
|
273
|
+
sort_order (~viam.proto.app.data.Order): The desired sort order of the data.
|
|
276
274
|
last (str): Optional string indicating the object identifier of the last-returned data.
|
|
277
|
-
|
|
278
|
-
|
|
275
|
+
Returned by calls to :class:`TabularDataByFilter` as the ``last`` value.
|
|
276
|
+
If provided, the server returns the next data entries after the last object identifier.
|
|
279
277
|
count_only (bool): Whether to return only the total count of entries.
|
|
280
278
|
include_internal_data (bool): Whether to return the internal data. Internal data is used for Viam-specific data ingestion,
|
|
281
|
-
|
|
279
|
+
like cloud SLAM. Defaults to ``False``.
|
|
282
280
|
dest (str): Optional filepath for writing retrieved data.
|
|
283
281
|
|
|
284
282
|
Returns:
|
|
285
283
|
Tuple[List[TabularData], int, str]: A tuple containing the following:
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
284
|
+
|
|
285
|
+
- ``tabular_data`` (*List[TabularData]*): The tabular data.
|
|
286
|
+
- ``count`` (*int*): The count (number of entries).
|
|
287
|
+
- ``last`` (*str*): The last-returned page ID.
|
|
289
288
|
|
|
290
289
|
For more information, see `Data Client API <https://docs.viam.com/dev/reference/apis/data-client/#tabulardatabyfilter>`_.
|
|
291
290
|
"""
|
|
@@ -332,7 +331,7 @@ class DataClient:
|
|
|
332
331
|
|
|
333
332
|
Args:
|
|
334
333
|
organization_id (str): The ID of the organization that owns the data.
|
|
335
|
-
|
|
334
|
+
To find your organization ID, visit the organization settings page in the Viam app.
|
|
336
335
|
sql_query (str): The SQL query to run.
|
|
337
336
|
|
|
338
337
|
Returns:
|
|
@@ -363,11 +362,11 @@ class DataClient:
|
|
|
363
362
|
|
|
364
363
|
Args:
|
|
365
364
|
organization_id (str): The ID of the organization that owns the data.
|
|
366
|
-
|
|
365
|
+
To find your organization ID, visit the organization settings page in the Viam app.
|
|
367
366
|
query (Union[List[bytes], List[Dict[str, Any]]]): The MQL query to run, as a list of MongoDB aggregation pipeline stages.
|
|
368
|
-
|
|
369
|
-
so
|
|
370
|
-
use_recent_data (bool): Whether to query blob storage or your recent data store. Defaults to
|
|
367
|
+
Each stage can be provided as either a dictionary or raw BSON bytes, but support for bytes will be removed in the
|
|
368
|
+
future, so prefer the dictionary option.
|
|
369
|
+
use_recent_data (bool): Whether to query blob storage or your recent data store. Defaults to ``False``.
|
|
371
370
|
|
|
372
371
|
Returns:
|
|
373
372
|
List[Dict[str, Union[ValueTypes, datetime]]]: An array of decoded BSON data objects.
|
|
@@ -404,16 +403,19 @@ class DataClient:
|
|
|
404
403
|
|
|
405
404
|
Args:
|
|
406
405
|
part_id (str): The ID of the part that owns the data.
|
|
407
|
-
resource_name (str): The name of the requested resource that captured the data.
|
|
408
|
-
resource_api (str): The API of the requested resource that captured the data.
|
|
409
|
-
method_name (str): The data capture method name.
|
|
406
|
+
resource_name (str): The name of the requested resource that captured the data. For example, "my-sensor".
|
|
407
|
+
resource_api (str): The API of the requested resource that captured the data. For example, "rdk:component:sensor".
|
|
408
|
+
method_name (str): The data capture method name. For exampe, "Readings".
|
|
410
409
|
|
|
411
410
|
Returns:
|
|
412
|
-
Optional[Tuple[datetime, datetime, Dict[str, ValueTypes]]]:
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
411
|
+
Optional[Tuple[datetime, datetime, Dict[str, ValueTypes]]]:
|
|
412
|
+
A return value of ``None`` means that this data source
|
|
413
|
+
has not synced data in the last year. Otherwise, the data source has synced some data in the last year, so the returned
|
|
414
|
+
tuple contains the following:
|
|
415
|
+
|
|
416
|
+
- ``time_captured`` (*datetime*): The time captured.
|
|
417
|
+
- ``time_synced`` (*datetime*): The time synced.
|
|
418
|
+
- ``payload`` (*Dict[str, ValueTypes]*): The latest tabular data captured from the specified data source.
|
|
417
419
|
|
|
418
420
|
For more information, see `Data Client API <https://docs.viam.com/dev/reference/apis/data-client/#getlatesttabulardata>`_.
|
|
419
421
|
"""
|
|
@@ -501,9 +503,9 @@ class DataClient:
|
|
|
501
503
|
include_internal_data: bool = False,
|
|
502
504
|
dest: Optional[str] = None,
|
|
503
505
|
) -> Tuple[List[BinaryData], int, str]:
|
|
504
|
-
"""Filter and download binary data. The data will be paginated into pages of
|
|
505
|
-
in the returned tuple
|
|
506
|
-
|
|
506
|
+
"""Filter and download binary data. The data will be paginated into pages of ``limit`` items, and the pagination ID will be included
|
|
507
|
+
in the returned tuple as ``last``. If a destination is provided, this method saves returned data to that file,
|
|
508
|
+
overwriting any existing file content.
|
|
507
509
|
|
|
508
510
|
::
|
|
509
511
|
|
|
@@ -542,25 +544,25 @@ class DataClient:
|
|
|
542
544
|
my_untagged_data.extend(data)
|
|
543
545
|
|
|
544
546
|
Args:
|
|
545
|
-
filter (viam.proto.app.data.Filter): Optional
|
|
546
|
-
data.
|
|
547
|
+
filter (~viam.proto.app.data.Filter): Optional, specifies tabular data to retrieve. An empty filter matches all binary data.
|
|
547
548
|
limit (int): The maximum number of entries to include in a page. Defaults to 50 if unspecified.
|
|
548
|
-
sort_order (viam.proto.app.data.Order): The desired sort order of the data.
|
|
549
|
+
sort_order (~viam.proto.app.data.Order): The desired sort order of the data.
|
|
549
550
|
last (str): Optional string indicating the object identifier of the last-returned data.
|
|
550
|
-
|
|
551
|
-
|
|
551
|
+
This object identifier is returned by calls to :meth:`binary_data_by_filter` as the ``last`` value.
|
|
552
|
+
If provided, the server will return the next data entries after the last object identifier.
|
|
552
553
|
include_binary_data (bool): Boolean specifying whether to actually include the binary file data with each retrieved file.
|
|
553
|
-
|
|
554
|
+
Defaults to true (that is, both the files' data and metadata are returned).
|
|
554
555
|
count_only (bool): Whether to return only the total count of entries.
|
|
555
556
|
include_internal_data (bool): Whether to return the internal data. Internal data is used for Viam-specific data ingestion,
|
|
556
|
-
|
|
557
|
+
like cloud SLAM. Defaults to ``False``.
|
|
557
558
|
dest (str): Optional filepath for writing retrieved data.
|
|
558
559
|
|
|
559
560
|
Returns:
|
|
560
|
-
Tuple[List[viam.proto.app.data.BinaryData], int, str]: A tuple containing the following:
|
|
561
|
-
|
|
562
|
-
|
|
563
|
-
|
|
561
|
+
Tuple[List[~viam.proto.app.data.BinaryData], int, str]: A tuple containing the following:
|
|
562
|
+
|
|
563
|
+
- ``data`` (*List[* :class:`~viam.proto.app.data.BinaryData` *]*): The binary data.
|
|
564
|
+
- ``count`` (*int*): The count (number of entries).
|
|
565
|
+
- ``last`` (*str*): The last-returned page ID.
|
|
564
566
|
|
|
565
567
|
For more information, see `Data Client API <https://docs.viam.com/dev/reference/apis/data-client/#binarydatabyfilter>`_.
|
|
566
568
|
"""
|
|
@@ -611,15 +613,17 @@ class DataClient:
|
|
|
611
613
|
binary_data = await data_client.binary_data_by_ids(my_ids)
|
|
612
614
|
|
|
613
615
|
Args:
|
|
614
|
-
binary_ids (Union[List[BinaryID], List[str]]): Binary data
|
|
615
|
-
|
|
616
|
+
binary_ids (Union[List[~viam.proto.app.data.BinaryID], List[str]]): Binary data ID strings specifying the desired data or
|
|
617
|
+
:class:`BinaryID` objects. Must be non-empty.
|
|
618
|
+
*DEPRECATED:* :class:`BinaryID` *is deprecated and will be removed in a future release. Instead, pass binary data IDs as a
|
|
619
|
+
list of strings.*
|
|
616
620
|
dest (str): Optional filepath for writing retrieved data.
|
|
617
621
|
|
|
618
622
|
Raises:
|
|
619
|
-
GRPCError: If no binary data
|
|
623
|
+
GRPCError: If no binary data ID strings or :class:`BinaryID` objects are provided.
|
|
620
624
|
|
|
621
625
|
Returns:
|
|
622
|
-
List[viam.proto.app.data.BinaryData]: The binary data.
|
|
626
|
+
List[~viam.proto.app.data.BinaryData]: The binary data.
|
|
623
627
|
|
|
624
628
|
For more information, see `Data Client API <https://docs.viam.com/dev/reference/apis/data-client/#binarydatabyids>`_.
|
|
625
629
|
"""
|
|
@@ -651,10 +655,10 @@ class DataClient:
|
|
|
651
655
|
)
|
|
652
656
|
|
|
653
657
|
Args:
|
|
654
|
-
organization_id (str): ID of organization to delete data from.
|
|
655
|
-
|
|
656
|
-
delete_older_than_days (int): Delete data that was captured up to this many days ago. For example
|
|
657
|
-
|
|
658
|
+
organization_id (str): The ID of the organization to delete the data from.
|
|
659
|
+
To find your organization ID, visit the organization settings page in the Viam app.
|
|
660
|
+
delete_older_than_days (int): Delete data that was captured up to *this many* days ago. For example, a value of
|
|
661
|
+
10 deletes any data that was captured up to 10 days ago. A value of 0 deletes *all* existing data.
|
|
658
662
|
|
|
659
663
|
Returns:
|
|
660
664
|
int: The number of items deleted.
|
|
@@ -666,7 +670,7 @@ class DataClient:
|
|
|
666
670
|
return response.deleted_count
|
|
667
671
|
|
|
668
672
|
async def delete_tabular_data_by_filter(self, filter: Optional[Filter]) -> int:
|
|
669
|
-
"""Deprecated: use delete_tabular_data instead."""
|
|
673
|
+
"""Deprecated: use :meth:`delete_tabular_data` instead."""
|
|
670
674
|
raise NotImplementedError()
|
|
671
675
|
|
|
672
676
|
async def delete_binary_data_by_filter(self, filter: Optional[Filter]) -> int:
|
|
@@ -681,9 +685,10 @@ class DataClient:
|
|
|
681
685
|
res = await data_client.delete_binary_data_by_filter(my_filter)
|
|
682
686
|
|
|
683
687
|
Args:
|
|
684
|
-
filter (viam.proto.app.data.Filter): Optional
|
|
685
|
-
|
|
686
|
-
|
|
688
|
+
filter (~viam.proto.app.data.Filter): Optional, specifies binary data to delete.
|
|
689
|
+
**CAUTION: Passing an empty** ``Filter`` **deletes all binary data!**
|
|
690
|
+
You must specify an organization ID with ``organization_ids`` when using this option.
|
|
691
|
+
To find your organization ID, visit the organization settings page in the Viam app.
|
|
687
692
|
|
|
688
693
|
Returns:
|
|
689
694
|
int: The number of items deleted.
|
|
@@ -720,13 +725,13 @@ class DataClient:
|
|
|
720
725
|
binary_data = await data_client.delete_binary_data_by_ids(my_ids)
|
|
721
726
|
|
|
722
727
|
Args:
|
|
723
|
-
binary_ids (Union[List[BinaryID], List[str]]): Binary data
|
|
724
|
-
|
|
725
|
-
|
|
726
|
-
|
|
728
|
+
binary_ids (Union[List[~viam.proto.app.data.BinaryID], List[str]]): Binary data ID strings specifying the data to be deleted or
|
|
729
|
+
:class:`BinaryID` objects. Must be non-empty.
|
|
730
|
+
*DEPRECATED:* :class:`BinaryID` *is deprecated and will be removed in a future release. Instead, pass binary data IDs as a
|
|
731
|
+
list of strings.*
|
|
727
732
|
|
|
728
733
|
Raises:
|
|
729
|
-
GRPCError: If no binary data
|
|
734
|
+
GRPCError: If no binary data ID strings or :class:`BinaryID` objects are provided.
|
|
730
735
|
|
|
731
736
|
Returns:
|
|
732
737
|
int: The number of items deleted.
|
|
@@ -770,13 +775,13 @@ class DataClient:
|
|
|
770
775
|
|
|
771
776
|
Args:
|
|
772
777
|
tags (List[str]): List of tags to add to specified binary data. Must be non-empty.
|
|
773
|
-
binary_ids (Union[List[BinaryID], List[str]]): Binary data
|
|
774
|
-
Must be non-empty.
|
|
775
|
-
|
|
776
|
-
|
|
778
|
+
binary_ids (Union[List[~viam.proto.app.data.BinaryID], List[str]]): Binary data ID strings specifying the data to be tagged or
|
|
779
|
+
:class:`BinaryID` objects. Must be non-empty.
|
|
780
|
+
*DEPRECATED:* :class:`BinaryID` *is deprecated and will be removed in a future release. Instead, pass binary data IDs as a
|
|
781
|
+
list of strings.*
|
|
777
782
|
|
|
778
783
|
Raises:
|
|
779
|
-
GRPCError: If no binary data
|
|
784
|
+
GRPCError: If no binary data ID strings or :class:`BinaryID` objects are provided.
|
|
780
785
|
|
|
781
786
|
For more information, see `Data Client API <https://docs.viam.com/dev/reference/apis/data-client/#addtagstobinarydatabyids>`_.
|
|
782
787
|
"""
|
|
@@ -802,8 +807,7 @@ class DataClient:
|
|
|
802
807
|
|
|
803
808
|
Args:
|
|
804
809
|
tags (List[str]): List of tags to add to specified binary data. Must be non-empty.
|
|
805
|
-
filter (viam.proto.app.data.Filter):
|
|
806
|
-
tagged.
|
|
810
|
+
filter (~viam.proto.app.data.Filter): Specifies binary data to tag. If none is provided, tags all data.
|
|
807
811
|
|
|
808
812
|
Raises:
|
|
809
813
|
GRPCError: If no tags are provided.
|
|
@@ -843,13 +847,13 @@ class DataClient:
|
|
|
843
847
|
|
|
844
848
|
Args:
|
|
845
849
|
tags (List[str]): List of tags to remove from specified binary data. Must be non-empty.
|
|
846
|
-
binary_ids (Union[List[BinaryID], List[str]]): Binary data
|
|
847
|
-
Must be non-empty.
|
|
848
|
-
|
|
849
|
-
|
|
850
|
+
binary_ids (Union[List[~viam.proto.app.data.BinaryID], List[str]]): Binary data ID strings specifying the data to be untagged
|
|
851
|
+
or `BinaryID` objects. Must be non-empty.
|
|
852
|
+
*DEPRECATED:* :class:`BinaryID` *is deprecated and will be removed in a future release. Instead, pass binary data IDs as a
|
|
853
|
+
list of strings.*
|
|
850
854
|
|
|
851
855
|
Raises:
|
|
852
|
-
GRPCError: If no
|
|
856
|
+
GRPCError: If no binary data ID strings, :class:`BinaryID` objects, or tags are provided.
|
|
853
857
|
|
|
854
858
|
Returns:
|
|
855
859
|
int: The number of tags removed.
|
|
@@ -881,8 +885,7 @@ class DataClient:
|
|
|
881
885
|
|
|
882
886
|
Args:
|
|
883
887
|
tags (List[str]): List of tags to remove from specified binary data.
|
|
884
|
-
filter (viam.proto.app.data.Filter):
|
|
885
|
-
untagged.
|
|
888
|
+
filter (~viam.proto.app.data.Filter): Specifies binary data to untag. If none is provided, removes tags from all data.
|
|
886
889
|
|
|
887
890
|
Raises:
|
|
888
891
|
GRPCError: If no tags are provided.
|
|
@@ -910,8 +913,7 @@ class DataClient:
|
|
|
910
913
|
tags = await data_client.tags_by_filter(my_filter)
|
|
911
914
|
|
|
912
915
|
Args:
|
|
913
|
-
filter (viam.proto.app.data.Filter):
|
|
914
|
-
return.
|
|
916
|
+
filter (~viam.proto.app.data.Filter): Specifies subset ofdata to retrieve tags from. If none is provided, returns all tags.
|
|
915
917
|
|
|
916
918
|
Returns:
|
|
917
919
|
List[str]: The list of tags.
|
|
@@ -948,9 +950,9 @@ class DataClient:
|
|
|
948
950
|
print(bbox_id)
|
|
949
951
|
|
|
950
952
|
Args:
|
|
951
|
-
binary_id (Union[viam.proto.app.data.BinaryID, str]): The binary data
|
|
952
|
-
|
|
953
|
-
|
|
953
|
+
binary_id (Union[~viam.proto.app.data.BinaryID, str]): The binary data ID or :class:`BinaryID` of the image to add the bounding
|
|
954
|
+
box to. *DEPRECATED:* :class:`BinaryID` *is deprecated and will be removed in a future release. Instead, pass binary data
|
|
955
|
+
IDs as a list of strings.*
|
|
954
956
|
label (str): A label for the bounding box.
|
|
955
957
|
x_min_normalized (float): Min X value of the bounding box normalized from 0 to 1.
|
|
956
958
|
y_min_normalized (float): Min Y value of the bounding box normalized from 0 to 1.
|
|
@@ -999,10 +1001,10 @@ class DataClient:
|
|
|
999
1001
|
|
|
1000
1002
|
Args:
|
|
1001
1003
|
bbox_id (str): The ID of the bounding box to remove.
|
|
1002
|
-
binary_id (Union[viam.proto.app.data.BinaryID, str]): The binary data
|
|
1003
|
-
|
|
1004
|
-
|
|
1005
|
-
|
|
1004
|
+
binary_id (Union[~viam.proto.app.data.BinaryID, str]): The binary data ID or :class:`BinaryID` of the image to remove the
|
|
1005
|
+
bounding box from.
|
|
1006
|
+
*DEPRECATED:* :class:`BinaryID` *is deprecated and will be removed in a future release. Instead, pass binary data IDs as a
|
|
1007
|
+
list of strings.*
|
|
1006
1008
|
|
|
1007
1009
|
For more information, see `Data Client API <https://docs.viam.com/dev/reference/apis/data-client/#removeboundingboxfromimagebyid>`_.
|
|
1008
1010
|
"""
|
|
@@ -1028,8 +1030,8 @@ class DataClient:
|
|
|
1028
1030
|
print(bounding_box_labels)
|
|
1029
1031
|
|
|
1030
1032
|
Args:
|
|
1031
|
-
filter (viam.proto.app.data.Filter):
|
|
1032
|
-
|
|
1033
|
+
filter (~viam.proto.app.data.Filter): Specifies data to retrieve bounding box labels from. If none is provided, returns labels
|
|
1034
|
+
from all data.
|
|
1033
1035
|
|
|
1034
1036
|
Returns:
|
|
1035
1037
|
List[str]: The list of bounding box labels.
|
|
@@ -1049,8 +1051,8 @@ class DataClient:
|
|
|
1049
1051
|
hostname = await data_client.get_database_connection(organization_id="<YOUR-ORG-ID>")
|
|
1050
1052
|
|
|
1051
1053
|
Args:
|
|
1052
|
-
organization_id (str):
|
|
1053
|
-
|
|
1054
|
+
organization_id (str): The ID of the organization you'd like to connect to.
|
|
1055
|
+
To find your organization ID, visit the organization settings page in the Viam app.
|
|
1054
1056
|
|
|
1055
1057
|
Returns:
|
|
1056
1058
|
str: The hostname of the federated database.
|
|
@@ -1073,8 +1075,8 @@ class DataClient:
|
|
|
1073
1075
|
)
|
|
1074
1076
|
|
|
1075
1077
|
Args:
|
|
1076
|
-
organization_id (str): The ID of the organization.
|
|
1077
|
-
|
|
1078
|
+
organization_id (str): The ID of the organization you'd like to configure a database user for.
|
|
1079
|
+
To find your organization ID, visit the organization settings page in the Viam app.
|
|
1078
1080
|
password (str): The password of the user.
|
|
1079
1081
|
|
|
1080
1082
|
For more information, see `Data Client API <https://docs.viam.com/dev/reference/apis/data-client/#configuredatabaseuser>`_.
|
|
@@ -1096,7 +1098,7 @@ class DataClient:
|
|
|
1096
1098
|
Args:
|
|
1097
1099
|
name (str): The name of the dataset being created.
|
|
1098
1100
|
organization_id (str): The ID of the organization where the dataset is being created.
|
|
1099
|
-
|
|
1101
|
+
To find your organization ID, visit the organization settings page in the Viam app.
|
|
1100
1102
|
|
|
1101
1103
|
Returns:
|
|
1102
1104
|
str: The dataset ID of the created dataset.
|
|
@@ -1118,9 +1120,12 @@ class DataClient:
|
|
|
1118
1120
|
print(datasets)
|
|
1119
1121
|
|
|
1120
1122
|
Args:
|
|
1121
|
-
ids (List[str]): The IDs of the datasets
|
|
1122
|
-
|
|
1123
|
-
|
|
1123
|
+
ids (List[str]): The IDs of the datasets that you would like to retrieve information about. To retrieve a dataset ID:
|
|
1124
|
+
|
|
1125
|
+
- Navigate to the **DATASETS** tab of the **DATA** page.
|
|
1126
|
+
- Click on the dataset.
|
|
1127
|
+
- Click the **...** menu.
|
|
1128
|
+
- Select **Copy dataset ID**.
|
|
1124
1129
|
|
|
1125
1130
|
Returns:
|
|
1126
1131
|
Sequence[Dataset]: The list of datasets.
|
|
@@ -1143,8 +1148,8 @@ class DataClient:
|
|
|
1143
1148
|
print(datasets)
|
|
1144
1149
|
|
|
1145
1150
|
Args:
|
|
1146
|
-
organization_id (str): The ID of the organization.
|
|
1147
|
-
|
|
1151
|
+
organization_id (str): The ID of the organization you'd like to retrieve datasets from.
|
|
1152
|
+
To find your organization ID, visit the organization settings page in the Viam app.
|
|
1148
1153
|
|
|
1149
1154
|
Returns:
|
|
1150
1155
|
Sequence[Dataset]: The list of datasets in the organization.
|
|
@@ -1169,8 +1174,12 @@ class DataClient:
|
|
|
1169
1174
|
)
|
|
1170
1175
|
|
|
1171
1176
|
Args:
|
|
1172
|
-
id (str): The ID of the dataset.
|
|
1173
|
-
|
|
1177
|
+
id (str): The ID of the dataset. To retrieve the dataset ID:
|
|
1178
|
+
|
|
1179
|
+
- Navigate to the **DATASETS** tab of the **DATA** page.
|
|
1180
|
+
- Click on the dataset.
|
|
1181
|
+
- Click the **...** menu.
|
|
1182
|
+
- Select **Copy dataset ID**.
|
|
1174
1183
|
name (str): The new name of the dataset.
|
|
1175
1184
|
|
|
1176
1185
|
For more information, see `Data Client API <https://docs.viam.com/dev/reference/apis/data-client/#renamedataset>`_.
|
|
@@ -1188,8 +1197,12 @@ class DataClient:
|
|
|
1188
1197
|
)
|
|
1189
1198
|
|
|
1190
1199
|
Args:
|
|
1191
|
-
id (str): The ID of the dataset.
|
|
1192
|
-
|
|
1200
|
+
id (str): The ID of the dataset. To retrieve the dataset ID:
|
|
1201
|
+
|
|
1202
|
+
- Navigate to the **DATASETS** tab of the **DATA** page.
|
|
1203
|
+
- Click on the dataset.
|
|
1204
|
+
- Click the **...** menu.
|
|
1205
|
+
- Select **Copy dataset ID**.
|
|
1193
1206
|
|
|
1194
1207
|
For more information, see `Data Client API <https://docs.viam.com/dev/reference/apis/data-client/#deletedataset>`_.
|
|
1195
1208
|
"""
|
|
@@ -1207,24 +1220,27 @@ class DataClient:
|
|
|
1207
1220
|
include_binary_data=False
|
|
1208
1221
|
)
|
|
1209
1222
|
|
|
1210
|
-
|
|
1223
|
+
my_binary_data_ids = []
|
|
1211
1224
|
|
|
1212
1225
|
for obj in binary_metadata:
|
|
1213
|
-
|
|
1226
|
+
my_binary_data_ids.append(
|
|
1214
1227
|
obj.metadata.binary_data_id
|
|
1215
1228
|
)
|
|
1216
1229
|
|
|
1217
1230
|
await data_client.add_binary_data_to_dataset_by_ids(
|
|
1218
|
-
binary_ids=
|
|
1231
|
+
binary_ids=my_binary_data_ids,
|
|
1219
1232
|
dataset_id="abcd-1234xyz-8765z-123abc"
|
|
1220
1233
|
)
|
|
1221
1234
|
|
|
1222
1235
|
Args:
|
|
1223
|
-
binary_ids (List[BinaryID]):
|
|
1224
|
-
navigate to
|
|
1225
|
-
|
|
1226
|
-
|
|
1227
|
-
|
|
1236
|
+
binary_ids (List[~viam.proto.app.data.BinaryID]): Unique identifiers for binary data to add to the dataset. To retrieve these IDs,
|
|
1237
|
+
navigate to the DATA page, click on an image, and copy its Binary Data ID from the details tab.
|
|
1238
|
+
dataset_id (str): The ID of the dataset to be added to. To retrieve the dataset ID:
|
|
1239
|
+
|
|
1240
|
+
- Navigate to the **DATASETS** tab of the **DATA** page.
|
|
1241
|
+
- Click on the dataset.
|
|
1242
|
+
- Click the **...** menu.
|
|
1243
|
+
- Select **Copy dataset ID**.
|
|
1228
1244
|
|
|
1229
1245
|
For more information, see `Data Client API <https://docs.viam.com/dev/reference/apis/data-client/#addbinarydatatodatasetbyids>`_.
|
|
1230
1246
|
"""
|
|
@@ -1248,26 +1264,29 @@ class DataClient:
|
|
|
1248
1264
|
include_binary_data=False
|
|
1249
1265
|
)
|
|
1250
1266
|
|
|
1251
|
-
|
|
1267
|
+
my_binary_data_ids = []
|
|
1252
1268
|
|
|
1253
1269
|
for obj in binary_metadata:
|
|
1254
|
-
|
|
1270
|
+
my_binary_data_ids.append(
|
|
1255
1271
|
obj.metadata.binary_data_id
|
|
1256
1272
|
)
|
|
1257
1273
|
|
|
1258
1274
|
await data_client.remove_binary_data_from_dataset_by_ids(
|
|
1259
|
-
binary_ids=
|
|
1275
|
+
binary_ids=my_binary_data_ids,
|
|
1260
1276
|
dataset_id="abcd-1234xyz-8765z-123abc"
|
|
1261
1277
|
)
|
|
1262
1278
|
|
|
1263
1279
|
Args:
|
|
1264
|
-
binary_ids (Union[List[BinaryID], List[str]]):
|
|
1265
|
-
navigate to
|
|
1266
|
-
|
|
1267
|
-
|
|
1268
|
-
|
|
1269
|
-
|
|
1270
|
-
|
|
1280
|
+
binary_ids (Union[List[~viam.proto.app.data.BinaryID], List[str]]): Unique identifiers for the binary data to remove from the dataset. To retrieve these IDs,
|
|
1281
|
+
navigate to the DATA page, click on an image and copy its Binary Data ID from the details tab.
|
|
1282
|
+
*DEPRECATED:* :class:`BinaryID` *is deprecated and will be removed in a future release. Instead, pass binary data IDs as a
|
|
1283
|
+
list of strings.*
|
|
1284
|
+
dataset_id (str): The ID of the dataset to be removed from. To retrieve the dataset ID:
|
|
1285
|
+
|
|
1286
|
+
- Navigate to the **DATASETS** tab of the **DATA** page.
|
|
1287
|
+
- Click on the dataset.
|
|
1288
|
+
- Click the **...** menu.
|
|
1289
|
+
- Select **Copy dataset ID**.
|
|
1271
1290
|
|
|
1272
1291
|
For more information, see `Data Client API <https://docs.viam.com/dev/reference/apis/data-client/#removebinarydatafromdatasetbyids>`_.
|
|
1273
1292
|
"""
|
|
@@ -1294,8 +1313,8 @@ class DataClient:
|
|
|
1294
1313
|
) -> str:
|
|
1295
1314
|
"""Upload binary sensor data.
|
|
1296
1315
|
|
|
1297
|
-
Upload binary data collected on a robot through a specific component (for example, a motor) along with the relevant metadata
|
|
1298
|
-
|
|
1316
|
+
Upload binary data collected on a robot through a specific component (for example, a motor), along with the relevant metadata.
|
|
1317
|
+
Binary data can be found on the **DATA** page of the Viam app.
|
|
1299
1318
|
|
|
1300
1319
|
::
|
|
1301
1320
|
|
|
@@ -1320,19 +1339,19 @@ class DataClient:
|
|
|
1320
1339
|
component_type (str): Type of the component used to capture the data (for example, "movement_sensor").
|
|
1321
1340
|
component_name (str): Name of the component used to capture the data.
|
|
1322
1341
|
method_name (str): Name of the method used to capture the data.
|
|
1323
|
-
file_extension (str): The file extension of binary data including the period
|
|
1324
|
-
The backend
|
|
1325
|
-
or
|
|
1342
|
+
file_extension (str): The file extension of binary data, *including the period*, for example ``.jpg``, ``.png``, ``.pcd``.
|
|
1343
|
+
The backend routes the binary to its corresponding mime type based on this extension. Files with a ``.jpeg``, ``.jpg``,
|
|
1344
|
+
or ``.png`` extension will appear in the **Images** tab.
|
|
1326
1345
|
method_parameters (Optional[Mapping[str, Any]]): Optional dictionary of method parameters. No longer in active use.
|
|
1327
1346
|
tags (Optional[List[str]]): Optional list of tags to allow for tag-based data filtering when retrieving data.
|
|
1328
1347
|
data_request_times (Optional[Tuple[datetime.datetime, datetime.datetime]]): Optional tuple containing datetime objects
|
|
1329
|
-
denoting the times this data was requested[0] by the robot and received[1] from the appropriate sensor.
|
|
1348
|
+
denoting the times this data was requested ``[0]`` by the robot and received ``[1]`` from the appropriate sensor.
|
|
1330
1349
|
|
|
1331
1350
|
Raises:
|
|
1332
1351
|
GRPCError: If an invalid part ID is passed.
|
|
1333
1352
|
|
|
1334
1353
|
Returns:
|
|
1335
|
-
str: The
|
|
1354
|
+
str: The binary data ID of the uploaded data.
|
|
1336
1355
|
|
|
1337
1356
|
For more information, see `Data Client API <https://docs.viam.com/dev/reference/apis/data-client/#binarydatacaptureupload>`_.
|
|
1338
1357
|
"""
|
|
@@ -1375,8 +1394,8 @@ class DataClient:
|
|
|
1375
1394
|
) -> str:
|
|
1376
1395
|
"""Upload tabular sensor data.
|
|
1377
1396
|
|
|
1378
|
-
Upload tabular data collected on a robot through a specific component (for example, a motor) along with the relevant metadata
|
|
1379
|
-
|
|
1397
|
+
Upload tabular data collected on a robot through a specific component (for example, a motor), along with the relevant metadata.
|
|
1398
|
+
Tabular data can be found under the **Sensors** tab of the **DATA** page.
|
|
1380
1399
|
|
|
1381
1400
|
::
|
|
1382
1401
|
|
|
@@ -1401,24 +1420,24 @@ class DataClient:
|
|
|
1401
1420
|
|
|
1402
1421
|
Args:
|
|
1403
1422
|
tabular_data (List[Mapping[str, Any]]): List of the data to be uploaded, represented tabularly as a collection of dictionaries.
|
|
1404
|
-
Must include the key
|
|
1423
|
+
Must include the key ``readings`` for sensors.
|
|
1405
1424
|
part_id (str): Part ID of the component used to capture the data.
|
|
1406
|
-
component_type (str): Type of the component used to capture the data (for example,
|
|
1425
|
+
component_type (str): Type of the component used to capture the data (for example, ``rdk:component:movement_sensor``).
|
|
1407
1426
|
component_name (str): Name of the component used to capture the data.
|
|
1408
1427
|
method_name (str): Name of the method used to capture the data.
|
|
1409
|
-
data_request_times (List[Tuple[datetime.datetime, datetime.datetime]]): List of tuples, each containing
|
|
1410
|
-
denoting the times this data was requested[0] by the robot and received[1] from the appropriate sensor.
|
|
1411
|
-
tabular data and
|
|
1428
|
+
data_request_times (List[Tuple[datetime.datetime, datetime.datetime]]): List of tuples, each containing ``datetime`` objects
|
|
1429
|
+
denoting the times this data was requested ``[0]`` by the robot and received ``[1]`` from the appropriate sensor.
|
|
1430
|
+
Pass a list of tabular data and timestamps with length ``n > 1`` to upload ``n`` datapoints, all with the same metadata.
|
|
1412
1431
|
method_parameters (Optional[Mapping[str, Any]]): Optional dictionary of method parameters. No longer in active use.
|
|
1413
1432
|
tags (Optional[List[str]]): Optional list of tags to allow for tag-based data filtering when retrieving data.
|
|
1414
1433
|
|
|
1415
1434
|
Raises:
|
|
1416
1435
|
GRPCError: If an invalid part ID is passed.
|
|
1417
|
-
ValueError: If
|
|
1436
|
+
ValueError: If the provided list of `Timestamp` objects has a length that does not match the length of the list of tabular
|
|
1418
1437
|
data.
|
|
1419
1438
|
|
|
1420
1439
|
Returns:
|
|
1421
|
-
str: The
|
|
1440
|
+
str: The file ID of the uploaded data.
|
|
1422
1441
|
|
|
1423
1442
|
For more information, see `Data Client API <https://docs.viam.com/dev/reference/apis/data-client/#tabulardatacaptureupload>`_.
|
|
1424
1443
|
"""
|
|
@@ -1493,22 +1512,22 @@ class DataClient:
|
|
|
1493
1512
|
)
|
|
1494
1513
|
|
|
1495
1514
|
Args:
|
|
1496
|
-
data (bytes):
|
|
1515
|
+
data (bytes): The data to be uploaded.
|
|
1497
1516
|
part_id (str): Part ID of the resource associated with the file.
|
|
1498
|
-
file_ext (str):
|
|
1517
|
+
file_ext (str): File extension type for the data. required for determining MIME type.
|
|
1499
1518
|
component_type (Optional[str]): Optional type of the component associated with the file (for example, "movement_sensor").
|
|
1500
1519
|
component_name (Optional[str]): Optional name of the component associated with the file.
|
|
1501
1520
|
method_name (Optional[str]): Optional name of the method associated with the file.
|
|
1502
1521
|
method_parameters (Optional[str]): Optional dictionary of the method parameters. No longer in active use.
|
|
1503
1522
|
data_request_times (Optional[Tuple[datetime.datetime, datetime.datetime]]): Optional tuple containing datetime objects
|
|
1504
|
-
denoting the times this data was requested[0] by the robot and received[1] from the appropriate sensor.
|
|
1523
|
+
denoting the times this data was requested ``[0]`` by the robot and received ``[1]`` from the appropriate sensor.
|
|
1505
1524
|
tags (Optional[List[str]]): Optional list of tags to allow for tag-based filtering when retrieving data.
|
|
1506
1525
|
|
|
1507
1526
|
Raises:
|
|
1508
1527
|
GRPCError: If an invalid part ID is passed.
|
|
1509
1528
|
|
|
1510
1529
|
Returns:
|
|
1511
|
-
str: The
|
|
1530
|
+
str: The binary data ID of the uploaded data.
|
|
1512
1531
|
|
|
1513
1532
|
For more information, see `Data Client API <https://docs.viam.com/dev/reference/apis/data-client/#streamingdatacaptureupload>`_.
|
|
1514
1533
|
"""
|
|
@@ -1553,8 +1572,8 @@ class DataClient:
|
|
|
1553
1572
|
) -> str:
|
|
1554
1573
|
"""Upload arbitrary file data.
|
|
1555
1574
|
|
|
1556
|
-
Upload file data that may be stored on a robot along with the relevant metadata
|
|
1557
|
-
|
|
1575
|
+
Upload file data that may be stored on a robot along with the relevant metadata. File data can be found in the
|
|
1576
|
+
**Files** tab of the **DATA** page.
|
|
1558
1577
|
|
|
1559
1578
|
::
|
|
1560
1579
|
|
|
@@ -1572,18 +1591,18 @@ class DataClient:
|
|
|
1572
1591
|
component_type (Optional[str]): Optional type of the component associated with the file (for example, "movement_sensor").
|
|
1573
1592
|
component_name (Optional[str]): Optional name of the component associated with the file.
|
|
1574
1593
|
method_name (Optional[str]): Optional name of the method associated with the file.
|
|
1575
|
-
file_name (Optional[str]): Optional name of the file. The empty string "" will be assigned as the file name if one isn't
|
|
1594
|
+
file_name (Optional[str]): Optional name of the file. The empty string ``""`` will be assigned as the file name if one isn't
|
|
1576
1595
|
provided.
|
|
1577
1596
|
method_parameters (Optional[str]): Optional dictionary of the method parameters. No longer in active use.
|
|
1578
|
-
file_extension (Optional[str]): Optional file extension. The empty string "" will be assigned as the file extension if one
|
|
1579
|
-
provided. Files with a
|
|
1597
|
+
file_extension (Optional[str]): Optional file extension. The empty string ``""`` will be assigned as the file extension if one
|
|
1598
|
+
isn't provided. Files with a ``.jpeg``, ``.jpg``, or ``.png`` extension will be saved to the **Images** tab.
|
|
1580
1599
|
tags (Optional[List[str]]): Optional list of tags to allow for tag-based filtering when retrieving data.
|
|
1581
1600
|
|
|
1582
1601
|
Raises:
|
|
1583
1602
|
GRPCError: If an invalid part ID is passed.
|
|
1584
1603
|
|
|
1585
1604
|
Returns:
|
|
1586
|
-
str: ID of the new file.
|
|
1605
|
+
str: Binary data ID of the new file.
|
|
1587
1606
|
|
|
1588
1607
|
For more information, see `Data Client API <https://docs.viam.com/dev/reference/apis/data-client/#fileupload>`_.
|
|
1589
1608
|
"""
|
|
@@ -1613,8 +1632,8 @@ class DataClient:
|
|
|
1613
1632
|
) -> str:
|
|
1614
1633
|
"""Upload arbitrary file data.
|
|
1615
1634
|
|
|
1616
|
-
Upload file data that may be stored on a robot along with the relevant metadata
|
|
1617
|
-
|
|
1635
|
+
Upload file data that may be stored on a robot along with the relevant metadata. File data can be found in the
|
|
1636
|
+
**Files** tab of the **DATA** page.
|
|
1618
1637
|
|
|
1619
1638
|
::
|
|
1620
1639
|
|
|
@@ -1639,7 +1658,7 @@ class DataClient:
|
|
|
1639
1658
|
FileNotFoundError: If the provided filepath is not found.
|
|
1640
1659
|
|
|
1641
1660
|
Returns:
|
|
1642
|
-
str: ID of the new file.
|
|
1661
|
+
str: Binary data ID of the new file.
|
|
1643
1662
|
|
|
1644
1663
|
For more information, see `Data Client API <https://docs.viam.com/dev/reference/apis/data-client/#fileuploadfrompath>`_.
|
|
1645
1664
|
"""
|