Skip to main content

current-data-py

Python SDK for robotics Protobuf messages, TD files, and platform service clients. Run shell commands from the repository root in the shared development environment.

Use locally

Run the bundled examples to write and read a local TD file using the installed SDK:

python -I -m current_data_py.examples.write_td /tmp/current-data-example.td
python -I -m current_data_py.examples.read_td /tmp/current-data-example.td

-I avoids importing the unbuilt source directory in place of the installed package. See examples for other entry points.

For a minimal read-only service call, run this snippet with python -I so it uses the installed SDK:

from contextlib import closing
import os
os.environ["ENV"] = "test"

from current_data_py.management import ManagementClient, MetadataFilter

with ManagementClient() as client:
    with closing(client.stream_data_references(MetadataFilter(), timeout=30)) as records:
        record = next(records, None)
        print(record.id if record is not None else "No matching data")

Set ENV=test before the first SDK import to select the test service; an unset or empty value defaults to production. An explicit client address= overrides the default. Remote examples require service connectivity and accessible data.

Downloads and remote reads with a selected bucket default to the storage provider's internal endpoint (OSSClient / TOSClient read permission, download_data, open_data, and bucket-selected open_td). Outside that cloud network, pass use_internal_endpoint=False; there is no automatic public fallback. A supplied TOS endpoint selects that public address unless internal networking is explicitly requested, which remains an error. Uploads still default to public networking. Legacy OSS open_td without bucket retains the server's default read scope and does not support network selection. V2/V3 read-credential methods default to internal.

Calibration workers can import GLOVE_CALIBRATION_REPORT_URL from current_data_py for the environment's HTTPS Collection callback endpoint on DEFAULT_ADDRESS (port 443). Processing supplies ENV to the Job; set it before the first SDK import. The worker needs network access to that platform domain.

Upload files

Use OSSClient or TOSClient with upload permission. The management service selects the bucket and allowed object prefix; keep it open during transfers:

from current_data_py.management import ManagementClient
from current_data_py.tos import TOSClient

with ManagementClient() as management:
    with TOSClient(management, permission="upload", data_type="YAM",
                   data_kind="CONVERTED") as storage:
        storage.upload_file(storage.object_prefix + "recording.td", "/data/recording.td",
                            multipart_threshold=100 * 1024**2,
                            part_size=16 * 1024**2, max_workers=4)

Both clients accept the same transfer options. Files at or above multipart_threshold use multipart upload; 0 forces multipart for nonempty files. Empty files always use PutObject. Sizes are in bytes. part_size must be 5 MiB–5 GiB, and the file must fit within 10,000 parts; increase it for larger files. max_workers controls parallel requests (1–64); part buffers use roughly part_size * max_workers memory, plus SDK overhead. Do not modify the source file during upload.

Uploads reject existing objects by default, including when completing multipart uploads. Set forbid_overwrite=False to replace one. Content type and metadata are preserved. The return value is the provider's PutObject result for small files or CompleteMultipartUpload result for multipart files.

Failed multipart transfers attempt to abort and delete incomplete parts. A failed cleanup emits a warning; check the bucket's incomplete uploads. The upload role and its scoped STS policy must allow oss:AbortMultipartUpload or tos:AbortMultipartUpload in addition to PutObject. Deploy the management-service policy update and ensure the underlying cloud role permits cleanup before use. There is no persistent checkpoint: a later call starts a new upload. Uploading does not register the data; call ManagementClient.register_data separately.

URDF packages

Use ManagementClient.upload_urdf(directory, entrypoint, info=...) to check local dependencies, upload source files without overwriting objects, and register one asset under a new UUID on each call. Keep the directory unchanged throughout the call; validation, hashing and upload read the source directly without private copies. Failed calls leave uploaded objects in place and do not resume or recover registration on a later call. STL, static COLLADA, OBJ/MTL and PNG/JPEG references are supported; rendering is checked in preview. The result is the locally generated asset UUID; model lists provide URDF URLs. See the URDF guide and run python -I -m current_data_py.examples.upload_urdf --help.

Test changes

The package bundles generated Protobuf modules during its build. After protocol changes, regenerate the bindings first. Build into a fresh temporary directory, validate the artifacts, and install this checkout's wheel before running its checks. Only the local package is installed; shared dependencies are left unchanged:

