docarray.array.mixins.io.pushpull module

class docarray.array.mixins.io.pushpull.PushPullMixin[source]

Bases: object

Transmitting DocumentArray via Jina Cloud Service

push(token, show_progress=False)[source]

Push this DocumentArray object to Jina Cloud which can be later retrieved via push()

Note

  • Push with the same token will override the existing content.

  • Kinda like a public clipboard where everyone can override anyone’s content. So to make your content survive longer, you may want to use longer & more complicated token.

  • The lifetime of the content is not promised atm, could be a day, could be a week. Do not use it for persistence. Only use this full temporary transmission/storage/clipboard.

Parameters
  • token (str) – a key that later can be used for retrieve this DocumentArray.

  • show_progress (bool) – if to show a progress bar on pulling

Return type

None

classmethod pull(token, show_progress=False)[source]

Pulling a DocumentArray from Jina Cloud Service to local.

Parameters
  • token (str) – the upload token set during push()

  • show_progress (bool) – if to show a progress bar on pulling

Return type

T

Returns

a DocumentArray object