{"id":28280542,"url":"https://github.com/fsspec/sshfs","last_synced_at":"2025-06-16T21:32:08.598Z","repository":{"id":38310684,"uuid":"372298023","full_name":"fsspec/sshfs","owner":"fsspec","description":"sshfs - SSH/SFTP implementation for fsspec","archived":false,"fork":false,"pushed_at":"2025-02-06T05:12:48.000Z","size":90,"stargazers_count":74,"open_issues_count":22,"forks_count":17,"subscribers_count":7,"default_branch":"main","last_synced_at":"2025-06-13T00:06:21.064Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/fsspec.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2021-05-30T19:23:33.000Z","updated_at":"2025-06-03T15:18:27.000Z","dependencies_parsed_at":"2023-02-12T18:46:02.074Z","dependency_job_id":"bf6cd51a-bbdc-4761-89ec-2b542dbfc1cd","html_url":"https://github.com/fsspec/sshfs","commit_stats":null,"previous_names":[],"tags_count":26,"template":false,"template_full_name":null,"purl":"pkg:github/fsspec/sshfs","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fsspec%2Fsshfs","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fsspec%2Fsshfs/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fsspec%2Fsshfs/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fsspec%2Fsshfs/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/fsspec","download_url":"https://codeload.github.com/fsspec/sshfs/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fsspec%2Fsshfs/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":260244793,"owners_count":22980078,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2025-05-21T10:17:13.894Z","updated_at":"2025-06-16T21:32:08.590Z","avatar_url":"https://github.com/fsspec.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# sshfs\n\nsshfs is an implementation of [fsspec](https://github.com/intake/filesystem_spec/) for\nthe SFTP protocol using [asyncssh](https://github.com/ronf/asyncssh).\n\n## Features\n\n- A complete implementation of the fsspec protocol through SFTP\n- Supports features outside of the SFTP (e.g server side copy through SSH command execution)\n- Quite fast (compared to alternatives like paramiko)\n- Builtin Channel Management\n- Async! (thanks to `asyncssh`)\n\n## Tutorial\n\nInstall the `sshfs` from PyPI or the conda-forge. This will install `fsspec`\nand register `sshfs` for `ssh://` urls, so you can open files using:\n\n```py\nfrom fsspec import open\n\nwith open('ssh://[user@]host[:port]/path/to/file', \"w\") as file:\n    file.write(\"Hello World!\")\n\nwith open('ssh://[user@]host[:port]/path/to/file', \"r\") as file:\n    print(file.read())\n```\n\nFor more operations, you can use the `SSHFileSystem` class directly:\n\n```py\nfrom sshfs import SSHFileSystem\n```\n\nTo connect with a password, you can simply specify `username`/`password`\nas keyword arguments and connect to the host of your choosing;\n\n```py\n# Connect with a password\nfs = SSHFileSystem(\n    '127.0.0.1',\n    username='sam',\n    password='fishing'\n)\n```\n\nIf you want to use a private key to authenticate, you can either\npass a string pointing to the path of the key, or give a list of\nthem to be tried:\n\n```py\n# or with a private key\nfs = SSHFileSystem(\n    'ssh.example.com',\n    client_keys=['/path/to/ssh/key']\n)\n```\n\nNote: you can also pass `client_keys` as an argument to `fsspec.open`.\n\nAll operations and their descriptions are specified [here](https://filesystem-spec.readthedocs.io/en/latest/api.html#fsspec.spec.AbstractFileSystem).\nHere are a few example calls you can make, starting with `info()` which allows you to retrieve the metadata about given path;\n\n```py\n\u003e\u003e\u003e details = fs.info('/tmp')\n\u003e\u003e\u003e print(f'{details[\"name\"]!r} is a {details[\"type\"]}!')\n'/tmp/' is a directory!\n\u003e\u003e\u003e\n\u003e\u003e\u003e crontab = fs.info('/etc/crontab')\n\u003e\u003e\u003e print(f'{crontab[\"name\"]!r} is a {crontab[\"type\"]}!')\n'/etc/crontab' is a file!\n```\n\nYou can also create new files through either putting a local file with `put_file` or opening a file in write mode;\n\n```py\n\u003e\u003e\u003e with fs.open('/tmp/message.dat', 'wb') as stream:\n...     stream.write(b'super secret message!')\n...\n```\n\nAnd either download it through `get_file` or simply read it on the fly with opening it;\n\n```py\n\u003e\u003e\u003e with fs.open('/tmp/message.dat') as stream:\n...     print(stream.read())\n...\nb'super secret message!'\n```\n\nThere are also a lot of other basic filesystem operations, such as `mkdir`, `touch` and `find`;\n\n```py\n\u003e\u003e\u003e fs.mkdir('/tmp/dir')\n\u003e\u003e\u003e fs.mkdir('/tmp/dir/eggs')\n\u003e\u003e\u003e fs.touch('/tmp/dir/spam')\n\u003e\u003e\u003e fs.touch('/tmp/dir/eggs/quux')\n\u003e\u003e\u003e\n\u003e\u003e\u003e for file in fs.find('/tmp/dir'):\n...     print(file)\n...\n/tmp/dir/eggs/quux\n/tmp/dir/spam\n```\n\nIf you want to list a directory but not it's children, you can use `ls()`;\n\n```py\n\u003e\u003e\u003e [(detail['name'], detail['type']) for detail in fs.ls('/tmp/dir', detail=True)]\n[('/tmp/dir/spam', 'file'), ('/tmp/dir/eggs', 'directory')]\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffsspec%2Fsshfs","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffsspec%2Fsshfs","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffsspec%2Fsshfs/lists"}