current-data-py 0.1.16__tar.gz → 0.1.17__tar.gz

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.
Files changed (120) hide show
  1. {current_data_py-0.1.16 → current_data_py-0.1.17}/MANIFEST.in +8 -8
  2. {current_data_py-0.1.16/current_data_py.egg-info → current_data_py-0.1.17}/PKG-INFO +9 -3
  3. {current_data_py-0.1.16 → current_data_py-0.1.17}/README.md +191 -185
  4. {current_data_py-0.1.16 → current_data_py-0.1.17}/__init__.py +24 -17
  5. {current_data_py-0.1.16 → current_data_py-0.1.17}/_multipart.py +52 -52
  6. {current_data_py-0.1.16 → current_data_py-0.1.17/current_data_py.egg-info}/PKG-INFO +9 -3
  7. {current_data_py-0.1.16 → current_data_py-0.1.17}/decoding.py +179 -184
  8. {current_data_py-0.1.16 → current_data_py-0.1.17}/docs/api/management.md +470 -363
  9. current_data_py-0.1.17/docs/api/processing.md +699 -0
  10. {current_data_py-0.1.16 → current_data_py-0.1.17}/docs/index.md +70 -66
  11. {current_data_py-0.1.16 → current_data_py-0.1.17}/docs/skills/convert-robot-data/SKILL.md +211 -211
  12. {current_data_py-0.1.16 → current_data_py-0.1.17}/docs/skills/data-platform/SKILL.md +32 -29
  13. {current_data_py-0.1.16 → current_data_py-0.1.17}/docs/skills/data-platform/references/api.md +37 -34
  14. current_data_py-0.1.17/docs/skills/data-platform/references/data-transfer.md +62 -0
  15. {current_data_py-0.1.16 → current_data_py-0.1.17}/docs/skills/data-platform/references/dev-pod.md +62 -62
  16. {current_data_py-0.1.16 → current_data_py-0.1.17}/docs/skills/data-platform/references/jobs.md +86 -86
  17. {current_data_py-0.1.16 → current_data_py-0.1.17}/docs/skills/data-platform/references/test-environment.md +26 -26
  18. {current_data_py-0.1.16 → current_data_py-0.1.17}/docs/skills/data-platform/references/use-cases.md +82 -82
  19. {current_data_py-0.1.16 → current_data_py-0.1.17}/docs/skills/sdk-client/SKILL.md +11 -11
  20. {current_data_py-0.1.16 → current_data_py-0.1.17}/docs/skills/sdk-client/references/data-client.md +379 -279
  21. current_data_py-0.1.17/docs/skills/sdk-client/references/metadata-v2.md +156 -0
  22. {current_data_py-0.1.16 → current_data_py-0.1.17}/docs.py +46 -46
  23. {current_data_py-0.1.16 → current_data_py-0.1.17}/examples/__init__.py +1 -1
  24. {current_data_py-0.1.16 → current_data_py-0.1.17}/examples/list_schemas.py +7 -7
  25. {current_data_py-0.1.16 → current_data_py-0.1.17}/examples/read_remote_td.py +54 -54
  26. {current_data_py-0.1.16 → current_data_py-0.1.17}/examples/read_td.py +30 -30
  27. {current_data_py-0.1.16 → current_data_py-0.1.17}/examples/write_td.py +30 -30
  28. {current_data_py-0.1.16 → current_data_py-0.1.17}/labeling.py +102 -102
  29. {current_data_py-0.1.16 → current_data_py-0.1.17}/management.py +312 -233
  30. {current_data_py-0.1.16 → current_data_py-0.1.17}/oss.py +229 -229
  31. {current_data_py-0.1.16 → current_data_py-0.1.17}/proto_gen/python/labeling/service/service_pb2.py +79 -79
  32. {current_data_py-0.1.16 → current_data_py-0.1.17}/proto_gen/python/labeling/service/service_pb2_grpc.py +435 -435
  33. {current_data_py-0.1.16 → current_data_py-0.1.17}/proto_gen/python/labeling/task/task_pb2.py +52 -52
  34. {current_data_py-0.1.16 → current_data_py-0.1.17}/proto_gen/python/labeling/template/template_pb2.py +40 -40
  35. current_data_py-0.1.17/proto_gen/python/management/metadata/metadata_pb2.py +74 -0
  36. {current_data_py-0.1.16 → current_data_py-0.1.17}/proto_gen/python/management/selection/selection_pb2.py +27 -27
  37. current_data_py-0.1.17/proto_gen/python/management/service/service_pb2.py +118 -0
  38. {current_data_py-0.1.16 → current_data_py-0.1.17}/proto_gen/python/management/service/service_pb2_grpc.py +831 -528
  39. {current_data_py-0.1.16 → current_data_py-0.1.17}/proto_gen/python/msg/builtin_interfaces/duration_pb2.py +25 -25
  40. {current_data_py-0.1.16 → current_data_py-0.1.17}/proto_gen/python/msg/builtin_interfaces/time_pb2.py +25 -25
  41. {current_data_py-0.1.16 → current_data_py-0.1.17}/proto_gen/python/msg/custom_msgs/encoder_status_pb2.py +25 -25
  42. {current_data_py-0.1.16 → current_data_py-0.1.17}/proto_gen/python/msg/custom_msgs/joint_current_pb2.py +26 -26
  43. {current_data_py-0.1.16 → current_data_py-0.1.17}/proto_gen/python/msg/custom_msgs/keypoints_quality_pb2.py +25 -25
  44. {current_data_py-0.1.16 → current_data_py-0.1.17}/proto_gen/python/msg/custom_msgs/pose_rpy_pb2.py +26 -26
  45. {current_data_py-0.1.16 → current_data_py-0.1.17}/proto_gen/python/msg/custom_msgs/slam_quality_pb2.py +25 -25
  46. {current_data_py-0.1.16 → current_data_py-0.1.17}/proto_gen/python/msg/custom_msgs/sonic_frame_pb2.py +25 -25
  47. {current_data_py-0.1.16 → current_data_py-0.1.17}/proto_gen/python/msg/custom_msgs/subtask_description_pb2.py +25 -25
  48. {current_data_py-0.1.16 → current_data_py-0.1.17}/proto_gen/python/msg/custom_msgs/target_quality_pb2.py +25 -25
  49. {current_data_py-0.1.16 → current_data_py-0.1.17}/proto_gen/python/msg/foxglove/compressed_audio_pb2.py +26 -26
  50. {current_data_py-0.1.16 → current_data_py-0.1.17}/proto_gen/python/msg/foxglove/compressed_video_pb2.py +26 -26
  51. {current_data_py-0.1.16 → current_data_py-0.1.17}/proto_gen/python/msg/geometry_msgs/point32_pb2.py +25 -25
  52. {current_data_py-0.1.16 → current_data_py-0.1.17}/proto_gen/python/msg/geometry_msgs/point_pb2.py +25 -25
  53. {current_data_py-0.1.16 → current_data_py-0.1.17}/proto_gen/python/msg/geometry_msgs/pose_array_pb2.py +27 -27
  54. {current_data_py-0.1.16 → current_data_py-0.1.17}/proto_gen/python/msg/geometry_msgs/pose_pb2.py +27 -27
  55. {current_data_py-0.1.16 → current_data_py-0.1.17}/proto_gen/python/msg/geometry_msgs/pose_stamped_pb2.py +27 -27
  56. {current_data_py-0.1.16 → current_data_py-0.1.17}/proto_gen/python/msg/geometry_msgs/pose_with_covariance_pb2.py +26 -26
  57. {current_data_py-0.1.16 → current_data_py-0.1.17}/proto_gen/python/msg/geometry_msgs/pose_with_covariance_stamped_pb2.py +27 -27
  58. {current_data_py-0.1.16 → current_data_py-0.1.17}/proto_gen/python/msg/geometry_msgs/quaternion_pb2.py +25 -25
  59. {current_data_py-0.1.16 → current_data_py-0.1.17}/proto_gen/python/msg/geometry_msgs/transform_pb2.py +27 -27
  60. {current_data_py-0.1.16 → current_data_py-0.1.17}/proto_gen/python/msg/geometry_msgs/transform_stamped_pb2.py +27 -27
  61. {current_data_py-0.1.16 → current_data_py-0.1.17}/proto_gen/python/msg/geometry_msgs/twist_pb2.py +26 -26
  62. {current_data_py-0.1.16 → current_data_py-0.1.17}/proto_gen/python/msg/geometry_msgs/twist_stamped_pb2.py +27 -27
  63. {current_data_py-0.1.16 → current_data_py-0.1.17}/proto_gen/python/msg/geometry_msgs/twist_with_covariance_pb2.py +26 -26
  64. {current_data_py-0.1.16 → current_data_py-0.1.17}/proto_gen/python/msg/geometry_msgs/twist_with_covariance_stamped_pb2.py +27 -27
  65. {current_data_py-0.1.16 → current_data_py-0.1.17}/proto_gen/python/msg/geometry_msgs/vector3_pb2.py +25 -25
  66. {current_data_py-0.1.16 → current_data_py-0.1.17}/proto_gen/python/msg/geometry_msgs/wrench_pb2.py +26 -26
  67. {current_data_py-0.1.16 → current_data_py-0.1.17}/proto_gen/python/msg/geometry_msgs/wrench_stamped_pb2.py +27 -27
  68. {current_data_py-0.1.16 → current_data_py-0.1.17}/proto_gen/python/msg/nav_msgs/map_meta_data_pb2.py +27 -27
  69. {current_data_py-0.1.16 → current_data_py-0.1.17}/proto_gen/python/msg/nav_msgs/occupancy_grid_pb2.py +27 -27
  70. {current_data_py-0.1.16 → current_data_py-0.1.17}/proto_gen/python/msg/nav_msgs/odometry_pb2.py +28 -28
  71. {current_data_py-0.1.16 → current_data_py-0.1.17}/proto_gen/python/msg/nav_msgs/path_pb2.py +27 -27
  72. {current_data_py-0.1.16 → current_data_py-0.1.17}/proto_gen/python/msg/sensor_msgs/battery_state_pb2.py +32 -32
  73. {current_data_py-0.1.16 → current_data_py-0.1.17}/proto_gen/python/msg/sensor_msgs/camera_info_pb2.py +27 -27
  74. {current_data_py-0.1.16 → current_data_py-0.1.17}/proto_gen/python/msg/sensor_msgs/compressed_image_pb2.py +26 -26
  75. {current_data_py-0.1.16 → current_data_py-0.1.17}/proto_gen/python/msg/sensor_msgs/image_pb2.py +26 -26
  76. {current_data_py-0.1.16 → current_data_py-0.1.17}/proto_gen/python/msg/sensor_msgs/imu_pb2.py +28 -28
  77. {current_data_py-0.1.16 → current_data_py-0.1.17}/proto_gen/python/msg/sensor_msgs/joint_state_pb2.py +26 -26
  78. {current_data_py-0.1.16 → current_data_py-0.1.17}/proto_gen/python/msg/sensor_msgs/laser_scan_pb2.py +26 -26
  79. {current_data_py-0.1.16 → current_data_py-0.1.17}/proto_gen/python/msg/sensor_msgs/nav_sat_fix_pb2.py +29 -29
  80. {current_data_py-0.1.16 → current_data_py-0.1.17}/proto_gen/python/msg/sensor_msgs/nav_sat_status_pb2.py +27 -27
  81. {current_data_py-0.1.16 → current_data_py-0.1.17}/proto_gen/python/msg/sensor_msgs/point_cloud2_pb2.py +27 -27
  82. {current_data_py-0.1.16 → current_data_py-0.1.17}/proto_gen/python/msg/sensor_msgs/point_field_pb2.py +27 -27
  83. {current_data_py-0.1.16 → current_data_py-0.1.17}/proto_gen/python/msg/sensor_msgs/range_pb2.py +28 -28
  84. {current_data_py-0.1.16 → current_data_py-0.1.17}/proto_gen/python/msg/sensor_msgs/region_of_interest_pb2.py +25 -25
  85. {current_data_py-0.1.16 → current_data_py-0.1.17}/proto_gen/python/msg/std_msgs/bool_pb2.py +25 -25
  86. {current_data_py-0.1.16 → current_data_py-0.1.17}/proto_gen/python/msg/std_msgs/color_rgba_pb2.py +25 -25
  87. {current_data_py-0.1.16 → current_data_py-0.1.17}/proto_gen/python/msg/std_msgs/float32_pb2.py +25 -25
  88. {current_data_py-0.1.16 → current_data_py-0.1.17}/proto_gen/python/msg/std_msgs/float64_pb2.py +25 -25
  89. {current_data_py-0.1.16 → current_data_py-0.1.17}/proto_gen/python/msg/std_msgs/header_pb2.py +26 -26
  90. {current_data_py-0.1.16 → current_data_py-0.1.17}/proto_gen/python/msg/std_msgs/int32_pb2.py +25 -25
  91. {current_data_py-0.1.16 → current_data_py-0.1.17}/proto_gen/python/msg/std_msgs/string_pb2.py +25 -25
  92. {current_data_py-0.1.16 → current_data_py-0.1.17}/proto_gen/python/msg/std_msgs/uint32_pb2.py +25 -25
  93. {current_data_py-0.1.16 → current_data_py-0.1.17}/proto_gen/python/msg/tf2_msgs/tf_message_pb2.py +26 -26
  94. {current_data_py-0.1.16 → current_data_py-0.1.17}/pyproject.toml +24 -24
  95. {current_data_py-0.1.16 → current_data_py-0.1.17}/remote/__init__.py +7 -7
  96. current_data_py-0.1.17/remote/client.py +293 -0
  97. {current_data_py-0.1.16 → current_data_py-0.1.17}/remote/source.py +99 -99
  98. {current_data_py-0.1.16 → current_data_py-0.1.17}/remote/tos_source.py +84 -84
  99. {current_data_py-0.1.16 → current_data_py-0.1.17}/schema/__init__.py +113 -113
  100. {current_data_py-0.1.16 → current_data_py-0.1.17}/schema/message_metadata.py +30 -30
  101. {current_data_py-0.1.16 → current_data_py-0.1.17}/setup.py +93 -93
  102. {current_data_py-0.1.16 → current_data_py-0.1.17}/tests/check_docs.py +74 -79
  103. {current_data_py-0.1.16 → current_data_py-0.1.17}/tests/check_environment.py +83 -79
  104. {current_data_py-0.1.16 → current_data_py-0.1.17}/tests/check_labeling.py +111 -111
  105. {current_data_py-0.1.16 → current_data_py-0.1.17}/tests/check_management.py +588 -469
  106. {current_data_py-0.1.16 → current_data_py-0.1.17}/tests/check_oss.py +424 -424
  107. {current_data_py-0.1.16 → current_data_py-0.1.17}/tests/check_package.py +44 -44
  108. {current_data_py-0.1.16 → current_data_py-0.1.17}/tests/check_remote.py +343 -343
  109. {current_data_py-0.1.16 → current_data_py-0.1.17}/tos.py +191 -191
  110. current_data_py-0.1.16/docs/api/processing.md +0 -401
  111. current_data_py-0.1.16/docs/skills/data-platform/references/data-transfer.md +0 -34
  112. current_data_py-0.1.16/docs/skills/data-platform/references/updates.md +0 -44
  113. current_data_py-0.1.16/proto_gen/python/management/metadata/metadata_pb2.py +0 -68
  114. current_data_py-0.1.16/proto_gen/python/management/service/service_pb2.py +0 -84
  115. current_data_py-0.1.16/remote/client.py +0 -138
  116. {current_data_py-0.1.16 → current_data_py-0.1.17}/current_data_py.egg-info/SOURCES.txt +0 -0
  117. {current_data_py-0.1.16 → current_data_py-0.1.17}/current_data_py.egg-info/dependency_links.txt +0 -0
  118. {current_data_py-0.1.16 → current_data_py-0.1.17}/current_data_py.egg-info/requires.txt +0 -0
  119. {current_data_py-0.1.16 → current_data_py-0.1.17}/current_data_py.egg-info/top_level.txt +0 -0
  120. {current_data_py-0.1.16 → current_data_py-0.1.17}/setup.cfg +0 -0
