Jupyter Notebook PyFilesystem Contents Manager
Project description
Jupyter Notebook PyFilesystem Contents Manager
A Jupyter Notebooks ContentsManager that uses PyFilesystem for storing files.
Installation
pip install jupyter-pyfilesystem
Example
jupyter_notebook_config.py
:
c.NotebookApp.contents_manager_class = 'jupyter_pyfilesystem.FsContentsManager'
c.ContentsManager.checkpoints_class = 'jupyter_pyfilesystem.FsCheckpoints'
# In-memory temporary filesystem
fs_url = 'mem://'
c.FsContentsManager.fs_url = c.FsCheckpoints.fs_url = fs_url
See https://docs.pyfilesystem.org/en/latest/openers.html for information on how to define fs_url
, and https://docs.pyfilesystem.org/en/latest/builtin.html for a list of built-in filesystems.
There are also several externally-contributed filesystems that can be used.
Some are listed on https://www.pyfilesystem.org/page/index-of-filesystems/
Note some filesystems may not behave as you expect.
For example, the curent implementations of the zip://
and tar://
filesystems do not allow you to update an existing file.
You can only create/overwrite an existing file, or open a file read-only.
For example:
fs_url = 'zip:///tmp/test.zip'
c.FsContentsManager.fs_url = c.FsCheckpoints.fs_url = fs_url
import os
if os.path.exists(fs_url[6:]):
c.FsContentsManager.create = c.FsCheckpoints.create = False
c.FsContentsManager.writeable = c.FsCheckpoints.writeable = False
If you are using a remote filesystem you may want to enable the keepalive.
For example, this will make a remote request to get the details of /
every 60 seconds:
c.FsContentsManager.keepalive = c.FsCheckpoints.keepalive = 60
Acknowledgements
This repository is based on https://github.com/quantopian/pgcontents/tree/5fad3f6840d82e6acde97f8e3abe835765fa824b
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
Built Distribution
Hashes for jupyter-pyfilesystem-0.0.4.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 97f50d23b50403f9c0f9c5f83f1232387f301502d2a016c5f1922b3a68084003 |
|
MD5 | 5c90ccce72371eb62332441e2855b1c4 |
|
BLAKE2b-256 | 1d86afa7d3115b4fe209ca54375944b33ca6d56ce4ced2df94020569224b19ba |
Hashes for jupyter_pyfilesystem-0.0.4-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 6896b200a8d159fc22d3c7d702f67736dbab2a64e4c5caecbfdcba56c99efb9d |
|
MD5 | 18b24e380955ce6e1fa27a81fa12e1ae |
|
BLAKE2b-256 | 25ba0e5660fd3b0d6f150d75759e27c1ac00f287fd3c4d1b3ff504c72b9a2a93 |