Jupyter notebook viewer
Project description
callisto
A jupyter notebook viewer that has the following features:
- Use ContentsManager as content provider. Therefore it is completely work with any of your jupyterhub settings.
- Showing Table of Contents for quickly reference to your notebook
- Directly import the notebook to your jupyterhub server.
Getting Started
- Install the package:
pip install callisto-nbviewer
- start the server:
callisto start --port 5000
- Visit website
localhost:5000
Configuration
You can use your own config to customize callisto. see example on tests/fixtures/config.py
ontents_manager_cls = "s3contents.S3ContentsManager"
# `contents_manager_cls` can be string or ContentsManger class
# You can use any existing ContentsManager to load data.
# If the value is not set, the default would be FileContentsManager
# and will serve contents on current working directory
contents_manager_kwargs = {
"bucket": "test-bucket",
"access_key_id": "testing",
"secret_access_key": "testing",
"endpoint_url": "http://localhost:3000"
}
# [Optional] `contents_manager_kwargs` is a dict of kwargs to configure the required settings
# for whatever ContentsManager you choose.
jupyterhub_base_url = "https://jupyterhub.example.com"
# [Optional] `jupyterhub_base_url` if set, you can import the notebook directly to your jupyterhub server
# This is the base url to your jupyterhub.
import_link_with_hubshare_preview = True
# [Optional] `import_link_with_hubshare_preview`: if you have installed jupyterlab-hubshare plugin,
# You can use this link to show preview on your notebook server
import_link_func = lambda path: "prefix/" + path
# [Optional] `import_link_func` is a function in that takes the current path as an input,
# You can do any magic to update the final path in case the path on the site is different
# from the path on jupyterhub.
and then start callisto with
callisto --config my_callisto_config.py
Config for different contents manager
Local File
contents_manager_cls = "managerjupyter_server.services.contents.filemanager.FileContentsManager"
contents_manager_kwargs = {"root_dir": "/absolute/path/to/your/notebook/folder"}
S3
Note that s3contents seems to be fetching the directory last_modified time, and is very slow.
Therefore I make a work around file in callisto.contents_managers.s3.SimplifiedS3ContentsManager
class
please take a look on the settings.
contents_manager_cls = "callisto.contents_managers.s3.SimplifiedS3ContentsManager"
contents_manager_kwargs = {
"bucket": "my-s3-bucket",
"prefix": "prefix/to/your/notebook/folder",
"aws_access_key_id": "my_access_key",
"aws_secret_access_key": "my_secret_access_key",
}
if your file s3 doesn't contains a lot of folders, you can still use s3contents (please ensure you also install s3contents
)
contents_manager_cls = "s3contents.S3ContentsManager"
contents_manager_kwargs = {
"bucket": "my-s3-bucket",
"prefix": "prefix/to/your/notebook/folder",
}
for more settings, please refer to: s3contents
Development
to start a dev version, download the git repo:
git clone https://github.com/lydian/callisto.git
and run
cd callisto
make start-dev
The dev server will running on http://localhost:5001
Project details
Release history Release notifications | RSS feed
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
File details
Details for the file callisto-nbviewer-1.0.2.tar.gz
.
File metadata
- Download URL: callisto-nbviewer-1.0.2.tar.gz
- Upload date:
- Size: 1.7 MB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.7.1 importlib_metadata/4.10.0 pkginfo/1.8.2 requests/2.27.1 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.9
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | d6864594debdb141c4c2db907480b086b34e3609a6c50ec0c8e7b08bb123e181 |
|
MD5 | 9d716c28d2dd218c56aa5755e7f55e37 |
|
BLAKE2b-256 | 81c505a55399e29b040bfb9c999c2b168fbe56b449393bc9ddb6e31a4af7e289 |
File details
Details for the file callisto_nbviewer-1.0.2-py3-none-any.whl
.
File metadata
- Download URL: callisto_nbviewer-1.0.2-py3-none-any.whl
- Upload date:
- Size: 1.7 MB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.7.1 importlib_metadata/4.10.0 pkginfo/1.8.2 requests/2.27.1 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.9
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 625cd6aafbb945b6414e6136fdc484badae54e24fa2d9eea6b0adcfd77ea7630 |
|
MD5 | fe2115bde9934d95f9822000a27732b0 |
|
BLAKE2b-256 | d4d803a685744bf5c5096a56771ca67c4cfae29f9d6d9dcea730354eb56d5e80 |