@@ -1,8 +1,8 @@
1
- include tests/check_package.py
2
- include tests/check_environment.py
3
- include tests/check_remote.py
4
- include tests/check_management.py
5
- include tests/check_oss.py
6
- include tests/check_labeling.py
7
- include tests/check_docs.py
8
- recursive-include docs *.md
1
+ include tests/check_package.py
2
+ include tests/check_environment.py
3
+ include tests/check_remote.py
4
+ include tests/check_management.py
5
+ include tests/check_oss.py
6
+ include tests/check_labeling.py
7
+ include tests/check_docs.py
8
+ recursive-include docs *.md
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: current-data-py
3
- Version: 0.1.16
3
+ Version: 0.1.17
4
4
  Summary: Current Data protobuf messages and schema metadata
5
5
  Requires-Python: >=3.9
6
6
  Description-Content-Type: text/markdown
@@ -49,6 +49,12 @@ Set `ENV=test` before the first SDK import to select the test service; an unset
49
49
  empty value defaults to production. An explicit client `address=` overrides the
50
50
  default. Remote examples require service connectivity and accessible data.
51
51
 
52
+ Calibration workers can import `GLOVE_CALIBRATION_REPORT_URL` from
53
+ `current_data_py` for the environment's HTTPS Collection callback endpoint on
54
+ `DEFAULT_ADDRESS` (port 443).
55
+ Processing supplies `ENV` to the Job; set it before the first SDK import.
56
+ The worker needs network access to that platform domain.
57
+
52
58
  ## Upload files
