current-data-py 0.1.17__tar.gz → 0.1.21__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 (127) hide show
  1. {current_data_py-0.1.17 → current_data_py-0.1.21}/MANIFEST.in +10 -8
  2. {current_data_py-0.1.17/current_data_py.egg-info → current_data_py-0.1.21}/PKG-INFO +61 -85
  3. {current_data_py-0.1.17 → current_data_py-0.1.21}/README.md +167 -191
  4. {current_data_py-0.1.17 → current_data_py-0.1.21}/__init__.py +24 -24
  5. {current_data_py-0.1.17 → current_data_py-0.1.21}/_multipart.py +52 -52
  6. current_data_py-0.1.21/_urdf_dae.py +37 -0
  7. current_data_py-0.1.21/_urdf_directory.py +87 -0
  8. current_data_py-0.1.21/_urdf_mesh.py +39 -0
  9. current_data_py-0.1.21/_urdf_validation.py +230 -0
  10. {current_data_py-0.1.17 → current_data_py-0.1.21/current_data_py.egg-info}/PKG-INFO +61 -85
  11. {current_data_py-0.1.17 → current_data_py-0.1.21}/current_data_py.egg-info/SOURCES.txt +27 -1
  12. {current_data_py-0.1.17 → current_data_py-0.1.21}/decoding.py +179 -179
  13. {current_data_py-0.1.17 → current_data_py-0.1.21}/docs/api/management.md +598 -470
  14. {current_data_py-0.1.17 → current_data_py-0.1.21}/docs/api/processing.md +699 -699
  15. {current_data_py-0.1.17 → current_data_py-0.1.21}/docs/index.md +88 -70
  16. {current_data_py-0.1.17 → current_data_py-0.1.21}/docs/skills/convert-robot-data/SKILL.md +211 -211
  17. {current_data_py-0.1.17 → current_data_py-0.1.21}/docs/skills/data-platform/SKILL.md +32 -32
  18. {current_data_py-0.1.17 → current_data_py-0.1.21}/docs/skills/data-platform/references/api.md +38 -37
  19. {current_data_py-0.1.17 → current_data_py-0.1.21}/docs/skills/data-platform/references/data-transfer.md +62 -62
  20. current_data_py-0.1.21/docs/skills/data-platform/references/dev-pod.md +80 -0
  21. {current_data_py-0.1.17 → current_data_py-0.1.21}/docs/skills/data-platform/references/jobs.md +93 -86
  22. {current_data_py-0.1.17 → current_data_py-0.1.21}/docs/skills/data-platform/references/test-environment.md +26 -26
  23. {current_data_py-0.1.17 → current_data_py-0.1.21}/docs/skills/data-platform/references/use-cases.md +82 -82
  24. {current_data_py-0.1.17 → current_data_py-0.1.21}/docs/skills/sdk-client/SKILL.md +11 -11
  25. {current_data_py-0.1.17 → current_data_py-0.1.21}/docs/skills/sdk-client/references/data-client.md +395 -379
  26. {current_data_py-0.1.17 → current_data_py-0.1.21}/docs/skills/sdk-client/references/metadata-v2.md +160 -156
  27. current_data_py-0.1.21/docs/urdf.md +84 -0
  28. {current_data_py-0.1.17 → current_data_py-0.1.21}/docs.py +46 -46
  29. {current_data_py-0.1.17 → current_data_py-0.1.21}/examples/__init__.py +1 -1
  30. {current_data_py-0.1.17 → current_data_py-0.1.21}/examples/list_schemas.py +7 -7
  31. {current_data_py-0.1.17 → current_data_py-0.1.21}/examples/read_remote_td.py +54 -54
  32. {current_data_py-0.1.17 → current_data_py-0.1.21}/examples/read_td.py +30 -30
  33. current_data_py-0.1.21/examples/upload_urdf.py +38 -0
  34. {current_data_py-0.1.17 → current_data_py-0.1.21}/examples/write_td.py +30 -30
  35. {current_data_py-0.1.17 → current_data_py-0.1.21}/labeling.py +102 -102
  36. {current_data_py-0.1.17 → current_data_py-0.1.21}/management.py +367 -312
  37. {current_data_py-0.1.17 → current_data_py-0.1.21}/oss.py +245 -229
  38. current_data_py-0.1.21/proto_gen/python/labeling/service/service_pb2.py +79 -0
  39. {current_data_py-0.1.17 → current_data_py-0.1.21}/proto_gen/python/labeling/service/service_pb2_grpc.py +439 -435
  40. {current_data_py-0.1.17 → current_data_py-0.1.21}/proto_gen/python/labeling/task/task_pb2.py +52 -52
  41. {current_data_py-0.1.17 → current_data_py-0.1.21}/proto_gen/python/labeling/template/template_pb2.py +40 -40
  42. {current_data_py-0.1.17 → current_data_py-0.1.21}/proto_gen/python/management/metadata/metadata_pb2.py +74 -74
  43. {current_data_py-0.1.17 → current_data_py-0.1.21}/proto_gen/python/management/selection/selection_pb2.py +27 -27
  44. current_data_py-0.1.21/proto_gen/python/management/service/service_pb2.py +157 -0
  45. {current_data_py-0.1.17 → current_data_py-0.1.21}/proto_gen/python/management/service/service_pb2_grpc.py +931 -831
  46. current_data_py-0.1.21/proto_gen/python/management/urdf/asset_pb2.py +31 -0
  47. {current_data_py-0.1.17 → current_data_py-0.1.21}/proto_gen/python/msg/builtin_interfaces/duration_pb2.py +25 -25
  48. {current_data_py-0.1.17 → current_data_py-0.1.21}/proto_gen/python/msg/builtin_interfaces/time_pb2.py +25 -25
  49. {current_data_py-0.1.17 → current_data_py-0.1.21}/proto_gen/python/msg/custom_msgs/encoder_status_pb2.py +25 -25
  50. {current_data_py-0.1.17 → current_data_py-0.1.21}/proto_gen/python/msg/custom_msgs/joint_current_pb2.py +26 -26
  51. {current_data_py-0.1.17 → current_data_py-0.1.21}/proto_gen/python/msg/custom_msgs/keypoints_quality_pb2.py +25 -25
  52. {current_data_py-0.1.17 → current_data_py-0.1.21}/proto_gen/python/msg/custom_msgs/pose_rpy_pb2.py +26 -26
  53. {current_data_py-0.1.17 → current_data_py-0.1.21}/proto_gen/python/msg/custom_msgs/slam_quality_pb2.py +25 -25
  54. {current_data_py-0.1.17 → current_data_py-0.1.21}/proto_gen/python/msg/custom_msgs/sonic_frame_pb2.py +25 -25
  55. {current_data_py-0.1.17 → current_data_py-0.1.21}/proto_gen/python/msg/custom_msgs/subtask_description_pb2.py +25 -25
  56. {current_data_py-0.1.17 → current_data_py-0.1.21}/proto_gen/python/msg/custom_msgs/target_quality_pb2.py +25 -25
  57. {current_data_py-0.1.17 → current_data_py-0.1.21}/proto_gen/python/msg/foxglove/compressed_audio_pb2.py +26 -26
  58. {current_data_py-0.1.17 → current_data_py-0.1.21}/proto_gen/python/msg/foxglove/compressed_video_pb2.py +26 -26
  59. {current_data_py-0.1.17 → current_data_py-0.1.21}/proto_gen/python/msg/geometry_msgs/point32_pb2.py +25 -25
  60. {current_data_py-0.1.17 → current_data_py-0.1.21}/proto_gen/python/msg/geometry_msgs/point_pb2.py +25 -25
  61. {current_data_py-0.1.17 → current_data_py-0.1.21}/proto_gen/python/msg/geometry_msgs/pose_array_pb2.py +27 -27
  62. {current_data_py-0.1.17 → current_data_py-0.1.21}/proto_gen/python/msg/geometry_msgs/pose_pb2.py +27 -27
  63. {current_data_py-0.1.17 → current_data_py-0.1.21}/proto_gen/python/msg/geometry_msgs/pose_stamped_pb2.py +27 -27
  64. {current_data_py-0.1.17 → current_data_py-0.1.21}/proto_gen/python/msg/geometry_msgs/pose_with_covariance_pb2.py +26 -26
  65. {current_data_py-0.1.17 → current_data_py-0.1.21}/proto_gen/python/msg/geometry_msgs/pose_with_covariance_stamped_pb2.py +27 -27
  66. {current_data_py-0.1.17 → current_data_py-0.1.21}/proto_gen/python/msg/geometry_msgs/quaternion_pb2.py +25 -25
  67. {current_data_py-0.1.17 → current_data_py-0.1.21}/proto_gen/python/msg/geometry_msgs/transform_pb2.py +27 -27
  68. {current_data_py-0.1.17 → current_data_py-0.1.21}/proto_gen/python/msg/geometry_msgs/transform_stamped_pb2.py +27 -27
  69. {current_data_py-0.1.17 → current_data_py-0.1.21}/proto_gen/python/msg/geometry_msgs/twist_pb2.py +26 -26
  70. {current_data_py-0.1.17 → current_data_py-0.1.21}/proto_gen/python/msg/geometry_msgs/twist_stamped_pb2.py +27 -27
  71. {current_data_py-0.1.17 → current_data_py-0.1.21}/proto_gen/python/msg/geometry_msgs/twist_with_covariance_pb2.py +26 -26
  72. {current_data_py-0.1.17 → current_data_py-0.1.21}/proto_gen/python/msg/geometry_msgs/twist_with_covariance_stamped_pb2.py +27 -27
  73. {current_data_py-0.1.17 → current_data_py-0.1.21}/proto_gen/python/msg/geometry_msgs/vector3_pb2.py +25 -25
  74. {current_data_py-0.1.17 → current_data_py-0.1.21}/proto_gen/python/msg/geometry_msgs/wrench_pb2.py +26 -26
  75. {current_data_py-0.1.17 → current_data_py-0.1.21}/proto_gen/python/msg/geometry_msgs/wrench_stamped_pb2.py +27 -27
  76. {current_data_py-0.1.17 → current_data_py-0.1.21}/proto_gen/python/msg/nav_msgs/map_meta_data_pb2.py +27 -27
  77. {current_data_py-0.1.17 → current_data_py-0.1.21}/proto_gen/python/msg/nav_msgs/occupancy_grid_pb2.py +27 -27
  78. {current_data_py-0.1.17 → current_data_py-0.1.21}/proto_gen/python/msg/nav_msgs/odometry_pb2.py +28 -28
  79. {current_data_py-0.1.17 → current_data_py-0.1.21}/proto_gen/python/msg/nav_msgs/path_pb2.py +27 -27
  80. {current_data_py-0.1.17 → current_data_py-0.1.21}/proto_gen/python/msg/sensor_msgs/battery_state_pb2.py +32 -32
  81. {current_data_py-0.1.17 → current_data_py-0.1.21}/proto_gen/python/msg/sensor_msgs/camera_info_pb2.py +27 -27
  82. {current_data_py-0.1.17 → current_data_py-0.1.21}/proto_gen/python/msg/sensor_msgs/compressed_image_pb2.py +26 -26
  83. {current_data_py-0.1.17 → current_data_py-0.1.21}/proto_gen/python/msg/sensor_msgs/image_pb2.py +26 -26
  84. {current_data_py-0.1.17 → current_data_py-0.1.21}/proto_gen/python/msg/sensor_msgs/imu_pb2.py +28 -28
  85. {current_data_py-0.1.17 → current_data_py-0.1.21}/proto_gen/python/msg/sensor_msgs/joint_state_pb2.py +26 -26
  86. {current_data_py-0.1.17 → current_data_py-0.1.21}/proto_gen/python/msg/sensor_msgs/laser_scan_pb2.py +26 -26
  87. {current_data_py-0.1.17 → current_data_py-0.1.21}/proto_gen/python/msg/sensor_msgs/nav_sat_fix_pb2.py +29 -29
  88. {current_data_py-0.1.17 → current_data_py-0.1.21}/proto_gen/python/msg/sensor_msgs/nav_sat_status_pb2.py +27 -27
  89. {current_data_py-0.1.17 → current_data_py-0.1.21}/proto_gen/python/msg/sensor_msgs/point_cloud2_pb2.py +27 -27
  90. {current_data_py-0.1.17 → current_data_py-0.1.21}/proto_gen/python/msg/sensor_msgs/point_field_pb2.py +27 -27
  91. {current_data_py-0.1.17 → current_data_py-0.1.21}/proto_gen/python/msg/sensor_msgs/range_pb2.py +28 -28
  92. {current_data_py-0.1.17 → current_data_py-0.1.21}/proto_gen/python/msg/sensor_msgs/region_of_interest_pb2.py +25 -25
  93. {current_data_py-0.1.17 → current_data_py-0.1.21}/proto_gen/python/msg/std_msgs/bool_pb2.py +25 -25
  94. {current_data_py-0.1.17 → current_data_py-0.1.21}/proto_gen/python/msg/std_msgs/color_rgba_pb2.py +25 -25
  95. {current_data_py-0.1.17 → current_data_py-0.1.21}/proto_gen/python/msg/std_msgs/float32_pb2.py +25 -25
  96. {current_data_py-0.1.17 → current_data_py-0.1.21}/proto_gen/python/msg/std_msgs/float64_pb2.py +25 -25
  97. {current_data_py-0.1.17 → current_data_py-0.1.21}/proto_gen/python/msg/std_msgs/header_pb2.py +26 -26
  98. {current_data_py-0.1.17 → current_data_py-0.1.21}/proto_gen/python/msg/std_msgs/int32_pb2.py +25 -25
  99. {current_data_py-0.1.17 → current_data_py-0.1.21}/proto_gen/python/msg/std_msgs/string_pb2.py +25 -25
  100. {current_data_py-0.1.17 → current_data_py-0.1.21}/proto_gen/python/msg/std_msgs/uint32_pb2.py +25 -25
  101. {current_data_py-0.1.17 → current_data_py-0.1.21}/proto_gen/python/msg/tf2_msgs/tf_message_pb2.py +26 -26
  102. {current_data_py-0.1.17 → current_data_py-0.1.21}/pyproject.toml +24 -24
  103. {current_data_py-0.1.17 → current_data_py-0.1.21}/remote/__init__.py +7 -7
  104. {current_data_py-0.1.17 → current_data_py-0.1.21}/remote/client.py +303 -293
  105. {current_data_py-0.1.17 → current_data_py-0.1.21}/remote/source.py +99 -99
  106. {current_data_py-0.1.17 → current_data_py-0.1.21}/remote/tos_source.py +84 -84
  107. {current_data_py-0.1.17 → current_data_py-0.1.21}/schema/__init__.py +113 -113
  108. {current_data_py-0.1.17 → current_data_py-0.1.21}/schema/message_metadata.py +30 -30
  109. {current_data_py-0.1.17 → current_data_py-0.1.21}/setup.py +91 -93
  110. {current_data_py-0.1.17 → current_data_py-0.1.21}/tests/check_docs.py +79 -74
  111. {current_data_py-0.1.17 → current_data_py-0.1.21}/tests/check_environment.py +83 -83
  112. {current_data_py-0.1.17 → current_data_py-0.1.21}/tests/check_labeling.py +111 -111
  113. {current_data_py-0.1.17 → current_data_py-0.1.21}/tests/check_management.py +588 -588
  114. {current_data_py-0.1.17 → current_data_py-0.1.21}/tests/check_oss.py +542 -424
  115. {current_data_py-0.1.17 → current_data_py-0.1.21}/tests/check_package.py +44 -44
  116. {current_data_py-0.1.17 → current_data_py-0.1.21}/tests/check_remote.py +352 -343
  117. current_data_py-0.1.21/tests/check_urdf.py +440 -0
  118. current_data_py-0.1.21/tests/check_urdf_validation.py +286 -0
  119. {current_data_py-0.1.17 → current_data_py-0.1.21}/tos.py +195 -191
  120. current_data_py-0.1.21/urdf.py +66 -0
  121. current_data_py-0.1.17/docs/skills/data-platform/references/dev-pod.md +0 -62
  122. current_data_py-0.1.17/proto_gen/python/labeling/service/service_pb2.py +0 -79
  123. current_data_py-0.1.17/proto_gen/python/management/service/service_pb2.py +0 -118
  124. {current_data_py-0.1.17 → current_data_py-0.1.21}/current_data_py.egg-info/dependency_links.txt +0 -0
  125. {current_data_py-0.1.17 → current_data_py-0.1.21}/current_data_py.egg-info/requires.txt +0 -0
  126. {current_data_py-0.1.17 → current_data_py-0.1.21}/current_data_py.egg-info/top_level.txt +0 -0
  127. {current_data_py-0.1.17 → current_data_py-0.1.21}/setup.cfg +0 -0