(
  set -e
  sdk_dist=$(mktemp -d)
  trap 'rm -rf "$sdk_dist"' EXIT
  (cd current_data_py && python -m build --no-isolation --outdir "$sdk_dist")
  python current_data_py/tests/check_distribution.py --dist-dir "$sdk_dist"
  python -m pip install --no-deps --force-reinstall "$sdk_dist"/*.whl
  for check in package environment management labeling remote remote_v2 oss tos decoding multipart urdf urdf_validation docs; do
    python -I "current_data_py/tests/check_${check}.py"
  done
)

These checks cover packaging, environment selection, clients, and media decoding using local fixtures and mocked services. They do not require production credentials or prove connectivity to a deployed service.

Publish to PyPI

CI checks this SDK but does not publish it. Releases are manual and must use the latest successfully fetched origin/main, including the version bump. Development branches, uncommitted changes, and older main commits are not release sources. Follow the repository Git workflow. Prepare the version update in pyproject.toml on a development branch and merge it through review together with the intended SDK changes before building a release. Use a version that has not already been published.

Build and validate

Run from the repository root. Fetch the latest origin/main, record its commit, and build from a clean exported copy so local edits and old artifacts cannot enter the release:

sdk_release_dir=$(mktemp -d /tmp/current-data-release.XXXXXX)
(
  set -euo pipefail
  git fetch origin
  sdk_release_sha=$(git rev-parse origin/main)
  printf '%s\n' "$sdk_release_sha" > "$sdk_release_dir/source-commit.txt"
  mkdir "$sdk_release_dir/source"
  git archive "$sdk_release_sha" | tar -x -C "$sdk_release_dir/source"
  (cd "$sdk_release_dir/source/current_data_py" && python -m build --no-isolation --outdir "$sdk_release_dir/dist")
  python "$sdk_release_dir/source/current_data_py/tests/check_distribution.py" --dist-dir "$sdk_release_dir/dist"
  python -m twine check "$sdk_release_dir/dist/"*
  python -m pip install --no-deps --force-reinstall "$sdk_release_dir/dist/"*.whl
  (
    cd "$sdk_release_dir"
    unset PYTHONPATH PYTHONHOME
    for check in package environment management labeling remote remote_v2 oss tos decoding urdf urdf_validation docs; do
      python -I "$sdk_release_dir/source/current_data_py/tests/check_${check}.py"
    done
  )
  (cd "$sdk_release_dir/dist" && sha256sum *) > "$sdk_release_dir/SHA256SUMS"
)

Release checks run outside both source trees so child Python processes also use the installed wheel. They come from the recorded origin/main commit; unmerged local test fixes are not included in the export.

Continue only after every check succeeds. Confirm source-commit.txt contains the intended main commit and inspect the wheel for the intended release features. Review the built package's README metadata for public display; exclude private deployment addresses, bucket names, and credentials. Keep the release directory and use these exact validated artifacts for uploading.

Upload

Use your configured PyPI credentials or Twine's interactive token prompt; do not put tokens in the README or shell commands. Run from the repository root in the same shell that defines sdk_release_dir.

Fetch main again immediately before uploading. If its commit has changed, rebuild and rerun all checks from the new latest main. The command also checks that the artifacts still match the hashes recorded after validation:

(
  set -e
  sdk_repository=pypi
  git fetch origin
  if [ "$(git rev-parse origin/main)" != "$(cat "$sdk_release_dir/source-commit.txt")" ]; then
    echo "origin/main changed; rebuild and validate the latest main before uploading." >&2
    exit 1
  fi
  (cd "$sdk_release_dir/dist" && sha256sum -c ../SHA256SUMS)
  python -m twine upload --repository "$sdk_repository" "$sdk_release_dir/dist/"*
)

For an optional TestPyPI trial, change sdk_repository=pypi to sdk_repository=testpypi in the same block and use TestPyPI credentials. Both registries require the latest-main and artifact checks.

Verify the release

After upload, verify that PyPI shows the expected version and rendered description. Compare the SHA-256 digests of both published files with SHA256SUMS, and retain that file with source-commit.txt as the release record. An optional TestPyPI trial does not replace verification of the production PyPI release.

Metadata

Release files for current-data-py 0.1.18

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for current-data-py 0.1.18
File Size Uploaded Provenance Actions
current_data_py-0.1.18.tar.gz 138.1 kB Without provenance Details for current_data_py-0.1.18.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for current-data-py 0.1.18
File Interpreter ABI Platform Actions
current_data_py-0.1.18-py3-none-any.whl Python 3 none any Details for current_data_py-0.1.18-py3-none-any.whl

Total release size: 299.6 kB

Release files / current_data_py-0.1.18.tar.gz

Download URL current_data_py-0.1.18.tar.gz
Size 138.1 kB
Tags Source
SHA-256 checksum
How to use checksums
8f5a12bd3de56a3bf9ffbbecaf572bb6a760c10865bedc37fe0b99e2591705b3
BLAKE2b-256 checksum
How to use checksums
042c9eb09967f92278f83a5836b848eb02bd6f32e1c5a3bf1236758e75adcccd
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.12.3

Release files / current_data_py-0.1.18-py3-none-any.whl

Download URL current_data_py-0.1.18-py3-none-any.whl
Size 161.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
a24ed48653311359032caf52e5f78d7e666a13e39ea67cccb68d960a892fb5a8
BLAKE2b-256 checksum
How to use checksums
480be4817e61756ac6bf39988dcbd1773829b250449f4275ab4f935d2415b5e0
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.12.3

Security for current-data-py 0.1.18

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page