• Stars
    star
    185
  • Rank 201,296 (Top 5 %)
  • Language
    TypeScript
  • License
    Apache License 2.0
  • Created over 4 years ago
  • Updated 28 days ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

A filesystem-like contents manager for multiple backends in Jupyter

jupyter-fs

build status 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_server_config.json:

{
  "ServerApp": {
    "contents_manager_class": "jupyterfs.metamanager.MetaManager",
    "jpserver_extensions": {
      "jupyterfs.extension": 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": "s3 test key",
      "url": "s3://test-2/prefix/",
      "defaultWritable": false
    },
    {
      "name": "samba guest share",
      "url": "smb://[email protected]/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_server_config.py file:

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

ALternatively, you can add resource specifications alongside the basic jupyter-fs config in your jupyter_server_config.json file:

{
  "ServerApp": {
    "contents_manager_class": "jupyterfs.metamanager.MetaManager",
    "jpserver_extensions": {
      "jupyterfs.extension": true
    }
  },
  "JupyterFs": {
    "resources": [
      {
        "name": "local_test",
        "url": "osfs:///Users/foo/test"
      }
    ]
  }
}

Any filesystem resources specified in any server-side config file will be merged with the resources 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.

More Repositories

1

python-training

Python training for business analysts and traders
Jupyter Notebook
3,398
star
2

modular

A modular front end development framework
TypeScript
602
star
3

nbcelltests

Cell-by-cell testing for production Jupyter notebooks in JupyterLab
Python
81
star
4

salt-ds

React UI components built with a focus on accessibility, customisation and ease-of-use
TypeScript
77
star
5

jif-dashboard

A dashboard framework to quickly build widget-based dashboards
JavaScript
71
star
6

abides-jpmc-public

Jupyter Notebook
62
star
7

jpmorganchase.github.io

JPMC IO Site
HTML
31
star
8

swblocks-baselib

A modern C++11 library that provides a number unique capabilities, idiomatic blocks and wrappers which are generic, flexible, compose-able and can be used in many generic contexts for development of both applications and system level components
C++
30
star
9

sandboni-core

Sandboni - Java test optimization library which reduces test execution time without compromising quality
Java
28
star
10

swblocks-decisiontree

swblocks-decisiontree library is a high performance, highly flexible service which evaluates inputs to a set of rules to identify one and only one output rule which in term results in a set of outputs
Java
25
star
11

Phantom

A Multi-agent reinforcement-learning simulator framework.
Python
24
star
12

payments

JPMC Payments open source projects
Shell
21
star
13

iff

Feature Flags: The Next Generation
TypeScript
19
star
14

topical

Jupyter Notebook
17
star
15

opencell

Spreadsheets 3.0
Python
16
star
16

py-avro-schema

Generate Apache Avro schemas for Python types including standard library data-classes and Pydantic data models.
Python
15
star
17

mosaic

https://mosaic-mosaic-dev-team.vercel.app
TypeScript
13
star
18

java-lint-assert

Java Lint Library
Java
11
star
19

depcom

A blazing fast go / npm package that extracts imported dependencies from Javascript / Typescript / CSS source files.
Go
11
star
20

swblocks-jbl

swblocks-jbl library is a set of core Java utilities based on Java 8 which provides as set of core error handling tools and additional utilites used across the swblocks projects. It has been written to avoid the problem of including a number of large external dependencies which are only required for one or two classes.
Java
11
star
21

kallisti

Chaos Engineering Framework across Private / Public / Hybrid Cloud Environments
Python
10
star
22

SFinX

Standardized FINancial eXtractions
Python
9
star
23

fusion

PyFusion is the Python SDK for the Fusion platform API.
Python
9
star
24

fusion-java-sdk

A Java SDK for the Fusion platform API
Java
8
star
25

cf-shap

Counterfactual SHAP: a framework for counterfactual feature importance
HTML
7
star
26

inference-server

Deploy your AI/ML model to Amazon SageMaker for real-time inference using your own Docker container image.
Python
7
star
27

kallisti-core

Core functionality of Kallisti Chaos Engineering Framework
Python
6
star
28

llm-email-spam-detection

LLM for Email Spam Detection
Python
6
star
29

react-component-usage

A tool for UI or Design System libraries to understand usage patterns of React components within it's organisation
JavaScript
6
star
30

fusion-notebooks

Code and Jupyter notebooks that provide working examples of how to use the PyFusion SDK
Jupyter Notebook
5
star
31

unicorn-finance

Payments - we have created Unicorn Finance as a sample application showcasing the capabilities of our JP Morgan core external APIs.
TypeScript
4
star
32

cf-shap-facct22

Counterfactual Shapley Additive Explanation: Experiments
Jupyter Notebook
4
star
33

.github

Community Content for JPMC Repositories
3
star
34

Figma-Plugins-and-Widgets

Figma plugins and widgets to enhance design workflows
TypeScript
3
star
35

salesforce-b2c

host adapters for salesforce
JavaScript
2
star
36

cv4code

CV4Code - Sourcecode Understanding via Visual Code Representations
Python
2
star
37

sap

host adapters for sap
1
star
38

pandemic-ui-chase

JPMC Institute Project Pandemic UI Chase
R
1
star