Skip to main content

vald-client-python

PyPI version Vald version Build version

A Python gRPC client library for Vald.

Install

Using pip,

pip install vald-client-python

Usage

To use v1 APIs,

import grpc
from vald.v1.vald import insert_pb2_grpc
from vald.v1.vald import search_pb2_grpc
from vald.v1.vald import update_pb2_grpc
from vald.v1.vald import remove_pb2_grpc
from vald.v1.vald import flush_pb2_grpc
from vald.v1.payload import payload_pb2

## create a channel by passing "{host}:{port}"
channel = grpc.insecure_channel("gateway.vald.vdaas.org:80")

## create stubs for calling RPCs
istub = insert_pb2_grpc.InsertStub(channel)
sstub = search_pb2_grpc.SearchStub(channel)
ustub = update_pb2_grpc.UpdateStub(channel)
rstub = remove_pb2_grpc.RemoveStub(channel)
fstub = flush_pb2_grpc.FlushStub(channel)

## call RPCs: Insert
vec = payload_pb2.Object.Vector(id='vector_id_1', vector=[0.1, 0.2, 0.3])
icfg = payload_pb2.Insert.Config(skip_strict_exist_check=True)
istub.Insert(payload_pb2.Insert.Request(vector=vec, config=icfg))


## call RPCs: Search
### num: number of results
### timeout: 3 seconds
scfg = payload_pb2.Search.Config(num=10, radius=-1.0, epsilon=0.01, timeout=3000000000)
res = sstub.Search(payload_pb2.Search.Request(vector=[0.1, 0.2, 0.3], config=scfg))


## call RPCs: Update
uvec = payload_pb2.Object.Vector(id='vector_id_1', vector=[0.1, 0.2, 0.3])
ucfg = payload_pb2.Update.Config(skip_strict_exist_check=True)
ustub.Update(payload_pb2.Update.Request(vector=uvec, config=ucfg))


## call RPCs: Remove
rcfg = payload_pb2.Remove.Config(skip_strict_exist_check=True)
rid = payload_pb2.Object.ID(id='vector_id_1')
rstub.Remove(payload_pb2.Remove.Request(id=rid, config=rcfg))

## call RPCs: Flush
fstub.Flush(payload_pb2.Flush.Request())

## close channel
channel.close()

Metadata

Release files for vald-client-python 1.8.1

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

Source distribution (sdist)

Source distribution for vald-client-python 1.8.1
File Size Uploaded Provenance Actions
vald_client_python-1.8.1.tar.gz 47.2 kB Without provenance Details for vald_client_python-1.8.1.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for vald-client-python 1.8.1
File Interpreter ABI Platform Actions
vald_client_python-1.8.1-py3-none-any.whl Python 3 none any Details for vald_client_python-1.8.1-py3-none-any.whl

Total release size: 121.9 kB

Release files / vald_client_python-1.8.1.tar.gz

Download URL vald_client_python-1.8.1.tar.gz
Size 47.2 kB
Tags Source
SHA-256 checksum
How to use checksums
22407f0ac92713203664aff3f29fb8679173b3596d89526a29830c54fa69c16d
BLAKE2b-256 checksum
How to use checksums
8521e95556f2f1b388c4ac475b401e51d7a9ab7de099342b4195fd148de8a005
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.12.8

Release files / vald_client_python-1.8.1-py3-none-any.whl

Download URL vald_client_python-1.8.1-py3-none-any.whl
Size 74.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
ea1144f0893a9a0c7be4aa2ae4326be4073bccc7a46a95c99c3d7a9dee3ff177
BLAKE2b-256 checksum
How to use checksums
43fc17b4a0dfdbfd800350dab72eaef98614710f9116f3ce7017a0987782f2ad
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.12.8

Security for vald-client-python 1.8.1

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.

Release history Release notifications | RSS feed

This release

1.8.1 This release

2 release files No provenance

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