Skip to main content

A Filesystem-like mult-contents manager backend for Jupyter

Project description

jupyter-fs

azure ci status appveyor ci status (telamonian fork) pypi package npm package

A plugin for JupyterLab that lets you set up and use as many filebrowsers as you like, connected to whatever local and/or remote filesystem-like resources you want.

The backend is built on top of PyFilesystem, while the frontend is built on top of JupyterLab Filetree.

Install

pip install jupyter-fs

Configure

Add the following to your jupyter_notebook_config.json:

{
  "NotebookApp": {
    "contents_manager_class": "jupyterfs.metamanager.MetaManager",
    "nbserver_extensions": {
      "jupyterfs": true
    }
  }
}

Simple use (no auth/credentials)

Add specifications for additional contents managers in your user settings (in the Settings menu under Advanced Settings Editor -> jupyter-fs). Here's an example config that sets up several new filebrowsers side-by-side:

{
  "resources": [
    {
      "name": "root at test dir",
      "url": "osfs:///Users/foo/test"
    },
    {
      "name": "s3 test bucket",
      "url": "s3://test"
    },
    {
      "name": "samba guest share",
      "url": "smb://guest@127.0.0.1/test?name-port=3669"
    }
  ]
}

You should see your new filebrowsers pop up in the left-hand sidebar instantly when you save your settings:

Use with auth/credentials

Any stretch of a "url" that is enclosed in double-brackets {{VAR}} will be treated as a template, and will be handled by jupyter-fs's auth system. For example, you can pass a username/password to the "samba guest share" resource in the Simple use example above by modifying its "url" like so:

{
  "resources": [
    ...

    {
      "name": "samba share",
      "url": "smb://{{user}}:{{passwd}}@127.0.0.1/test?name-port=3669"
    }
  ]
}

When you save the above "resouces" config, a dialog box will pop asking for the username and passwd values:

Once you enter those values and hit ok, the new filebrowsers will then immediately appear in the sidebar:

The auth dialog will only appear when needed

The jupyter-fs auth dialog will only appear when:

  • JupyterLab first loads, if any fs resources reqiure auth
  • a new fs resouce is added that requires auth, or its "url" field is modified

Supported filesystems

The type of resource each filebrowser will point to is determined by the protocol at the start of its url:

  • osfs: os filesystem. The will open a new view of your local filesystem, with the specified root
  • s3: opens a filesystem pointing to an Amazon S3 bucket
  • smb: opens a filesystem pointing to a Samba share

jupyter-fs can open a filebrowser pointing to any of the diverse resources supported by PyFilesystem. Currently, we test only test the S3 and smb/samba backends as part of our CI, so your milleage may vary with the other PyFilesystem backends.

The filesystem url

The "url" field jupyter-fs config is based on the PyFilesystem opener url standard. For more info on how to write these urls, see the documentation of the relevant PyFilesystem plugin:

Server-side settings

If you prefer to set up your filesystem resources in the server-side config, you can do so. For example, you can set up a local filesystem by adding the following to your jupyter_notebook_config.py:

c.jupyterfs.specs = [
    {
        "name": "local_test",
        "url": "osfs:///Users/foo/test"
    },
]

Any filesystem specs given in the server-side config will be merged with the specs given in a user's settings.

Development

See CONTRIBUTING.md for guidelines.

License

This software is licensed under the Apache 2.0 license. See the LICENSE and AUTHORS files for details.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

jupyter-fs-0.0.3.tar.gz (660.2 kB view details)

Uploaded Source

Built Distribution

jupyter_fs-0.0.3-py2.py3-none-any.whl (113.6 kB view details)

Uploaded Python 2 Python 3

File details

Details for the file jupyter-fs-0.0.3.tar.gz.

File metadata

  • Download URL: jupyter-fs-0.0.3.tar.gz
  • Upload date:
  • Size: 660.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.0.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/42.0.2 requests-toolbelt/0.9.1 tqdm/4.32.1 CPython/3.7.6

File hashes

Hashes for jupyter-fs-0.0.3.tar.gz
Algorithm Hash digest
SHA256 dcaca552860064969cf3cd1f9b536a7ddfb29e25557acb9dac4b9d919b47a004
MD5 728dee9ffec0b797f8b1b64d1b138df5
BLAKE2b-256 050297b9db549e9317b4e31ffc14fa92dd7dd557798502a7389639f4ad2a6248

See more details on using hashes here.

File details

Details for the file jupyter_fs-0.0.3-py2.py3-none-any.whl.

File metadata

  • Download URL: jupyter_fs-0.0.3-py2.py3-none-any.whl
  • Upload date:
  • Size: 113.6 kB
  • Tags: Python 2, Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.0.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/42.0.2 requests-toolbelt/0.9.1 tqdm/4.32.1 CPython/3.7.6

File hashes

Hashes for jupyter_fs-0.0.3-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 5a407dbb48aaad55a158e8aa057a2c721a88959af9f880483fa6cfd2174b8162
MD5 b6af637015656a0220a330eb6ddedff5
BLAKE2b-256 a2b8e20fe66d5601cb57f4eef347b9651a689ef4ab40505cccc5fa16a0ba7a9e

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page