@@ -1,8 +1,10 @@
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
+ include tests/check_urdf.py
9
+ include tests/check_urdf_validation.py
10
+ recursive-include docs *.md
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: current-data-py
3
- Version: 0.1.17
3
+ Version: 0.1.21
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,16 @@ 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
+ Downloads and remote reads default to the storage provider's
53
+ internal endpoint (`OSSClient` / `TOSClient` read permission, `download_data`,
54
+ `open_data`, and `open_td`). Outside that cloud network, pass
55
+ `use_internal_endpoint=False`; there is no automatic public fallback. A supplied
56
+ TOS `endpoint` selects that public address unless internal networking is explicitly
57
+ requested, which remains an error. Uploads still default to public networking.
58
+ OSS `open_td` without `bucket` infers the selected provider's unique bucket from
59
+ metadata; multiple buckets require an explicit selection. The SDK manages temporary
60
+ credentials for uploads, downloads and remote TD reads.
61
+
52
62
  Calibration workers can import `GLOVE_CALIBRATION_REPORT_URL` from
53
63
  `current_data_py` for the environment's HTTPS Collection callback endpoint on
54
64
  `DEFAULT_ADDRESS` (port 443).
@@ -58,7 +68,8 @@ The worker needs network access to that platform domain.
58
68
  ## Upload files
