docarray.array.mixins.io.pushpull module#
- class docarray.array.mixins.io.pushpull.PushPullMixin[source]#
Bases:
object
Transmitting
DocumentArray
via Jina Cloud Service- static cloud_list(show_table=False)[source]#
List all available arrays in the cloud.
- Parameters:
show_table (
bool
) – if true, show the table of the arrays.- Return type:
List
[str
]- Returns:
List of available DocumentArray’s names.
- static cloud_delete(name)[source]#
Delete a DocumentArray from the cloud. :type name:
str
:param name: the name of the DocumentArray to delete.- Return type:
None
- push(name, show_progress=False, public=True, branding=None)[source]#
Push this DocumentArray object to Jina Cloud which can be later retrieved via
push()
Note
Push with the same
name
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 name.
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:
name (
str
) – a name that later can be used for retrieve thisDocumentArray
.show_progress (
bool
) – if to show a progress bar on pullingpublic (
bool
) – by default anyone can pull a DocumentArray if they know its name. Setting this to False will allow only the creator to pull it. This feature of course you to login first.branding (
Optional
[Dict
]) – a dict of branding information to be sent to Jina Cloud. {“icon”: “emoji”, “background”: “#fff”}
- Return type:
Dict
- classmethod pull(cls, name, show_progress=False, local_cache=True, *args, **kwargs)[source]#
Pulling a
DocumentArray
from Jina Cloud Service to local.- Parameters:
name (
str
) – the upload name set duringpush()
show_progress (
bool
) – if to show a progress bar on pullinglocal_cache (
bool
) – store the downloaded DocumentArray to local folder
- Return type:
T
- Returns:
a
DocumentArray
object
- cloud_push(name, show_progress=False, public=True, branding=None)#
Push this DocumentArray object to Jina Cloud which can be later retrieved via
push()
Note
Push with the same
name
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 name.
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:
name (
str
) – a name that later can be used for retrieve thisDocumentArray
.show_progress (
bool
) – if to show a progress bar on pullingpublic (
bool
) – by default anyone can pull a DocumentArray if they know its name. Setting this to False will allow only the creator to pull it. This feature of course you to login first.branding (
Optional
[Dict
]) – a dict of branding information to be sent to Jina Cloud. {“icon”: “emoji”, “background”: “#fff”}
- Return type:
Dict
- classmethod cloud_pull(cls, name, show_progress=False, local_cache=True, *args, **kwargs)#
Pulling a
DocumentArray
from Jina Cloud Service to local.- Parameters:
name (
str
) – the upload name set duringpush()
show_progress (
bool
) – if to show a progress bar on pullinglocal_cache (
bool
) – store the downloaded DocumentArray to local folder
- Return type:
T
- Returns:
a
DocumentArray
object