53
59
 
54
60
  Use `OSSClient` or `TOSClient` with upload permission. The management service
@@ -103,7 +109,7 @@ shared dependencies are left unchanged:
103
109
  (cd current_data_py && python -m build --no-isolation --outdir "$sdk_dist")
104
110
  python current_data_py/tests/check_distribution.py --dist-dir "$sdk_dist"
105
111
  python -m pip install --no-deps --force-reinstall "$sdk_dist"/*.whl
106
- for check in package environment management labeling remote oss tos decoding multipart docs; do
112
+ for check in package environment management labeling remote remote_v2 oss tos decoding multipart docs; do
107
113
  python -I "current_data_py/tests/check_${check}.py"
108
114
  done
109
115
  )
@@ -145,7 +151,7 @@ sdk_release_dir=$(mktemp -d /tmp/current-data-release.XXXXXX)
145
151
  (
146
152
  cd "$sdk_release_dir"
147
153
  unset PYTHONPATH PYTHONHOME
148
- for check in package environment management labeling remote oss tos decoding; do
154
+ for check in package environment management labeling remote remote_v2 oss tos decoding; do
149
155
  python -I "$sdk_release_dir/source/current_data_py/tests/check_${check}.py"
150
156
  done
151
157
  )
@@ -1,185 +1,191 @@
1
- # current-data-py
2
-
3
- Python SDK for robotics Protobuf messages, TD files, and platform service clients.
4
- Run shell commands from the repository root in the shared development environment.
5
-
6
- ## Use locally
7
-
8
- Run the bundled examples to write and read a local TD file using the installed SDK:
9
-
10
- ```sh
11
- python -I -m current_data_py.examples.write_td /tmp/current-data-example.td
12
- python -I -m current_data_py.examples.read_td /tmp/current-data-example.td
13
- ```
14
-
15
- `-I` avoids importing the unbuilt source directory in place of the installed package.
16
- See [examples](examples) for other entry points.
17
-
18
- For a minimal read-only service call, run this snippet with `python -I` so it uses
19
- the installed SDK:
20
-
21
- ```python
22
- from contextlib import closing
23
- import os
24
- os.environ["ENV"] = "test"
25
-
26
- from current_data_py.management import ManagementClient, MetadataFilter
27
-
28
- with ManagementClient() as client:
29
- with closing(client.stream_data_references(MetadataFilter(), timeout=30)) as records:
30
- record = next(records, None)
31
- print(record.id if record is not None else "No matching data")
32
- ```
33
-
34
- Set `ENV=test` before the first SDK import to select the test service; an unset or
35
- empty value defaults to production. An explicit client `address=` overrides the
36
- default. Remote examples require service connectivity and accessible data.
37
-
38
- ## Upload files
39
-
40
- Use `OSSClient` or `TOSClient` with upload permission. The management service
41
- selects the bucket and allowed object prefix; keep it open during transfers:
42
-
43
- ```python
44
- from current_data_py.management import ManagementClient
45
- from current_data_py.tos import TOSClient
46
-
47
- with ManagementClient() as management:
48
- with TOSClient(management, permission="upload", data_type="YAM",
49
- data_kind="CONVERTED") as storage:
50
- storage.upload_file(storage.object_prefix + "recording.td", "/data/recording.td",
51
- multipart_threshold=100 * 1024**2,
52
- part_size=16 * 1024**2, max_workers=4)
53
- ```
54
-
55
- Both clients accept the same transfer options. Files at or above
56
- `multipart_threshold` use multipart upload; `0` forces multipart for nonempty
57
- files. Empty files always use PutObject. Sizes are in bytes. `part_size` must be
58
- 5 MiB–5 GiB, and the file must fit within 10,000 parts; increase it for larger
59
- files. `max_workers` controls parallel requests (1–64); part buffers use roughly
60
- `part_size * max_workers` memory, plus SDK overhead. Do not modify the source
61
- file during upload.
62
-
63
- Uploads reject existing objects by default, including when completing multipart
64
- uploads. Set `forbid_overwrite=False` to replace one. Content type and metadata
65
- are preserved. The return value is the provider's PutObject result for small
66
- files or CompleteMultipartUpload result for multipart files.
67
-
68
- Failed multipart transfers attempt to abort and delete incomplete parts. A failed
69
- cleanup emits a warning; check the bucket's incomplete uploads. The upload role
70
- and its scoped STS policy must allow `oss:AbortMultipartUpload` or
71
- `tos:AbortMultipartUpload` in addition to PutObject. Deploy the management-service
72
- policy update and ensure the underlying cloud role permits cleanup before use.
73
- There is no persistent checkpoint: a later call starts a new upload. Uploading
74
- does not register the data; call `ManagementClient.register_data` separately.
75
-
76
- ## Test changes
77
-
78
- The package bundles generated Protobuf modules during its build. After protocol
79
- changes, [regenerate the bindings](../README.md#protobuf) first.
80
- Build into a fresh temporary directory, validate the artifacts, and install this
81
- checkout's wheel before running its checks. Only the local package is installed;
82
- shared dependencies are left unchanged:
83
-
84
- ```sh
85
- (
86
- set -e
87
- sdk_dist=$(mktemp -d)
88
- trap 'rm -rf "$sdk_dist"' EXIT
89
- (cd current_data_py && python -m build --no-isolation --outdir "$sdk_dist")
90
- python current_data_py/tests/check_distribution.py --dist-dir "$sdk_dist"
91
- python -m pip install --no-deps --force-reinstall "$sdk_dist"/*.whl
92
- for check in package environment management labeling remote oss tos decoding multipart docs; do
93
- python -I "current_data_py/tests/check_${check}.py"
94
- done
95
- )
96
- ```
97
-
98
- These checks cover packaging, environment selection, clients, and media decoding
99
- using local fixtures and mocked services. They do not require production credentials
100
- or prove connectivity to a deployed service.
101
-
102
- ## Publish to PyPI
103
-
104
- CI checks this SDK but does not publish it. Releases are manual and must use the
105
- latest successfully fetched `origin/main`, including the version bump. Development
106
- branches, uncommitted changes, and older main commits are not release sources. Follow the
107
- [repository Git workflow](../.agents/rules/git-workflow.md).
108
- Prepare the version update in `pyproject.toml` on a development branch and merge it
109
- through review together with the intended SDK changes before building a release.
110
- Use a version that has not already been published.
111
-
112
- ### Build and validate
113
-
114
- Run from the repository root. Fetch the latest `origin/main`, record its commit,
115
- and build from a clean exported copy so local edits and old artifacts cannot enter
116
- the release:
117
-
118
- ```bash
119
- sdk_release_dir=$(mktemp -d /tmp/current-data-release.XXXXXX)
120
- (
121
- set -euo pipefail
122
- git fetch origin
123
- sdk_release_sha=$(git rev-parse origin/main)
124
- printf '%s\n' "$sdk_release_sha" > "$sdk_release_dir/source-commit.txt"
125
- mkdir "$sdk_release_dir/source"
126
- git archive "$sdk_release_sha" | tar -x -C "$sdk_release_dir/source"
127
- (cd "$sdk_release_dir/source/current_data_py" && python -m build --no-isolation --outdir "$sdk_release_dir/dist")
128
- python "$sdk_release_dir/source/current_data_py/tests/check_distribution.py" --dist-dir "$sdk_release_dir/dist"
129
- python -m twine check "$sdk_release_dir/dist/"*
130
- python -m pip install --no-deps --force-reinstall "$sdk_release_dir/dist/"*.whl
131
- (
132
- cd "$sdk_release_dir"
133
- unset PYTHONPATH PYTHONHOME
134
- for check in package environment management labeling remote oss tos decoding; do
135
- python -I "$sdk_release_dir/source/current_data_py/tests/check_${check}.py"
136
- done
137
- )
138
- (cd "$sdk_release_dir/dist" && sha256sum *) > "$sdk_release_dir/SHA256SUMS"
139
- )
140
- ```
141
-
142
- Release checks run outside both source trees so child Python processes also use
143
- the installed wheel. They come from the recorded `origin/main` commit; unmerged
144
- local test fixes are not included in the export.
145
-
146
- Continue only after every check succeeds. Confirm `source-commit.txt` contains the
147
- intended main commit and inspect the wheel for the intended release features.
148
- Review the built package's README metadata for public display; exclude private
149
- deployment addresses, bucket names, and credentials. Keep the release directory
150
- and use these exact validated artifacts for uploading.
151
-
152
- ### Upload
153
-
154
- Use your configured PyPI credentials or Twine's interactive token prompt; do not
155
- put tokens in the README or shell commands. Run from the repository root in the
156
- same shell that defines `sdk_release_dir`.
157
-
158
- Fetch main again immediately before uploading. If its commit has changed, rebuild
159
- and rerun all checks from the new latest main. The command also checks that the
160
- artifacts still match the hashes recorded after validation:
161
-
162
- ```sh
163
- (
164
- set -e
165
- sdk_repository=pypi
166
- git fetch origin
167
- if [ "$(git rev-parse origin/main)" != "$(cat "$sdk_release_dir/source-commit.txt")" ]; then
168
- echo "origin/main changed; rebuild and validate the latest main before uploading." >&2
169
- exit 1
170
- fi
171
- (cd "$sdk_release_dir/dist" && sha256sum -c ../SHA256SUMS)
172
- python -m twine upload --repository "$sdk_repository" "$sdk_release_dir/dist/"*
173
- )
174
- ```
175
-
176
- For an optional TestPyPI trial, change `sdk_repository=pypi` to
177
- `sdk_repository=testpypi` in the same block and use TestPyPI credentials. Both
178
- registries require the latest-main and artifact checks.
179
-
180
- ### Verify the release
181
-
182
- After upload, verify that PyPI shows the expected version and rendered description.
183
- Compare the SHA-256 digests of both published files with `SHA256SUMS`, and retain
184
- that file with `source-commit.txt` as the release record. An optional TestPyPI trial
185
- does not replace verification of the production PyPI release.
1
+ # current-data-py
2
+
3
+ Python SDK for robotics Protobuf messages, TD files, and platform service clients.
4
+ Run shell commands from the repository root in the shared development environment.
5
+
6
+ ## Use locally
7
+
8
+ Run the bundled examples to write and read a local TD file using the installed SDK:
9
+
10
+ ```sh
11
+ python -I -m current_data_py.examples.write_td /tmp/current-data-example.td
12
+ python -I -m current_data_py.examples.read_td /tmp/current-data-example.td
13
+ ```
14
+
15
+ `-I` avoids importing the unbuilt source directory in place of the installed package.
16
+ See [examples](examples) for other entry points.
17
+
18
+ For a minimal read-only service call, run this snippet with `python -I` so it uses
19
+ the installed SDK:
20
+
21
+ ```python
22
+ from contextlib import closing
23
+ import os
24
+ os.environ["ENV"] = "test"
25
+
26
+ from current_data_py.management import ManagementClient, MetadataFilter
27
+
28
+ with ManagementClient() as client:
29
+ with closing(client.stream_data_references(MetadataFilter(), timeout=30)) as records:
30
+ record = next(records, None)
31
+ print(record.id if record is not None else "No matching data")
32
+ ```
33
+
34
+ Set `ENV=test` before the first SDK import to select the test service; an unset or
35
+ empty value defaults to production. An explicit client `address=` overrides the
36
+ default. Remote examples require service connectivity and accessible data.
37
+
38
+ Calibration workers can import `GLOVE_CALIBRATION_REPORT_URL` from
39
+ `current_data_py` for the environment's HTTPS Collection callback endpoint on
40
+ `DEFAULT_ADDRESS` (port 443).
41
+ Processing supplies `ENV` to the Job; set it before the first SDK import.
42
+ The worker needs network access to that platform domain.
43
+
44
+ ## Upload files
45
+
46
+ Use `OSSClient` or `TOSClient` with upload permission. The management service
47
+ selects the bucket and allowed object prefix; keep it open during transfers:
48
+
49
+ ```python
50
+ from current_data_py.management import ManagementClient
51
+ from current_data_py.tos import TOSClient
52
+
53
+ with ManagementClient() as management:
54
+ with TOSClient(management, permission="upload", data_type="YAM",
55
+ data_kind="CONVERTED") as storage:
56
+ storage.upload_file(storage.object_prefix + "recording.td", "/data/recording.td",
57
+ multipart_threshold=100 * 1024**2,
58
+ part_size=16 * 1024**2, max_workers=4)
59
+ ```
60
+
61
+ Both clients accept the same transfer options. Files at or above
62
+ `multipart_threshold` use multipart upload; `0` forces multipart for nonempty
63
+ files. Empty files always use PutObject. Sizes are in bytes. `part_size` must be
64
+ 5 MiB–5 GiB, and the file must fit within 10,000 parts; increase it for larger
65
+ files. `max_workers` controls parallel requests (1–64); part buffers use roughly
66
+ `part_size * max_workers` memory, plus SDK overhead. Do not modify the source
67
+ file during upload.
68
+
69
+ Uploads reject existing objects by default, including when completing multipart
70
+ uploads. Set `forbid_overwrite=False` to replace one. Content type and metadata
71
+ are preserved. The return value is the provider's PutObject result for small
72
+ files or CompleteMultipartUpload result for multipart files.
73
+
74
+ Failed multipart transfers attempt to abort and delete incomplete parts. A failed
75
+ cleanup emits a warning; check the bucket's incomplete uploads. The upload role
76
+ and its scoped STS policy must allow `oss:AbortMultipartUpload` or
77
+ `tos:AbortMultipartUpload` in addition to PutObject. Deploy the management-service
78
+ policy update and ensure the underlying cloud role permits cleanup before use.
79
+ There is no persistent checkpoint: a later call starts a new upload. Uploading
80
+ does not register the data; call `ManagementClient.register_data` separately.
81
+
82
+ ## Test changes
83
+
84
+ The package bundles generated Protobuf modules during its build. After protocol
85
+ changes, [regenerate the bindings](../README.md#protobuf) first.
86
+ Build into a fresh temporary directory, validate the artifacts, and install this
87
+ checkout's wheel before running its checks. Only the local package is installed;
88
+ shared dependencies are left unchanged:
89
+
90
+ ```sh
91
+ (
92
+ set -e
93
+ sdk_dist=$(mktemp -d)
94
+ trap 'rm -rf "$sdk_dist"' EXIT
95
+ (cd current_data_py && python -m build --no-isolation --outdir "$sdk_dist")
96
+ python current_data_py/tests/check_distribution.py --dist-dir "$sdk_dist"
97
+ python -m pip install --no-deps --force-reinstall "$sdk_dist"/*.whl
98
+ for check in package environment management labeling remote remote_v2 oss tos decoding multipart docs; do
99
+ python -I "current_data_py/tests/check_${check}.py"
100
+ done
101
+ )
102
+ ```
103
+
104
+ These checks cover packaging, environment selection, clients, and media decoding
105
+ using local fixtures and mocked services. They do not require production credentials
106
+ or prove connectivity to a deployed service.
107
+
108
+ ## Publish to PyPI
109
+
110
+ CI checks this SDK but does not publish it. Releases are manual and must use the
111
+ latest successfully fetched `origin/main`, including the version bump. Development
112
+ branches, uncommitted changes, and older main commits are not release sources. Follow the
113
+ [repository Git workflow](../.agents/rules/git-workflow.md).
114
+ Prepare the version update in `pyproject.toml` on a development branch and merge it
115
+ through review together with the intended SDK changes before building a release.
116
+ Use a version that has not already been published.
117
+
118
+ ### Build and validate
119
+
120
+ Run from the repository root. Fetch the latest `origin/main`, record its commit,
121
+ and build from a clean exported copy so local edits and old artifacts cannot enter
122
+ the release:
123
+
124
+ ```bash
125
+ sdk_release_dir=$(mktemp -d /tmp/current-data-release.XXXXXX)
126
+ (
127
+ set -euo pipefail
128
+ git fetch origin
129
+ sdk_release_sha=$(git rev-parse origin/main)
130
+ printf '%s\n' "$sdk_release_sha" > "$sdk_release_dir/source-commit.txt"
131
+ mkdir "$sdk_release_dir/source"
132
+ git archive "$sdk_release_sha" | tar -x -C "$sdk_release_dir/source"
133
+ (cd "$sdk_release_dir/source/current_data_py" && python -m build --no-isolation --outdir "$sdk_release_dir/dist")
134
+ python "$sdk_release_dir/source/current_data_py/tests/check_distribution.py" --dist-dir "$sdk_release_dir/dist"
135
+ python -m twine check "$sdk_release_dir/dist/"*
136
+ python -m pip install --no-deps --force-reinstall "$sdk_release_dir/dist/"*.whl
137
+ (
138
+ cd "$sdk_release_dir"
139
+ unset PYTHONPATH PYTHONHOME
140
+ for check in package environment management labeling remote remote_v2 oss tos decoding; do
141
+ python -I "$sdk_release_dir/source/current_data_py/tests/check_${check}.py"
142
+ done
143
+ )
144
+ (cd "$sdk_release_dir/dist" && sha256sum *) > "$sdk_release_dir/SHA256SUMS"
145
+ )
146
+ ```
147
+
148
+ Release checks run outside both source trees so child Python processes also use
149
+ the installed wheel. They come from the recorded `origin/main` commit; unmerged
150
+ local test fixes are not included in the export.
151
+
152
+ Continue only after every check succeeds. Confirm `source-commit.txt` contains the
153
+ intended main commit and inspect the wheel for the intended release features.
154
+ Review the built package's README metadata for public display; exclude private
155
+ deployment addresses, bucket names, and credentials. Keep the release directory
156
+ and use these exact validated artifacts for uploading.
157
+
158
+ ### Upload
159
+
160
+ Use your configured PyPI credentials or Twine's interactive token prompt; do not
161
+ put tokens in the README or shell commands. Run from the repository root in the
162
+ same shell that defines `sdk_release_dir`.
163
+
164
+ Fetch main again immediately before uploading. If its commit has changed, rebuild
165
+ and rerun all checks from the new latest main. The command also checks that the
166
+ artifacts still match the hashes recorded after validation:
167
+
168
+ ```sh
169
+ (
170
+ set -e
171
+ sdk_repository=pypi
172
+ git fetch origin
173
+ if [ "$(git rev-parse origin/main)" != "$(cat "$sdk_release_dir/source-commit.txt")" ]; then
174
+ echo "origin/main changed; rebuild and validate the latest main before uploading." >&2
175
+ exit 1
176
+ fi
177
+ (cd "$sdk_release_dir/dist" && sha256sum -c ../SHA256SUMS)
178
+ python -m twine upload --repository "$sdk_repository" "$sdk_release_dir/dist/"*
179
+ )
180
+ ```
181
+
182
+ For an optional TestPyPI trial, change `sdk_repository=pypi` to
183
+ `sdk_repository=testpypi` in the same block and use TestPyPI credentials. Both
184
+ registries require the latest-main and artifact checks.
185
+
186
+ ### Verify the release
187
+
188
+ After upload, verify that PyPI shows the expected version and rendered description.
189
+ Compare the SHA-256 digests of both published files with `SHA256SUMS`, and retain
190
+ that file with `source-commit.txt` as the release record. An optional TestPyPI trial
191
+ does not replace verification of the production PyPI release.
@@ -1,17 +1,24 @@
1
- """Protobuf message schemas and metadata for Current Data."""
2
-
3
- import os as _os
4
-
5
- from .schema.message_metadata import descriptor_set, topic_metadata
6
- from .schema import SCHEMA_TO_CLASS
7
-
8
- _environment = _os.environ.get("ENV") or "prod"
9
- if _environment not in ("prod", "test"):
10
- raise ValueError("ENV must be prod or test")
11
-
12
- DEFAULT_ADDRESS = (
13
- "data-test.current-robotics.work:443"
14
- if _environment == "test" else "data.current-robotics.work:443"
15
- )
16
-
17
- __all__ = ["DEFAULT_ADDRESS", "SCHEMA_TO_CLASS", "descriptor_set", "topic_metadata"]
1
+ """Protobuf message schemas and metadata for Current Data."""
2
+
3
+ import os as _os
4
+
5
+ from .schema.message_metadata import descriptor_set, topic_metadata
6
+ from .schema import SCHEMA_TO_CLASS
7
+
8
+ _environment = _os.environ.get("ENV") or "prod"
9
+ if _environment not in ("prod", "test"):
10
+ raise ValueError("ENV must be prod or test")
11
+
12
+ DEFAULT_ADDRESS = (
13
+ "data-test.current-robotics.work:443"
14
+ if _environment == "test" else "data.current-robotics.work:443"
15
+ )
16
+ GLOVE_CALIBRATION_REPORT_URL = (
17
+ f"https://{DEFAULT_ADDRESS}"
18
+ "/api/collection.service.v1.CollectionService/ReportGloveCalibration"
19
+ )
20
+
21
+ __all__ = [
22
+ "DEFAULT_ADDRESS", "GLOVE_CALIBRATION_REPORT_URL", "SCHEMA_TO_CLASS",
23
+ "descriptor_set", "topic_metadata",
24
+ ]
@@ -1,52 +1,52 @@
1
- """Bounded-memory multipart scheduling shared by OSS and TOS."""
2
- from concurrent.futures import ThreadPoolExecutor
3
- import os
4
- import warnings
5
-
6
-
7
- def upload_size(path, threshold, part_size, max_workers):
8
- for name, value, minimum, maximum in (
9
- ("multipart_threshold", threshold, 0, 5 * 1024**3),
10
- ("part_size", part_size, 5 * 1024**2, 5 * 1024**3),
11
- ("max_workers", max_workers, 1, 64),
12
- ):
13
- if isinstance(value, bool) or not isinstance(value, int) or not minimum <= value <= maximum:
14
- raise ValueError(f"{name} must be an integer between {minimum} and {maximum}")
15
- size = os.stat(path).st_size
16
- if (size + part_size - 1) // part_size > 10000:
17
- raise ValueError("Upload exceeds 10000 parts; increase part_size")
18
- return size
19
-
20
-
21
- def transfer(path, size, part_size, max_workers, start, put, complete, abort):
22
- # Verify the file before creating any remote upload. Each worker opens its
23
- # own handle and retains at most one part; queued tasks contain only offsets.
24
- with open(path, "rb") as source:
25
- before = os.fstat(source.fileno())
26
- if before.st_size != size:
27
- raise ValueError("Upload source changed before transfer")
28
- upload_id = start()
29
-
30
- def send(number):
31
- offset = (number - 1) * part_size
32
- length = min(part_size, size - offset)
33
- with open(path, "rb") as source:
34
- source.seek(offset)
35
- data = source.read(length)
36
- if len(data) != length:
37
- raise ValueError("Upload source changed during transfer")
38
- return number, put(upload_id, number, data)
39
-
40
- try:
41
- with ThreadPoolExecutor(max_workers=max_workers) as pool:
42
- parts = list(pool.map(send, range(1, (size + part_size - 1) // part_size + 1)))
43
- after = os.stat(path)
44
- if (before.st_size, before.st_mtime_ns, before.st_ino) != (after.st_size, after.st_mtime_ns, after.st_ino):
45
- raise ValueError("Upload source changed during transfer")
46
- return complete(upload_id, parts)
47
- except BaseException:
48
- try:
49
- abort(upload_id)
50
- except Exception:
51
- warnings.warn("Multipart cleanup failed; incomplete parts may remain in storage", RuntimeWarning)
52
- raise
1
+ """Bounded-memory multipart scheduling shared by OSS and TOS."""
2
+ from concurrent.futures import ThreadPoolExecutor
3
+ import os
4
+ import warnings
5
+
6
+
7
+ def upload_size(path, threshold, part_size, max_workers):
8
+ for name, value, minimum, maximum in (
9
+ ("multipart_threshold", threshold, 0, 5 * 1024**3),
10
+ ("part_size", part_size, 5 * 1024**2, 5 * 1024**3),
11
+ ("max_workers", max_workers, 1, 64),
12
+ ):
13
+ if isinstance(value, bool) or not isinstance(value, int) or not minimum <= value <= maximum:
14
+ raise ValueError(f"{name} must be an integer between {minimum} and {maximum}")
15
+ size = os.stat(path).st_size
16
+ if (size + part_size - 1) // part_size > 10000:
17
+ raise ValueError("Upload exceeds 10000 parts; increase part_size")
18
+ return size
19
+
20
+
21
+ def transfer(path, size, part_size, max_workers, start, put, complete, abort):
22
+ # Verify the file before creating any remote upload. Each worker opens its
23
+ # own handle and retains at most one part; queued tasks contain only offsets.
24
+ with open(path, "rb") as source:
25
+ before = os.fstat(source.fileno())
26
+ if before.st_size != size:
27
+ raise ValueError("Upload source changed before transfer")
28
+ upload_id = start()
29
+
30
+ def send(number):
31
+ offset = (number - 1) * part_size
32
+ length = min(part_size, size - offset)
33
+ with open(path, "rb") as source:
34
+ source.seek(offset)
35
+ data = source.read(length)
36
+ if len(data) != length:
37
+ raise ValueError("Upload source changed during transfer")
38
+ return number, put(upload_id, number, data)
39
+
40
+ try:
41
+ with ThreadPoolExecutor(max_workers=max_workers) as pool:
42
+ parts = list(pool.map(send, range(1, (size + part_size - 1) // part_size + 1)))
43
+ after = os.stat(path)
44
+ if (before.st_size, before.st_mtime_ns, before.st_ino) != (after.st_size, after.st_mtime_ns, after.st_ino):
45
+ raise ValueError("Upload source changed during transfer")
46
+ return complete(upload_id, parts)
47
+ except BaseException:
48
+ try:
49
+ abort(upload_id)
50
+ except Exception:
51
+ warnings.warn("Multipart cleanup failed; incomplete parts may remain in storage", RuntimeWarning)
52
+ raise
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: current-data-py
3
- Version: 0.1.16
3
+ Version: 0.1.17
4
4
  Summary: Current Data protobuf messages and schema metadata
5
5
  Requires-Python: >=3.9
6
6
  Description-Content-Type: text/markdown
@@ -49,6 +49,12 @@ Set `ENV=test` before the first SDK import to select the test service; an unset
49
49
  empty value defaults to production. An explicit client `address=` overrides the
50
50
  default. Remote examples require service connectivity and accessible data.
51
51
 
52
+ Calibration workers can import `GLOVE_CALIBRATION_REPORT_URL` from
53
+ `current_data_py` for the environment's HTTPS Collection callback endpoint on
54
+ `DEFAULT_ADDRESS` (port 443).
55
+ Processing supplies `ENV` to the Job; set it before the first SDK import.
56
+ The worker needs network access to that platform domain.
57
+
52
58
  ## Upload files
53
59
 
54
60
  Use `OSSClient` or `TOSClient` with upload permission. The management service
@@ -103,7 +109,7 @@ shared dependencies are left unchanged:
103
109
  (cd current_data_py && python -m build --no-isolation --outdir "$sdk_dist")
104
110
  python current_data_py/tests/check_distribution.py --dist-dir "$sdk_dist"
105
111
  python -m pip install --no-deps --force-reinstall "$sdk_dist"/*.whl
106
- for check in package environment management labeling remote oss tos decoding multipart docs; do
112
+ for check in package environment management labeling remote remote_v2 oss tos decoding multipart docs; do
107
113
  python -I "current_data_py/tests/check_${check}.py"
108
114
  done
109
115
  )
@@ -145,7 +151,7 @@ sdk_release_dir=$(mktemp -d /tmp/current-data-release.XXXXXX)
145
151
  (
146
152
  cd "$sdk_release_dir"
147
153
  unset PYTHONPATH PYTHONHOME
148
- for check in package environment management labeling remote oss tos decoding; do
154
+ for check in package environment management labeling remote remote_v2 oss tos decoding; do
149
155
  python -I "$sdk_release_dir/source/current_data_py/tests/check_${check}.py"
150
156
  done
151
157
  )