fs.sshfs


Namefs.sshfs JSON
Version 1.0.2 PyPI version JSON
download
home_pagehttps://github.com/althonos/fs.sshfs
SummaryPyfilesystem2 over SSH using paramiko
upload_time2023-08-17 09:45:45
maintainer
docs_urlNone
authorMartin Larralde
requires_python!=3.0.*,!=3.1.*,!=3.2.*,!=3.3.*,>=2.7
licenseLGPLv2+
keywords filesystem pyfilesystem2 ssh sftp paramiko
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # `fs.sshfs` [![star me](https://img.shields.io/github/stars/althonos/fs.sshfs.svg?style=social&maxAge=3600&label=Star)](https://github.com/althonos/fs.sshfs/stargazers)

[![Source](https://img.shields.io/badge/source-GitHub-303030.svg?logo=git&maxAge=36000&style=flat-square)](https://github.com/althonos/fs.sshfs)
[![PyPI](https://img.shields.io/pypi/v/fs.sshfs.svg?logo=pypi&style=flat-square&maxAge=3600)](https://pypi.python.org/pypi/fs.sshfs)
[![Conda](https://img.shields.io/conda/vn/conda-forge/fs.sshfs?logo=anaconda&style=flat-square&maxAge=3600)](https://anaconda.org/conda-forge/fs.sshfs)
[![Actions](https://img.shields.io/github/actions/workflow/status/althonos/fs.sshfs/test.yml?branch=master&logo=github&style=flat-square&maxAge=300)](https://github.com/althonos/fs.sshfs/actions)
[![Codecov](https://img.shields.io/codecov/c/github/althonos/fs.sshfs/master.svg?logo=codecov&style=flat-square&maxAge=300)](https://codecov.io/gh/althonos/fs.sshfs)
[![Codacy](https://img.shields.io/codacy/grade/9734bea6ec004cc4914a377d9e9f54bd/master.svg?logo=codacy&style=flat-square&maxAge=300)](https://www.codacy.com/app/althonos/fs.sshfs/dashboard)
[![License](https://img.shields.io/pypi/l/fs.sshfs.svg?logo=gnu&style=flat-square&maxAge=36000)](https://choosealicense.com/licenses/lgpl-2.1/)
[![Versions](https://img.shields.io/pypi/pyversions/fs.sshfs.svg?logo=python&style=flat-square&maxAge=300)](https://pypi.org/project/fs.sshfs)
[![Format](https://img.shields.io/pypi/format/fs.sshfs.svg?style=flat-square&maxAge=300)](https://pypi.org/project/fs.sshfs)
[![GitHub issues](https://img.shields.io/github/issues/althonos/fs.sshfs.svg?style=flat-square&maxAge=600)](https://github.com/althonos/fs.sshfs/issues)
[![Downloads](https://img.shields.io/pypi/dm/fs.sshfs?style=flat-square&color=303f9f&maxAge=86400&label=downloads)](https://pepy.tech/project/fs.sshfs)
[![Changelog](https://img.shields.io/badge/keep%20a-changelog-8A0707.svg?maxAge=2678400&style=flat-square)](https://github.com/althonos/fs.sshfs/blob/master/CHANGELOG.md)


## Requirements

| **PyFilesystem2** | [![PyPI fs](https://img.shields.io/pypi/v/fs.svg?maxAge=300&style=flat-square)](https://pypi.python.org/pypi/fs) | [![Source fs](https://img.shields.io/badge/source-GitHub-303030.svg?maxAge=36000&style=flat-square)](https://github.com/PyFilesystem/pyfilesystem2) | [![License fs](https://img.shields.io/pypi/l/fs.svg?maxAge=36000&style=flat-square)](https://choosealicense.com/licenses/mit/) |
|:-|:-|:-|:-|
| **six** | [![PyPI six](https://img.shields.io/pypi/v/six.svg?maxAge=300&style=flat-square)](https://pypi.python.org/pypi/six) | [![Source six]( https://img.shields.io/badge/source-GitHub-303030.svg?maxAge=36000&style=flat-square )]( https://github.com/benjaminp/six) | [![License six](https://img.shields.io/pypi/l/six.svg?maxAge=36000&style=flat-square)](https://choosealicense.com/licenses/mit/) |
| **paramiko** | [![PyPI paramiko](https://img.shields.io/pypi/v/paramiko.svg?maxAge=300&style=flat-square)](https://pypi.python.org/pypi/paramiko) | [![Source paramiko]( https://img.shields.io/badge/source-GitHub-303030.svg?maxAge=36000&style=flat-square )]( https://github.com/paramiko/paramiko) | [![License paramiko](https://img.shields.io/pypi/l/paramiko.svg?maxAge=36000&style=flat-square)](https://choosealicense.com/licenses/lgpl-2.1/) |
| **property-cached** | [![PyPI property](https://img.shields.io/pypi/v/property-cached.svg?maxAge=300&style=flat-square)](https://pypi.python.org/pypi/property-cached) | [![Source property]( https://img.shields.io/badge/source-GitHub-303030.svg?maxAge=36000&style=flat-square )](https://github.com/althonos/property-cached) | [![License property]( https://img.shields.io/pypi/l/property-cached.svg?maxAge=36000&style=flat-square )]( https://choosealicense.com/licenses/bsd-3-clause/) |

`fs.sshfs` supports all Python versions supported by PyFilesystem2:
Python 2.7, and Python 3.5 onwards. Code should still be compatible with
Python 3.4, but not tested anymore.


## Installation

Install directly from PyPI, using [pip](https://pip.pypa.io/):

```console
$ pip install fs.sshfs
```

There is also a [`conda-forge` package](https://conda-forge.org/) available:

```console
$ conda install -c conda-forge fs.sshfs
```


## Usage

### Opener

Use `fs.open_fs` to open a filesystem with an SSH
[FS URL](https://docs.pyfilesystem.org/en/latest/openers.html):

```python
import fs
my_fs = fs.open_fs("ssh://[user[:password]@]host[:port]/[directory]")
```

The `sftp` scheme can be used as an alias for the `ssh` scheme in the FS
URL. Additional argument can be passed to the `SSHFS` constructor as
percent-encoded URL parameters (excepted `policy`). See section below
for a list of all supported arguments.

### Constructor

For a more granular way of connecting to an SSH server, use the
`fs.sshfs.SSHFS` constructor, which signature is:

```python
from fs.sshfs import SSHFS
my_fs = SSHFS(
  host, user=None, passwd=None, pkey=None, timeout=10, port=22,
  keepalive=10, compress=False, config_path='~/.ssh/config'
)
```

with each argument explained below:

- `host`: the name or IP address of the SSH server
- `user`: the username to connect with, defaults to the current user.
- `passwd`: an optional password, used to connect directly to the server or
  to decrypt the public key, if any given.
- `pkey`: a [`paramiko.PKey`](http://docs.paramiko.org/en/stable/api/keys.html#paramiko.pkey.PKey)
  object, a path, or a list of paths to an SSH key.
- `timeout`: the timeout, in seconds, for networking operations.
- `port`: the port the SSH server is listening on.
- `keepalive`: the interval of time between *keepalive* packets, in seconds.
  Set to 0 to disable.
- `compress`: set to `True` to compress the communications with the server.
- `config_path`: the path to an OpenSSH configuration file.
- `exec_timeout`: the timeout, in seconds, for arbitrary SSH commands on
  the server.
- `policy`: a
  [`paramiko.MissingHostKeyPolicy`](http://docs.paramiko.org/en/stable/api/client.html#paramiko.client.MissingHostKeyPolicy)
  instance, or `None` to use
  [`paramiko.AutoAddPolicy`](http://docs.paramiko.org/en/stable/api/client.html#paramiko.client.AutoAddPolicy).

Additional keyword arguments will be passed to the underlying
[`paramiko.SSHClient.connect`](http://docs.paramiko.org/en/stable/api/client.html#paramiko.client.SSHClient.connect)
call, taking precedence over implicitly derived arguments. Once created, the `SSHFS` filesystem behaves like any
other filesystem (see the [PyFilesystem2 documentation](https://pyfilesystem2.readthedocs.io)).

### Files

`SSHFS.openbin` has the following extra options that can be passed as
keyword arguments to control the file buffering:

- `prefetch`: enabled by default, use a background thread to prefetch the content
  of a file opened in reading mode. Does nothing for files in writing mode.
- `pipelined`: enable pipelined mode, avoid waiting for server answer between
  two uploaded chunks. Does nothing for files in reading mode.


## Configuration

`SSHFS` are aware of [SSH config
files](http://nerderati.com/2011/03/17/simplify-your-life-with-an-ssh-config-file/)
and as such, one of the hosts in the configuration file can be provided
as the `host` argument for the filesystem to connect to the server with
the proper configuration values.


## Feedback

Found a bug ? Have an enhancement request ? Head over to the [GitHub
issue tracker](https://github.com/althonos/fs.sshfs/issues) of the
project if you need to report or ask something. If you are filling in on
a bug, please include as much information as you can about the issue,
and try to recreate the same bug in a simple, easily reproductible
situation.


## Credits

`fs.sshfs` is developed and maintained by:
- [Martin Larralde](https://github.com/althonos)

The following people contributed to `fs.sshfs`:
- [Reimar Bauer](https://github.com/ReimarBauer)
- [Paul Gessinger](https://github.com/paulgessinger)
- [Mariusz KryƄski](https://github.com/mrk-its)
- [Will McGugan](https://github.com/willmcgugan)
- [Jeremy Nimmer](https://github.com/jwnimmer-tri)
- [Tim Nyborg](https://github.com/timnyborg)
- [Danica J. Sutherland](https://github.com/djsutherland)
- [John Vandenberg](https://github.com/jayvdb)

This project obviously owes a lot to the PyFilesystem2 project and
[all its contributors](https://github.com/PyFilesystem/pyfilesystem2/blob/master/CONTRIBUTORS.md).

## See also

-   [fs](https://github.com/Pyfilesystem/pyfilesystem2), the core
    PyFilesystem2 library
-   [fs.archive](https://github.com/althonos/fs.archive), enhanced
    archive filesystems for PyFilesystem2
-   [fs.smbfs](https://github.com/althonos/fs.smbfs), PyFilesystem2 over
    SMB using pysmb

            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/althonos/fs.sshfs",
    "name": "fs.sshfs",
    "maintainer": "",
    "docs_url": null,
    "requires_python": "!=3.0.*,!=3.1.*,!=3.2.*,!=3.3.*,>=2.7",
    "maintainer_email": "",
    "keywords": "filesystem,Pyfilesystem2,ssh,sftp,paramiko",
    "author": "Martin Larralde",
    "author_email": "martin.larralde@embl.de",
    "download_url": "https://files.pythonhosted.org/packages/de/8d/2bb9ccdbc781eefaac8791fec792caa6616c237efbd8df524fc9f51f77d9/fs.sshfs-1.0.2.tar.gz",
    "platform": "any",
    "description": "# `fs.sshfs` [![star me](https://img.shields.io/github/stars/althonos/fs.sshfs.svg?style=social&maxAge=3600&label=Star)](https://github.com/althonos/fs.sshfs/stargazers)\n\n[![Source](https://img.shields.io/badge/source-GitHub-303030.svg?logo=git&maxAge=36000&style=flat-square)](https://github.com/althonos/fs.sshfs)\n[![PyPI](https://img.shields.io/pypi/v/fs.sshfs.svg?logo=pypi&style=flat-square&maxAge=3600)](https://pypi.python.org/pypi/fs.sshfs)\n[![Conda](https://img.shields.io/conda/vn/conda-forge/fs.sshfs?logo=anaconda&style=flat-square&maxAge=3600)](https://anaconda.org/conda-forge/fs.sshfs)\n[![Actions](https://img.shields.io/github/actions/workflow/status/althonos/fs.sshfs/test.yml?branch=master&logo=github&style=flat-square&maxAge=300)](https://github.com/althonos/fs.sshfs/actions)\n[![Codecov](https://img.shields.io/codecov/c/github/althonos/fs.sshfs/master.svg?logo=codecov&style=flat-square&maxAge=300)](https://codecov.io/gh/althonos/fs.sshfs)\n[![Codacy](https://img.shields.io/codacy/grade/9734bea6ec004cc4914a377d9e9f54bd/master.svg?logo=codacy&style=flat-square&maxAge=300)](https://www.codacy.com/app/althonos/fs.sshfs/dashboard)\n[![License](https://img.shields.io/pypi/l/fs.sshfs.svg?logo=gnu&style=flat-square&maxAge=36000)](https://choosealicense.com/licenses/lgpl-2.1/)\n[![Versions](https://img.shields.io/pypi/pyversions/fs.sshfs.svg?logo=python&style=flat-square&maxAge=300)](https://pypi.org/project/fs.sshfs)\n[![Format](https://img.shields.io/pypi/format/fs.sshfs.svg?style=flat-square&maxAge=300)](https://pypi.org/project/fs.sshfs)\n[![GitHub issues](https://img.shields.io/github/issues/althonos/fs.sshfs.svg?style=flat-square&maxAge=600)](https://github.com/althonos/fs.sshfs/issues)\n[![Downloads](https://img.shields.io/pypi/dm/fs.sshfs?style=flat-square&color=303f9f&maxAge=86400&label=downloads)](https://pepy.tech/project/fs.sshfs)\n[![Changelog](https://img.shields.io/badge/keep%20a-changelog-8A0707.svg?maxAge=2678400&style=flat-square)](https://github.com/althonos/fs.sshfs/blob/master/CHANGELOG.md)\n\n\n## Requirements\n\n| **PyFilesystem2** | [![PyPI fs](https://img.shields.io/pypi/v/fs.svg?maxAge=300&style=flat-square)](https://pypi.python.org/pypi/fs) | [![Source fs](https://img.shields.io/badge/source-GitHub-303030.svg?maxAge=36000&style=flat-square)](https://github.com/PyFilesystem/pyfilesystem2) | [![License fs](https://img.shields.io/pypi/l/fs.svg?maxAge=36000&style=flat-square)](https://choosealicense.com/licenses/mit/) |\n|:-|:-|:-|:-|\n| **six** | [![PyPI six](https://img.shields.io/pypi/v/six.svg?maxAge=300&style=flat-square)](https://pypi.python.org/pypi/six) | [![Source six]( https://img.shields.io/badge/source-GitHub-303030.svg?maxAge=36000&style=flat-square )]( https://github.com/benjaminp/six) | [![License six](https://img.shields.io/pypi/l/six.svg?maxAge=36000&style=flat-square)](https://choosealicense.com/licenses/mit/) |\n| **paramiko** | [![PyPI paramiko](https://img.shields.io/pypi/v/paramiko.svg?maxAge=300&style=flat-square)](https://pypi.python.org/pypi/paramiko) | [![Source paramiko]( https://img.shields.io/badge/source-GitHub-303030.svg?maxAge=36000&style=flat-square )]( https://github.com/paramiko/paramiko) | [![License paramiko](https://img.shields.io/pypi/l/paramiko.svg?maxAge=36000&style=flat-square)](https://choosealicense.com/licenses/lgpl-2.1/) |\n| **property-cached** | [![PyPI property](https://img.shields.io/pypi/v/property-cached.svg?maxAge=300&style=flat-square)](https://pypi.python.org/pypi/property-cached) | [![Source property]( https://img.shields.io/badge/source-GitHub-303030.svg?maxAge=36000&style=flat-square )](https://github.com/althonos/property-cached) | [![License property]( https://img.shields.io/pypi/l/property-cached.svg?maxAge=36000&style=flat-square )]( https://choosealicense.com/licenses/bsd-3-clause/) |\n\n`fs.sshfs` supports all Python versions supported by PyFilesystem2:\nPython 2.7, and Python 3.5 onwards. Code should still be compatible with\nPython 3.4, but not tested anymore.\n\n\n## Installation\n\nInstall directly from PyPI, using [pip](https://pip.pypa.io/):\n\n```console\n$ pip install fs.sshfs\n```\n\nThere is also a [`conda-forge` package](https://conda-forge.org/) available:\n\n```console\n$ conda install -c conda-forge fs.sshfs\n```\n\n\n## Usage\n\n### Opener\n\nUse `fs.open_fs` to open a filesystem with an SSH\n[FS URL](https://docs.pyfilesystem.org/en/latest/openers.html):\n\n```python\nimport fs\nmy_fs = fs.open_fs(\"ssh://[user[:password]@]host[:port]/[directory]\")\n```\n\nThe `sftp` scheme can be used as an alias for the `ssh` scheme in the FS\nURL. Additional argument can be passed to the `SSHFS` constructor as\npercent-encoded URL parameters (excepted `policy`). See section below\nfor a list of all supported arguments.\n\n### Constructor\n\nFor a more granular way of connecting to an SSH server, use the\n`fs.sshfs.SSHFS` constructor, which signature is:\n\n```python\nfrom fs.sshfs import SSHFS\nmy_fs = SSHFS(\n  host, user=None, passwd=None, pkey=None, timeout=10, port=22,\n  keepalive=10, compress=False, config_path='~/.ssh/config'\n)\n```\n\nwith each argument explained below:\n\n- `host`: the name or IP address of the SSH server\n- `user`: the username to connect with, defaults to the current user.\n- `passwd`: an optional password, used to connect directly to the server or\n  to decrypt the public key, if any given.\n- `pkey`: a [`paramiko.PKey`](http://docs.paramiko.org/en/stable/api/keys.html#paramiko.pkey.PKey)\n  object, a path, or a list of paths to an SSH key.\n- `timeout`: the timeout, in seconds, for networking operations.\n- `port`: the port the SSH server is listening on.\n- `keepalive`: the interval of time between *keepalive* packets, in seconds.\n  Set to 0 to disable.\n- `compress`: set to `True` to compress the communications with the server.\n- `config_path`: the path to an OpenSSH configuration file.\n- `exec_timeout`: the timeout, in seconds, for arbitrary SSH commands on\n  the server.\n- `policy`: a\n  [`paramiko.MissingHostKeyPolicy`](http://docs.paramiko.org/en/stable/api/client.html#paramiko.client.MissingHostKeyPolicy)\n  instance, or `None` to use\n  [`paramiko.AutoAddPolicy`](http://docs.paramiko.org/en/stable/api/client.html#paramiko.client.AutoAddPolicy).\n\nAdditional keyword arguments will be passed to the underlying\n[`paramiko.SSHClient.connect`](http://docs.paramiko.org/en/stable/api/client.html#paramiko.client.SSHClient.connect)\ncall, taking precedence over implicitly derived arguments. Once created, the `SSHFS` filesystem behaves like any\nother filesystem (see the [PyFilesystem2 documentation](https://pyfilesystem2.readthedocs.io)).\n\n### Files\n\n`SSHFS.openbin` has the following extra options that can be passed as\nkeyword arguments to control the file buffering:\n\n- `prefetch`: enabled by default, use a background thread to prefetch the content\n  of a file opened in reading mode. Does nothing for files in writing mode.\n- `pipelined`: enable pipelined mode, avoid waiting for server answer between\n  two uploaded chunks. Does nothing for files in reading mode.\n\n\n## Configuration\n\n`SSHFS` are aware of [SSH config\nfiles](http://nerderati.com/2011/03/17/simplify-your-life-with-an-ssh-config-file/)\nand as such, one of the hosts in the configuration file can be provided\nas the `host` argument for the filesystem to connect to the server with\nthe proper configuration values.\n\n\n## Feedback\n\nFound a bug ? Have an enhancement request ? Head over to the [GitHub\nissue tracker](https://github.com/althonos/fs.sshfs/issues) of the\nproject if you need to report or ask something. If you are filling in on\na bug, please include as much information as you can about the issue,\nand try to recreate the same bug in a simple, easily reproductible\nsituation.\n\n\n## Credits\n\n`fs.sshfs` is developed and maintained by:\n- [Martin Larralde](https://github.com/althonos)\n\nThe following people contributed to `fs.sshfs`:\n- [Reimar Bauer](https://github.com/ReimarBauer)\n- [Paul Gessinger](https://github.com/paulgessinger)\n- [Mariusz Kry\u0144ski](https://github.com/mrk-its)\n- [Will McGugan](https://github.com/willmcgugan)\n- [Jeremy Nimmer](https://github.com/jwnimmer-tri)\n- [Tim Nyborg](https://github.com/timnyborg)\n- [Danica J. Sutherland](https://github.com/djsutherland)\n- [John Vandenberg](https://github.com/jayvdb)\n\nThis project obviously owes a lot to the PyFilesystem2 project and\n[all its contributors](https://github.com/PyFilesystem/pyfilesystem2/blob/master/CONTRIBUTORS.md).\n\n## See also\n\n-   [fs](https://github.com/Pyfilesystem/pyfilesystem2), the core\n    PyFilesystem2 library\n-   [fs.archive](https://github.com/althonos/fs.archive), enhanced\n    archive filesystems for PyFilesystem2\n-   [fs.smbfs](https://github.com/althonos/fs.smbfs), PyFilesystem2 over\n    SMB using pysmb\n",
    "bugtrack_url": null,
    "license": "LGPLv2+",
    "summary": "Pyfilesystem2 over SSH using paramiko",
    "version": "1.0.2",
    "project_urls": {
        "Bug Tracker": "https://github.com/althonos/fs.sshfs/issues",
        "Builds": "https://github.com/althonos/fs.sshfs/actions",
        "Changelog": "https://github.com/althonos/fs.sshfs/blob/master/CHANGELOG.md",
        "Coverage": "https://codecov.io/gh/althonos/fs.sshfs",
        "Homepage": "https://github.com/althonos/fs.sshfs"
    },
    "split_keywords": [
        "filesystem",
        "pyfilesystem2",
        "ssh",
        "sftp",
        "paramiko"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "85cd22021dd08d80297ffb144f740e93763416ea5bed91cea0cbfe656360d1b5",
                "md5": "2ddceddea5453f938407649a30c155ed",
                "sha256": "ff7d7aeef546017f5c430e33c7deea50a1728ebeea738d5c5754bd56f8601109"
            },
            "downloads": -1,
            "filename": "fs.sshfs-1.0.2-py2.py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "2ddceddea5453f938407649a30c155ed",
            "packagetype": "bdist_wheel",
            "python_version": "py2.py3",
            "requires_python": "!=3.0.*,!=3.1.*,!=3.2.*,!=3.3.*,>=2.7",
            "size": 23978,
            "upload_time": "2023-08-17T09:45:43",
            "upload_time_iso_8601": "2023-08-17T09:45:43.830585Z",
            "url": "https://files.pythonhosted.org/packages/85/cd/22021dd08d80297ffb144f740e93763416ea5bed91cea0cbfe656360d1b5/fs.sshfs-1.0.2-py2.py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "de8d2bb9ccdbc781eefaac8791fec792caa6616c237efbd8df524fc9f51f77d9",
                "md5": "7706b552afacaf95f4ad21b4157a1367",
                "sha256": "9a6a8567abf8925cd41d06a13c4af6097b48d0d0776fc7785a482a0428b0fc19"
            },
            "downloads": -1,
            "filename": "fs.sshfs-1.0.2.tar.gz",
            "has_sig": false,
            "md5_digest": "7706b552afacaf95f4ad21b4157a1367",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": "!=3.0.*,!=3.1.*,!=3.2.*,!=3.3.*,>=2.7",
            "size": 32240,
            "upload_time": "2023-08-17T09:45:45",
            "upload_time_iso_8601": "2023-08-17T09:45:45.496514Z",
            "url": "https://files.pythonhosted.org/packages/de/8d/2bb9ccdbc781eefaac8791fec792caa6616c237efbd8df524fc9f51f77d9/fs.sshfs-1.0.2.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2023-08-17 09:45:45",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "althonos",
    "github_project": "fs.sshfs",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "lcname": "fs.sshfs"
}
        
Elapsed time: 0.10282s