59
69
 
60
70
  Use `OSSClient` or `TOSClient` with upload permission. The management service
61
- selects the bucket and allowed object prefix; keep it open during transfers:
71
+ selects the bucket and allowed object prefix. Both clients
72
+ require `data_type` and `data_kind`; keep the management client open during transfers:
62
73
 
63
74
  ```python
64
75
  from current_data_py.management import ManagementClient
@@ -93,6 +104,19 @@ policy update and ensure the underlying cloud role permits cleanup before use.
93
104
  There is no persistent checkpoint: a later call starts a new upload. Uploading
94
105
  does not register the data; call `ManagementClient.register_data` separately.
95
106
 
107
+ ## URDF packages
108
+
109
+ Use `ManagementClient.upload_urdf(directory, entrypoint, info=...)` to check local
110
+ dependencies, upload source files without overwriting objects, and register one
111
+ asset under a new UUID on each call. Keep the directory unchanged throughout the
112
+ call; validation, hashing and upload read the source directly without private
113
+ copies. Failed calls leave uploaded objects in place and do not resume or recover
114
+ registration on a later call.
115
+ STL, static COLLADA, OBJ/MTL and PNG/JPEG references are supported; rendering is
116
+ checked in preview. The result is the locally generated asset UUID; model lists
117
+ provide URDF URLs. See the
118
+ [URDF guide](docs/urdf.md) and run `python -I -m current_data_py.examples.upload_urdf --help`.
119
+
96
120
  ## Test changes
97
121
 
98
122
  The package bundles generated Protobuf modules during its build. After protocol
@@ -109,7 +133,7 @@ shared dependencies are left unchanged:
109
133
  (cd current_data_py && python -m build --no-isolation --outdir "$sdk_dist")
110
134
  python current_data_py/tests/check_distribution.py --dist-dir "$sdk_dist"
111
135
  python -m pip install --no-deps --force-reinstall "$sdk_dist"/*.whl
112
- for check in package environment management labeling remote remote_v2 oss tos decoding multipart docs; do
136
+ for check in package environment management labeling remote remote_v2 oss tos decoding multipart urdf urdf_validation docs; do
113
137
  python -I "current_data_py/tests/check_${check}.py"
114
138
  done
115
139
  )
@@ -121,85 +145,37 @@ or prove connectivity to a deployed service.
121
145
 
122
146
  ## Publish to PyPI
123
147
 
124
- CI checks this SDK but does not publish it. Releases are manual and must use the
125
- latest successfully fetched `origin/main`, including the version bump. Development
126
- branches, uncommitted changes, and older main commits are not release sources. Follow the
127
- [repository Git workflow](../.agents/rules/git-workflow.md).
128
- Prepare the version update in `pyproject.toml` on a development branch and merge it
129
- through review together with the intended SDK changes before building a release.
130
- Use a version that has not already been published.
131
-
132
- ### Build and validate
133
-
134
- Run from the repository root. Fetch the latest `origin/main`, record its commit,
135
- and build from a clean exported copy so local edits and old artifacts cannot enter
136
- the release:
137
-
138
- ```bash
139
- sdk_release_dir=$(mktemp -d /tmp/current-data-release.XXXXXX)
140
- (
141
- set -euo pipefail
142
- git fetch origin
143
- sdk_release_sha=$(git rev-parse origin/main)
144
- printf '%s\n' "$sdk_release_sha" > "$sdk_release_dir/source-commit.txt"
145
- mkdir "$sdk_release_dir/source"
146
- git archive "$sdk_release_sha" | tar -x -C "$sdk_release_dir/source"
147
- (cd "$sdk_release_dir/source/current_data_py" && python -m build --no-isolation --outdir "$sdk_release_dir/dist")
148
- python "$sdk_release_dir/source/current_data_py/tests/check_distribution.py" --dist-dir "$sdk_release_dir/dist"
149
- python -m twine check "$sdk_release_dir/dist/"*
150
- python -m pip install --no-deps --force-reinstall "$sdk_release_dir/dist/"*.whl
151
- (
152
- cd "$sdk_release_dir"
153
- unset PYTHONPATH PYTHONHOME
154
- for check in package environment management labeling remote remote_v2 oss tos decoding; do
155
- python -I "$sdk_release_dir/source/current_data_py/tests/check_${check}.py"
156
- done
157
- )
158
- (cd "$sdk_release_dir/dist" && sha256sum *) > "$sdk_release_dir/SHA256SUMS"
159
- )
160
- ```
161
-
162
- Release checks run outside both source trees so child Python processes also use
163
- the installed wheel. They come from the recorded `origin/main` commit; unmerged
164
- local test fixes are not included in the export.
165
-
166
- Continue only after every check succeeds. Confirm `source-commit.txt` contains the
167
- intended main commit and inspect the wheel for the intended release features.
168
- Review the built package's README metadata for public display; exclude private
169
- deployment addresses, bucket names, and credentials. Keep the release directory
170
- and use these exact validated artifacts for uploading.
171
-
172
- ### Upload
173
-
174
- Use your configured PyPI credentials or Twine's interactive token prompt; do not
175
- put tokens in the README or shell commands. Run from the repository root in the
176
- same shell that defines `sdk_release_dir`.
177
-
178
- Fetch main again immediately before uploading. If its commit has changed, rebuild
179
- and rerun all checks from the new latest main. The command also checks that the
180
- artifacts still match the hashes recorded after validation:
181
-
182
- ```sh
183
- (
184
- set -e
185
- sdk_repository=pypi
186
- git fetch origin
187
- if [ "$(git rev-parse origin/main)" != "$(cat "$sdk_release_dir/source-commit.txt")" ]; then
188
- echo "origin/main changed; rebuild and validate the latest main before uploading." >&2
189
- exit 1
190
- fi
191
- (cd "$sdk_release_dir/dist" && sha256sum -c ../SHA256SUMS)
192
- python -m twine upload --repository "$sdk_repository" "$sdk_release_dir/dist/"*
193
- )
194
- ```
195
-
196
- For an optional TestPyPI trial, change `sdk_repository=pypi` to
197
- `sdk_repository=testpypi` in the same block and use TestPyPI credentials. Both
198
- registries require the latest-main and artifact checks.
199
-
200
- ### Verify the release
201
-
202
- After upload, verify that PyPI shows the expected version and rendered description.
203
- Compare the SHA-256 digests of both published files with `SHA256SUMS`, and retain
204
- that file with `source-commit.txt` as the release record. An optional TestPyPI trial
205
- does not replace verification of the production PyPI release.
148
+ Ordinary CI builds a temporary package and tests the installed wheel. It does not
149
+ retain SDK release artifacts or upload to a package index.
150
+
151
+ 1. Run **Release** from `main`, select `environment=test`, and check
152
+ `current_data_py`. Leave service selections, `commit`, and `sdk_version` empty.
153
+ It creates a PR that increases `project.version` to the next unused patch
154
+ version (for example, `0.1.20` → `0.1.21`). Review and merge it to start
155
+ **SDK Publish**. Major/minor version changes can still use a manual version PR.
156
+ 2. The workflow checks generated Protobuf files, builds and tests the wheel/sdist,
157
+ retains them for 90 days, and uploads them to TestPyPI. `verify_test` checks
158
+ remote SHA-256 digests and installs the package in a clean environment.
159
+ 3. Complete functional testing against the test services. TestPyPI publication
160
+ does not update existing SDK consumers; install the exact version and set
161
+ `ENV=test` before importing the SDK. Registry selection and service environment
162
+ selection are independent.
163
+ 4. Run **Release** from `main`, select `environment=prod`, check `current_data_py`,
164
+ and enter the verified `sdk_version`.
165
+ Leave service selections and `commit` empty. It creates a PR containing the
166
+ tested version, source SHA, run/attempt, artifact ID and file digests.
167
+ 5. Obtain owner approval on the release PR's latest commit and merge it. The
168
+ workflow downloads those exact distributions and publishes them to PyPI;
169
+ it does not rebuild them or use newer SDK source. `verify_prod` checks remote
170
+ digests and installation. Production consumers must explicitly upgrade.
171
+
172
+ A test version with code changes needs a new version number. Re-run failed jobs
173
+ for upload or verification failures: matching existing files are accepted and
174
+ only missing files are uploaded. Conflicting files, expired artifacts, and
175
+ unverified test releases block promotion. Do not delete and recreate artifacts
176
+ or rebuild an expired candidate under the same version; publish a new test version.
177
+ Versions that fail testing may be absent from production PyPI.
178
+
179
+ See [CI/CD configuration](../.github/CI-CD.md#sdk-publishing) for publisher setup,
180
+ permissions and workflow tests. Review package metadata and bundled documentation
181
+ for public distribution before merging a version update.
@@ -1,191 +1,167 @@
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
+ # 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
+ Downloads and remote reads default to the storage provider's
39
+ internal endpoint (`OSSClient` / `TOSClient` read permission, `download_data`,
40
+ `open_data`, and `open_td`). Outside that cloud network, pass
41
+ `use_internal_endpoint=False`; there is no automatic public fallback. A supplied
42
+ TOS `endpoint` selects that public address unless internal networking is explicitly
43
+ requested, which remains an error. Uploads still default to public networking.
44
+ OSS `open_td` without `bucket` infers the selected provider's unique bucket from
45
+ metadata; multiple buckets require an explicit selection. The SDK manages temporary
46
+ credentials for uploads, downloads and remote TD reads.
47
+
48
+ Calibration workers can import `GLOVE_CALIBRATION_REPORT_URL` from
49
+ `current_data_py` for the environment's HTTPS Collection callback endpoint on
50
+ `DEFAULT_ADDRESS` (port 443).
51
+ Processing supplies `ENV` to the Job; set it before the first SDK import.
52
+ The worker needs network access to that platform domain.
53
+
54
+ ## Upload files
55
+
56
+ Use `OSSClient` or `TOSClient` with upload permission. The management service
57
+ selects the bucket and allowed object prefix. Both clients
58
+ require `data_type` and `data_kind`; keep the management client open during transfers:
59
+
60
+ ```python
61
+ from current_data_py.management import ManagementClient
62
+ from current_data_py.tos import TOSClient
63
+
64
+ with ManagementClient() as management:
65
+ with TOSClient(management, permission="upload", data_type="YAM",
66
+ data_kind="CONVERTED") as storage:
67
+ storage.upload_file(storage.object_prefix + "recording.td", "/data/recording.td",
68
+ multipart_threshold=100 * 1024**2,
69
+ part_size=16 * 1024**2, max_workers=4)
70
+ ```
71
+
72
+ Both clients accept the same transfer options. Files at or above
73
+ `multipart_threshold` use multipart upload; `0` forces multipart for nonempty
74
+ files. Empty files always use PutObject. Sizes are in bytes. `part_size` must be
75
+ 5 MiB–5 GiB, and the file must fit within 10,000 parts; increase it for larger
76
+ files. `max_workers` controls parallel requests (1–64); part buffers use roughly
77
+ `part_size * max_workers` memory, plus SDK overhead. Do not modify the source
78
+ file during upload.
79
+
80
+ Uploads reject existing objects by default, including when completing multipart
81
+ uploads. Set `forbid_overwrite=False` to replace one. Content type and metadata
82
+ are preserved. The return value is the provider's PutObject result for small
83
+ files or CompleteMultipartUpload result for multipart files.
84
+
85
+ Failed multipart transfers attempt to abort and delete incomplete parts. A failed
86
+ cleanup emits a warning; check the bucket's incomplete uploads. The upload role
87
+ and its scoped STS policy must allow `oss:AbortMultipartUpload` or
88
+ `tos:AbortMultipartUpload` in addition to PutObject. Deploy the management-service
89
+ policy update and ensure the underlying cloud role permits cleanup before use.
90
+ There is no persistent checkpoint: a later call starts a new upload. Uploading
91
+ does not register the data; call `ManagementClient.register_data` separately.
92
+
93
+ ## URDF packages
94
+
95
+ Use `ManagementClient.upload_urdf(directory, entrypoint, info=...)` to check local
96
+ dependencies, upload source files without overwriting objects, and register one
97
+ asset under a new UUID on each call. Keep the directory unchanged throughout the
98
+ call; validation, hashing and upload read the source directly without private
99
+ copies. Failed calls leave uploaded objects in place and do not resume or recover
100
+ registration on a later call.
101
+ STL, static COLLADA, OBJ/MTL and PNG/JPEG references are supported; rendering is
102
+ checked in preview. The result is the locally generated asset UUID; model lists
103
+ provide URDF URLs. See the
104
+ [URDF guide](docs/urdf.md) and run `python -I -m current_data_py.examples.upload_urdf --help`.
105
+
106
+ ## Test changes
107
+
108
+ The package bundles generated Protobuf modules during its build. After protocol
109
+ changes, [regenerate the bindings](../README.md#protobuf) first.
110
+ Build into a fresh temporary directory, validate the artifacts, and install this
111
+ checkout's wheel before running its checks. Only the local package is installed;
112
+ shared dependencies are left unchanged:
113
+
114
+ ```sh
115
+ (
116
+ set -e
117
+ sdk_dist=$(mktemp -d)
118
+ trap 'rm -rf "$sdk_dist"' EXIT
119
+ (cd current_data_py && python -m build --no-isolation --outdir "$sdk_dist")
120
+ python current_data_py/tests/check_distribution.py --dist-dir "$sdk_dist"
121
+ python -m pip install --no-deps --force-reinstall "$sdk_dist"/*.whl
122
+ for check in package environment management labeling remote remote_v2 oss tos decoding multipart urdf urdf_validation docs; do
123
+ python -I "current_data_py/tests/check_${check}.py"
124
+ done
125
+ )
126
+ ```
127
+
128
+ These checks cover packaging, environment selection, clients, and media decoding
129
+ using local fixtures and mocked services. They do not require production credentials
130
+ or prove connectivity to a deployed service.
131
+
132
+ ## Publish to PyPI
133
+
134
+ Ordinary CI builds a temporary package and tests the installed wheel. It does not
135
+ retain SDK release artifacts or upload to a package index.
136
+
137
+ 1. Run **Release** from `main`, select `environment=test`, and check
138
+ `current_data_py`. Leave service selections, `commit`, and `sdk_version` empty.
139
+ It creates a PR that increases `project.version` to the next unused patch
140
+ version (for example, `0.1.20` → `0.1.21`). Review and merge it to start
141
+ **SDK Publish**. Major/minor version changes can still use a manual version PR.
142
+ 2. The workflow checks generated Protobuf files, builds and tests the wheel/sdist,
143
+ retains them for 90 days, and uploads them to TestPyPI. `verify_test` checks
144
+ remote SHA-256 digests and installs the package in a clean environment.
145
+ 3. Complete functional testing against the test services. TestPyPI publication
146
+ does not update existing SDK consumers; install the exact version and set
147
+ `ENV=test` before importing the SDK. Registry selection and service environment
148
+ selection are independent.
149
+ 4. Run **Release** from `main`, select `environment=prod`, check `current_data_py`,
150
+ and enter the verified `sdk_version`.
151
+ Leave service selections and `commit` empty. It creates a PR containing the
152
+ tested version, source SHA, run/attempt, artifact ID and file digests.
153
+ 5. Obtain owner approval on the release PR's latest commit and merge it. The
154
+ workflow downloads those exact distributions and publishes them to PyPI;
155
+ it does not rebuild them or use newer SDK source. `verify_prod` checks remote
156
+ digests and installation. Production consumers must explicitly upgrade.
157
+
158
+ A test version with code changes needs a new version number. Re-run failed jobs
159
+ for upload or verification failures: matching existing files are accepted and
160
+ only missing files are uploaded. Conflicting files, expired artifacts, and
161
+ unverified test releases block promotion. Do not delete and recreate artifacts
162
+ or rebuild an expired candidate under the same version; publish a new test version.
163
+ Versions that fail testing may be absent from production PyPI.
164
+
165
+ See [CI/CD configuration](../.github/CI-CD.md#sdk-publishing) for publisher setup,
166
+ permissions and workflow tests. Review package metadata and bundled documentation
167
+ for public distribution before merging a version update.
@@ -1,24 +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
- 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
+ """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
+ ]