Is it possible to read a .csv from a remote server, using Paramiko and Dask's read_csv() method in conjunction?

倖福魔咒の 提交于 2019-12-07 10:42:27

In the master version of Dask, file-system operations are now using fsspec which, along with the previous implementations (s3, gcs, hdfs) now supports some additional file-systems, see the mapping to protocol identifiers fsspec.registry.known_implementations.

In short, using a url like "sftp://user:pw@host:port/path" should now work for you, if you install fsspec and Dask from master.

It seems that you would have to implement their "file system" interface.

I'm not sure what is minimal set of methods that you need to implement to allow read_csv. But you definitely have to implement the open.

class SftpFileSystem(object):
    def open(self, path, mode='rb', **kwargs):
        return sftp_client.open(path, mode)

dask.bytes.core._filesystems['sftp'] = SftpFileSystem

df = dd.read_csv('sftp://remote/path/file.csv')
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!