Search code examples
pythonkedro

How can I read/write data from/to network attached storage with kedro?


In the API docs about kedro.io and kedro.contrib.io I could not find info about how to read/write data from/to network attached storage such as e.g. FritzBox NAS.


Solution

  • So I'm a little rusty on network attached storage, but:

    1. If you can mount your network attached storage onto your OS and access it like a regular folder, then it's just a matter of providing the right filepath when writing the config for a given catalog entry. See for example: Using Python, how can I access a shared folder on windows network?

    2. Otherwise, if accessing the network attached storage requires anything special, you might want to create a custom dataset that uses a Python library for interfacing with your network attached storage. Something like pysmb comes to mind.

    The custom dataset could borrow heavily from the logic in existing kedro.io or kedro.extras.datasets datasets, but you replace the filepath/fsspec handling code with pysmb instead.