jina.clients

jina.clients.py_client(**kwargs)[source]

A simple Python client for connecting to the gateway.

For acceptable kwargs, please refer to jina client --help

Example, assuming a Flow is “standby” on 192.168.1.100, with port_expose at 55555.

from jina.clients import py_client

# to test connectivity
py_client(host='192.168.1.100', port_expose=55555).dry_run()

# to search
py_client(host='192.168.1.100', port_expose=55555).search(input_fn, output_fn)

# to index
py_client(host='192.168.1.100', port_expose=55555).index(input_fn, output_fn)