Skip to content

Adding Data to VxData

Creating New Resources

The VxData SDK exposes ResourceCreate requests that allow you to create new resources in the database.

from vxdata.schemas.create import MeasurementCreate

client.resources.create(MeasurementCreate(
    identifier="psa/BB12345/2025-01-01",
    license="VIRDX-PSEUDONYMIZED",
    value=1.23,
    unit="ng/ml"
))

This operation will fail if a resource with the same identifier already exists. Read below for a guide on updating existing resources.

Updating Existing Resources

from vxdata.schemas.update import MeasurementUpdate

client.resources.update(
    "psa/BB12345/2025-01-01",
    MeasurementUpdate(
        value=100.0,
    ))

Uploading Files

For any blob data that can’t be represented as resources / tabular entries, vxData offers functionality to upload data to our Ceph blob storage system. Files are moved via the storage module of the SDK:

# uploads a file to a timestamped, randomized folder name in the specified group,
# so returned url will be similar to `s3://vxdata/my-project/20260101_ABCXYZ/model.pt`.
url = vxd.storage.upload("model.pt", group="my-project")
urls = vxd.storage.upload(["a.nii.gz", "b.nii.gz"], group="my-project")  # list in, list out
dir_url = vxd.storage.upload("training-run/", group="my-project")  # whole directory; url ends in /

This returned value should then be used when creating resources: most relevant resources have a url field to put this S3-URL into.

Small files are being uploaded as one streamed PUT operations, large ones (>1GB) are uploaded as parallel multiparts. This improves upload speeds and avoids loading the entire file into memory. On any failure the multipart upload is aborted server-side: nothing partial ever becomes visible.

Navigation

Type to search…

↑↓ navigate↵ selectEsc close