{"id":13607265,"url":"https://github.com/line/jnotebook_reader","last_synced_at":"2025-09-02T00:35:03.432Z","repository":{"id":47200101,"uuid":"308508311","full_name":"line/jnotebook_reader","owner":"line","description":":black_joker: An awesome viewer to browse and render Jupyter Notebooks from local, Amazon S3, Google Cloud Storage or MinIO","archived":false,"fork":false,"pushed_at":"2022-12-06T05:30:25.000Z","size":863,"stargazers_count":104,"open_issues_count":1,"forks_count":17,"subscribers_count":13,"default_branch":"master","last_synced_at":"2025-03-30T18:35:33.644Z","etag":null,"topics":["amazon-s3","google-cloud-storage","ipynb-viewer","jnotebook-reader","jupyter","jupyter-notebook","minio","notebook-reader","notebook-viewer"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/line.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE.txt","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2020-10-30T02:50:59.000Z","updated_at":"2024-11-15T08:10:50.000Z","dependencies_parsed_at":"2023-01-23T17:01:53.782Z","dependency_job_id":null,"html_url":"https://github.com/line/jnotebook_reader","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/line%2Fjnotebook_reader","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/line%2Fjnotebook_reader/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/line%2Fjnotebook_reader/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/line%2Fjnotebook_reader/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/line","download_url":"https://codeload.github.com/line/jnotebook_reader/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248560181,"owners_count":21124608,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["amazon-s3","google-cloud-storage","ipynb-viewer","jnotebook-reader","jupyter","jupyter-notebook","minio","notebook-reader","notebook-viewer"],"created_at":"2024-08-01T19:01:17.138Z","updated_at":"2025-04-12T11:31:55.494Z","avatar_url":"https://github.com/line.png","language":"JavaScript","funding_links":[],"categories":["Jupyter-Notebook分享与格式转换"],"sub_categories":[],"readme":"# :black_joker: jnotebook_reader\n- Browse and render Jupyter Notebooks from local, Amazon S3, Google Cloud Storage or MinIO\n- Register and access multiple directories(or buckets) at the same time\n- Show and allow to config ToC(Table of Contents) included in your Jupyter Notebook\n- Hide/show all codes in your Jupyter Notebook interactively\n- Generate a permanent link about your Jupyter Notebook\n- Download your Jupyter Notebook in one click\n## :aries: Screenshots\n\n|![screenshot](docs/images/screenshot-1.png)|\n| ----------------------------------------- |\n\n|![screenshot](docs/images/screenshot-2.png)|\n| ----------------------------------------- |\n\n## :taurus: Runtime Environment Requirement\npython 3\n\n## :gemini: Quick Start\n```bash\ngit clone https://github.com/line/jnotebook-reader\ncd jnotebook-reader\npip install -r requirements.txt\npython app.py\n```\n## :cancer: How to configure\nlib/config.py\n```python\n\"default\": {                                  # default config\n    \"server\": {\n        \"port\": 9088,                         # The port server listening on\n        \"root\": \"/jupyternb\"                  # Context path, base url\n    },\n    \"storage\": { # Storage type\n        \"type\": \"local\",                      # local or s3\n        \"directories\": [                      # If type is local effective\n            \"/path/foo/bar/1\",\n            \"/path/foo/bar/2\"\n        ],                                              \n        \"s3\": {                               # s3 config, if type is s3 effective\n            \"endpoint\": None,                 # s3 endpoint, if type is s3 required, if set with None would access to s3 global url\n            \"accessKey\": \"YOUR_ACCESS_KEY\",   # optional, default; request header \"Access-Key\" could replace it\n            \"secretKey\": \"YOUR_SECRET_KEY\",   # optional, default; request header \"Secret-Key\" could replace it\n            \"buckets\": [\"YOUR_BUCKET_NAME\"],  # optional, default; request header \"Bucket-Name\" could replace it\n        }\n    },\n    \"logging\": {\n        \"level\": logging.DEBUG,\n        \"format\": \"%(asctime)s - %(name)s - %(lineno)d - %(levelname)s - %(message)s\",\n        \"filename\": \"/path/foo/bar/access.log\"\n    }\n}\n```\n### How to configure for local storage\nYou can configure multiple directories to be accessed by the jnotebook-viewer at the same time. Depending on your preference, you can set it as list or dict.\n#### 1. \"list\" type\n```\n\"directories\": [\n    \"/path/foo/bar/1\",\n    \"/path/foo/bar/2\"\n]\n```\nYou can access it like: \u003cbr/\u003e\nhttp://localhost:9088/0 \u003cbr/\u003e\nhttp://localhost:9088/1\n#### 2. \"dict\" type\n```\n\"directories\": {\n    \"a\": \"/path/foo/bar/1\",\n    \"b\": \"/path/foo/bar/2\"\n}\n```\nYou can access it like: \u003cbr/\u003e\nhttp://localhost:9088/a \u003cbr/\u003e\nhttp://localhost:9088/b\n#### 3. single directory\n```\n\"directories\": \"/path/foo/bar/1\"\n```\nYou can access it like: \u003cbr/\u003e\nhttp://localhost:9088/ANY\n### How to configure for S3 storage\nYou can configure multiple buckets to be accessed by the jnotebook-reader at the same time. Depending on your preference, you can set it as list or dict.\n#### 1. \"list\" type\n```\n\"buckets\": [\n    \"bucket_name_1\",\n    \"bucket_name_2\"\n]\n```\nYou can access it like: \u003cbr/\u003e\nhttp://localhost:9088/0 \u003cbr/\u003e\nhttp://localhost:9088/1\n#### 2. \"dict\" type\n```\n\"buckets\": {\n    \"a\": \"bucket_name_1\",\n    \"b\": \"bucket_name_2\"\n}\n```\nYou can access it like: \u003cbr/\u003e\nhttp://localhost:9088/a \u003cbr/\u003e\nhttp://localhost:9088/b\n#### 3. single bucket\n```\n\"buckets\": \"bucket_name_1\"\n```\nYou can access it like: \u003cbr/\u003e\nhttp://localhost:9088/ANY\n### How to configure with environment variables\nYou can set configuration through environment variables.\nif environment variables set, the configuration file will be overwritten accordingly.\n```bash\n# Storage type, local or s3, default is local\nJNOTEBOOK_READER_STORAGE_TYPE = \"local\"\n# s3 endpoint, only for s3 storage type\nJNOTEBOOK_READER_S3_ENDPOINT = \"\"\n# s3 access key, only for s3 storage type\nAWS_ACCESS_KEY_ID = \"\"\n# s3 secret key, only for s3 storage type\nAWS_SECRET_ACCESS_KEY = \"\"\n# s3 bucket name, could set multiple, separated by ',' only for s3 storage type\nJNOTEBOOK_READER_S3_BUCKET_NAME = \"\"\n# local directories, could set multiple, separated by ',' only for local storage type\nJNOTEBOOK_READER_DIR = \"\"\n```\n## :leo: API Spec\n### Method\nGET http://localhost:9088/:id/(:prefix|:key|:path)\n### Path Variable\n| Name  | Type  | Description  |\n|---|---|---|\n| id | string | ID defined by user |\n| prefix | string | S3 object prefix |\n| key | string | S3 object key |\n| path | string | Local file path |\n### Headers\n| Name  | Type  | Description  |\n|---|---|---|\n| Access-Key | string | S3 access key id |\n| Secret-Key | string | S3 secret access key |\n| Bucket-Name | string | S3 bucket name |\n\n### Example\n#### s3 with request headers\n```\ncurl -X GET \\\n  http://localhost:9088/5e26886d36b28f778dddcf0f/folder/test.ipynb \\\n  -H 'access-key: your_access_key' \\\n  -H 'bucket-name: test_bucket_name' \\\n  -H 'secret-key: your_secret_key'\n```\n#### s3 with config buckets\n```\ncurl -X GET http://localhost:9088/0/folder/test.ipynb\n```\n#### local\n```\ncurl -X GET http://localhost:9088/1/folder/test.ipynb\n```\n## :virgo: Production\nIf you want to release jnotebook_reader as a production service, it is recommended that you install [waitress-serve](https://docs.pylonsproject.org/projects/waitress/en/stable/runner.html) to manage your service.\n```bash\ngit clone https://github.com/line/jnotebook-reader\ncd jnotebook-reader\npip install -r requirements.txt\nwaitress-serve --call --listen=:9088 'app:create_app' \u0026\n```\n## :aquarius: Docker\n```bash\ndocker build -t jnotebook_reader -f docker/Dockerfile .\ndocker run -p 9088:9088 \\\n    -e JNOTEBOOK_READER_SERVER_PORT=\"9088\" \\\n    -e JNOTEBOOK_READER_STORAGE_TYPE=\"s3\" \\\n    -e JNOTEBOOK_READER_S3_ENDPOINT=\"S3_ENDPOINT\" \\\n    -e AWS_ACCESS_KEY_ID=\"S3_ACCESS_KEY\" \\\n    -e AWS_SECRET_ACCESS_KEY=\"S3_SECRET_KEY\" \\\n    -e JNOTEBOOK_READER_S3_BUCKET_NAME=\"S3_BUCKET_NAME_1,S3_BUCKET_NAME_2\" \\\n    -it --rm jnotebook_reader\n```\n\n## :pisces: Kubernetes\n```bash\n# Rollout jnotebook_reader deployment on Kubernetes cluster ( all resources are created in jnotebook-reader namespace )\nkubectl apply -f docker/deployment.yml\n\n# Get jnotebook_reader port\nThe examples deploy a NodePort service, so you have to check for the port it is mapped to:\n\nkubectl get svc -n jnotebook-reader\n\nUse the second port you find in the output to access jnotebook_reader, for instance:\n\nNAME                   TYPE       CLUSTER-IP     EXTERNAL-IP   PORT(S)          AGE\njnotebook-reader-svc   NodePort   172.19.66.29   \u003cnone\u003e        9088:30693/TCP   25s\n\nType in browser -\u003e http://{kubernetes_cluster_ip}:30693\n\n# Destroy all resources\nkubectl delete ns jnotebook-reader\n```\n\n## :peace_symbol: Contributing\n\nPlease see [CONTRIBUTING.md](CONTRIBUTING.md) for contributing to jnotebook-reader.\n\nIf you believe you have discovered a vulnerability or have an issue related to security, please DO NOT open a public issue. Instead, send us a mail to [dl_oss_dev@linecorp.com](mailto:dl_oss_dev@linecorp.com).\n\n## :libra: License\n\n```\nCopyright 2020 LINE Corporation\n\nLINE Corporation licenses this file to you under the Apache License,\nversion 2.0 (the \"License\"); you may not use this file except in compliance\nwith the License. You may obtain a copy of the License at:\n\n   https://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS, WITHOUT\nWARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the\nLicense for the specific language governing permissions and limitations\nunder the License.\n```\n\nSee [LICENSE](LICENSE) for more detail. \n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fline%2Fjnotebook_reader","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fline%2Fjnotebook_reader","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fline%2Fjnotebook_reader/lists"}