Local - Access your data locally¶
- class manta_light.local.Local(host: str | None = None, port: int | None = None, task_id: str | None = None)¶
Local service for accessing local data securely
The
Local
service allows the user to get local data.Parameters should not be fulfill manually. Instead, it is managed during the deployment of the task by the
Node
.- Parameters:
host (Optional[str]) – Manager host
port (Optional[int]) – Manager port
task_id (Optional[str]) – Task ID
- get_numpy_data(dataset_name: str) bytes ¶
Get the numpy data
- Parameters:
dataset_name (str) – The name of the dataset to get
- Returns:
The numpy data
- Return type:
bytes
Examples
Inside a
Task
class, you can access to local data by using the attributeself.local
automatically created byTask <manta_light.task.Task
:>>> mnist_data = self.local.get_numpy_data("mnist.npz") >>> data = np.load(mnist_data)
- get_binary_data(dataset_name: str) bytes ¶
Get the binary data
- Parameters:
dataset_name (str) – The name of the dataset to get
- Returns:
The binary data
- Return type:
bytes
Examples
Inside a
Task
class, you can access to local data by using the attributeself.local
automatically created byTask <manta_light.task.Task
:>>> mnist_data = self.local.get_binary_data("mnist.npz") >>> data = np.load(mnist_data)
- async async_get_numpy_data(dataset_name: str) BytesIO ¶
Get Numpy Data
- Parameters:
dataset_name (str) – Dataset name
- Returns:
Binary data
- Return type:
io.BytesIO
Examples
Same as
select
but asynchronous:>>> mnist_data = await self.local.async_get_numpy_data("mnist.npz") >>> data = np.load(mnist_data)
- async async_get_binary_data(dataset_name: str) BytesIO ¶
Asynchronously get binary data
- Parameters:
dataset_name (str) – Dataset name
- Returns:
Binary data
- Return type:
io.BytesIO
Examples
Same as
select
but asynchronous:>>> mnist_data = await self.local.async_get_binary_data("mnist.npz") >>> data = np.load(mnist_data)