• Stars
    star
    101
  • Rank 327,519 (Top 7 %)
  • Language
    JavaScript
  • License
    Apache License 2.0
  • Created over 3 years ago
  • Updated over 1 year ago

Reviews

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

Repository Details

🃏 An awesome viewer to browse and render Jupyter Notebooks from local, Amazon S3, Google Cloud Storage or MinIO

🃏 jnotebook_reader

  • Browse and render Jupyter Notebooks from local, Amazon S3, Google Cloud Storage or MinIO
  • Register and access multiple directories(or buckets) at the same time
  • Show and allow to config ToC(Table of Contents) included in your Jupyter Notebook
  • Hide/show all codes in your Jupyter Notebook interactively
  • Generate a permanent link about your Jupyter Notebook
  • Download your Jupyter Notebook in one click

Screenshots

screenshot
screenshot

Runtime Environment Requirement

python 3

Quick Start

git clone https://github.com/line/jnotebook-reader
cd jnotebook-reader
pip install -r requirements.txt
python app.py

How to configure

lib/config.py

"default": {                                  # default config
    "server": {
        "port": 9088,                         # The port server listening on
        "root": "/jupyternb"                  # Context path, base url
    },
    "storage": { # Storage type
        "type": "local",                      # local or s3
        "directories": [                      # If type is local effective
            "/path/foo/bar/1",
            "/path/foo/bar/2"
        ],                                              
        "s3": {                               # s3 config, if type is s3 effective
            "endpoint": None,                 # s3 endpoint, if type is s3 required, if set with None would access to s3 global url
            "accessKey": "YOUR_ACCESS_KEY",   # optional, default; request header "Access-Key" could replace it
            "secretKey": "YOUR_SECRET_KEY",   # optional, default; request header "Secret-Key" could replace it
            "buckets": ["YOUR_BUCKET_NAME"],  # optional, default; request header "Bucket-Name" could replace it
        }
    },
    "logging": {
        "level": logging.DEBUG,
        "format": "%(asctime)s - %(name)s - %(lineno)d - %(levelname)s - %(message)s",
        "filename": "/path/foo/bar/access.log"
    }
}

How to configure for local storage

You 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.

1. "list" type

"directories": [
    "/path/foo/bar/1",
    "/path/foo/bar/2"
]

You can access it like:
http://localhost:9088/0
http://localhost:9088/1

2. "dict" type

"directories": {
    "a": "/path/foo/bar/1",
    "b": "/path/foo/bar/2"
}

You can access it like:
http://localhost:9088/a
http://localhost:9088/b

3. single directory

"directories": "/path/foo/bar/1"

You can access it like:
http://localhost:9088/ANY

How to configure for S3 storage

You 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.

1. "list" type

"buckets": [
    "bucket_name_1",
    "bucket_name_2"
]

You can access it like:
http://localhost:9088/0
http://localhost:9088/1

2. "dict" type

"buckets": {
    "a": "bucket_name_1",
    "b": "bucket_name_2"
}

You can access it like:
http://localhost:9088/a
http://localhost:9088/b

3. single bucket

"buckets": "bucket_name_1"

You can access it like:
http://localhost:9088/ANY

How to configure with environment variables

You can set configuration through environment variables. if environment variables set, the configuration file will be overwritten accordingly.

# Storage type, local or s3, default is local
JNOTEBOOK_READER_STORAGE_TYPE = "local"
# s3 endpoint, only for s3 storage type
JNOTEBOOK_READER_S3_ENDPOINT = ""
# s3 access key, only for s3 storage type
AWS_ACCESS_KEY_ID = ""
# s3 secret key, only for s3 storage type
AWS_SECRET_ACCESS_KEY = ""
# s3 bucket name, could set multiple, separated by ',' only for s3 storage type
JNOTEBOOK_READER_S3_BUCKET_NAME = ""
# local directories, could set multiple, separated by ',' only for local storage type
JNOTEBOOK_READER_DIR = ""

API Spec

Method

GET http://localhost:9088/:id/(:prefix|:key|:path)

Path Variable

Name Type Description
id string ID defined by user
prefix string S3 object prefix
key string S3 object key
path string Local file path

Headers

Name Type Description
Access-Key string S3 access key id
Secret-Key string S3 secret access key
Bucket-Name string S3 bucket name

Example

s3 with request headers

curl -X GET \
  http://localhost:9088/5e26886d36b28f778dddcf0f/folder/test.ipynb \
  -H 'access-key: your_access_key' \
  -H 'bucket-name: test_bucket_name' \
  -H 'secret-key: your_secret_key'

s3 with config buckets

curl -X GET http://localhost:9088/0/folder/test.ipynb

local

curl -X GET http://localhost:9088/1/folder/test.ipynb

Production

If you want to release jnotebook_reader as a production service, it is recommended that you install waitress-serve to manage your service.

git clone https://github.com/line/jnotebook-reader
cd jnotebook-reader
pip install -r requirements.txt
waitress-serve --call --listen=:9088 'app:create_app' &

♒ Docker

docker build -t jnotebook_reader -f docker/Dockerfile .
docker run -p 9088:9088 \
    -e JNOTEBOOK_READER_SERVER_PORT="9088" \
    -e JNOTEBOOK_READER_STORAGE_TYPE="s3" \
    -e JNOTEBOOK_READER_S3_ENDPOINT="S3_ENDPOINT" \
    -e AWS_ACCESS_KEY_ID="S3_ACCESS_KEY" \
    -e AWS_SECRET_ACCESS_KEY="S3_SECRET_KEY" \
    -e JNOTEBOOK_READER_S3_BUCKET_NAME="S3_BUCKET_NAME_1,S3_BUCKET_NAME_2" \
    -it --rm jnotebook_reader

Kubernetes

# Rollout jnotebook_reader deployment on Kubernetes cluster ( all resources are created in jnotebook-reader namespace )
kubectl apply -f docker/deployment.yml

# Get jnotebook_reader port
The examples deploy a NodePort service, so you have to check for the port it is mapped to:

kubectl get svc -n jnotebook-reader

Use the second port you find in the output to access jnotebook_reader, for instance:

NAME                   TYPE       CLUSTER-IP     EXTERNAL-IP   PORT(S)          AGE
jnotebook-reader-svc   NodePort   172.19.66.29   <none>        9088:30693/TCP   25s

Type in browser -> http://{kubernetes_cluster_ip}:30693

# Destroy all resources
kubectl delete ns jnotebook-reader

☮️ Contributing

Please see CONTRIBUTING.md for contributing to jnotebook-reader.

If 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 [email protected].

License

Copyright 2020 LINE Corporation

LINE Corporation licenses this file to you under the Apache License,
version 2.0 (the "License"); you may not use this file except in compliance
with the License. You may obtain a copy of the License at:

   https://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
License for the specific language governing permissions and limitations
under the License.

See LICENSE for more detail.

More Repositories

1

armeria

Your go-to microservice framework for any situation, from the creator of Netty et al. You can build any type of microservice leveraging your favorite technologies, including gRPC, Thrift, Kotlin, Retrofit, Reactive Streams, Spring Boot and Dropwizard.
Java
4,621
star
2

line-bot-sdk-python

LINE Messaging API SDK for Python
Python
1,804
star
3

promgen

Promgen is a configuration file generator for Prometheus
JavaScript
1,031
star
4

line-bot-sdk-nodejs

LINE Messaging API SDK for Node.js
TypeScript
904
star
5

line-bot-sdk-go

LINE Messaging API SDK for Go
Go
860
star
6

line-sdk-ios-swift

Provides a modern way of implementing LINE APIs.
Swift
831
star
7

line-bot-sdk-php

LINE Messaging API SDK for PHP
PHP
696
star
8

kotlin-jdsl

Kotlin library that makes it easy to build and execute queries without generated metamodel
Kotlin
615
star
9

line-bot-sdk-java

LINE Messaging API SDK for Java
Java
590
star
10

centraldogma

Highly-available version-controlled service configuration repository based on Git, ZooKeeper and HTTP/2
Java
572
star
11

line-fido2-server

FIDO2(WebAuthn) server officially certified by FIDO Alliance and Relying Party examples.
Java
484
star
12

line-bot-sdk-ruby

LINE Messaging API SDK for Ruby
Ruby
480
star
13

stellite

Stellite project is a client library and server application that offers an easy way to develop, build, and implement client/server running primarily over the QUIC protocol developed by Google as part of the Chromium project.
C++
471
star
14

garr

Collection of high performance, thread-safe, lock-free go data structures
Go
367
star
15

line-liff-v2-starter

This is a small web application that demonstrates the basic functionality of the LINE Front-end Framework (LIFF).
JavaScript
317
star
16

decaton

High throughput asynchronous task processing on Apache Kafka
Java
313
star
17

ts-remove-unused

Remove unused code from your TypeScript project
TypeScript
255
star
18

headver

SemVer compatible version specification that has {head}.{yearweek}.{build} system.
217
star
19

apng-drawable

A lightweight and fast Animated Portable Network Graphics (APNG) image decoder for Android
Kotlin
215
star
20

flutter_line_sdk

A Flutter plugin that lets developers access LINE's native SDKs in Flutter apps with Dart.
Dart
207
star
21

rules_apple_line

LINE's Apple rules for Bazel
Starlark
206
star
22

lich

A library collection that enhances the development of Android apps.
Kotlin
181
star
23

abc-user-feedback

ABC User Feedback is a standalone web application that manages Voice of Customer (VoC) data. It allows you to gather and sort feedback from your customers.
TypeScript
147
star
24

armeria-examples

Armeria examples
Java
139
star
25

line-liff-starter

This is a small web application that demonstrates the basic functionality of the LINE Front-end Framework (LIFF).
JavaScript
137
star
26

line-login-starter

LINE Login starter application
Java
133
star
27

conflr

Post R Markdown documents to Confluence
R
130
star
28

line-sdk-android

LINE SDK for Android lets you integrate LINE into your Android app to create a more engaging experience for your users.
Java
128
star
29

clay

Clay is an Android library project that provides image trimming which is originally an UI component of LINE Creators Studio
Kotlin
121
star
30

line-openapi

OpenAPI spec of the LINE's Public APIs
JavaScript
119
star
31

line-sdk-unity

Provides a modern way of implementing LINE APIs in Unity games, for iOS and Android.
C#
110
star
32

line-simple-beacon

JavaScript
106
star
33

feature-flag-android

A Gradle plugin to achieve feature flag based development for Android applications.
Kotlin
96
star
34

line-things-starter

The sample codes for LINE Things Developer Trial
C++
90
star
35

webpack.kr

Korean translation of webpack document
MDX
90
star
36

grow-loader

A webpack loader to split class methods by decorators
JavaScript
89
star
37

liff-playground

An example app to show the usage of LIFF's API functions
TypeScript
80
star
38

gradle-scripts

Sensible multi-project defaults for Gradle
77
star
39

vue-pivot-table-plus

An enhanced pivot table component for Vue.js
Vue
76
star
40

line-platform-feedback

LINE Platform feedback
76
star
41

abc-kmm-location

Location Service Manager for Kotlin Multiplatform Mobile iOS and Android
Kotlin
74
star
42

gradle-multi-project-support

A collection of Gradle plugins to maintain the multi-project or multi-application in the mono-repo.
Kotlin
74
star
43

line-bot-sdk-perl

LINE Messaging API SDK for Perl
Perl
72
star
44

abc-virtual-background-maker

A standalone React application designed for creating and downloading virtual background images enriched with customizable text elements.
TypeScript
70
star
45

ostracon

Ostracon, a consensus algorithm, is forked from Tendermint Core. We have added VRF to Tendermint BFT. It adds randomness to PoS Validator elections and improves security.
Go
60
star
46

conditional

A super lightweight library that helps you to compose multiple conditional expressions and make them asynchronous easily.
Java
57
star
47

lbm-sdk

A framework for building blockchains based LINE Blockchain Mainnet that is forked from cosmos-sdk
Go
53
star
48

abc-kmm-notifications

Remote Notification Manager for Kotlin Multiplatform Mobile iOS and Android
Kotlin
52
star
49

line-sdk-starter-ios

A starter app demonstrating usage of the LINE iOS SDK.
Objective-C
50
star
50

create-liff-app

Start developing LIFF application with a simple CLI command.
TypeScript
48
star
51

centraldogma-rs

Official Rust client for Central Dogma
Rust
46
star
52

liff-inspector

The universal DevTools for LIFF (WebView) browser
TypeScript
46
star
53

centraldogma-go

Go client library for Central Dogma
Go
45
star
54

zipkin-lens

An alternative UI for Zipkin (Distributed Tracing), this repo is no longer used as it's already merged into upstream, please go to https://github.com/openzipkin/zipkin/tree/master/zipkin-lens
JavaScript
44
star
55

LINE-DistilBERT-Japanese

DistilBERT model pre-trained on 131 GB of Japanese web text. The teacher model is BERT-base that built in-house at LINE.
43
star
56

clova-cek-sdk-nodejs

SDK of the Clova CEK for Node.js
TypeScript
34
star
57

line-sdk-starter-android-v2

A starter application that demonstrates how to use LINE SDK V2 for Android.
Java
34
star
58

liff-mock

LIFF Mock is a LIFF Plugin that make testing your LIFF app easy.
TypeScript
33
star
59

kubectl-kustomize

Docker image with kubectl and kustomize
Dockerfile
32
star
60

lfb

LINE Financial Blockchain forked from gaia(https://github.com/cosmos/gaia)
Go
32
star
61

recruiting-resources-jp

Go
32
star
62

demo-rich-menu-bot

Demo bot for using rich menus with the Messaging API
PHP
31
star
63

line-sdk-starter-android

A starter app demonstrating usage of the LINE Android SDK.
Java
31
star
64

line-things-dev-board

LINE Things development board - Sample codes and schematics
HTML
29
star
65

line-api-use-case-messaging-api

LINE Messaging API demo application provided by LINE API Use Case
Python
29
star
66

line-sdk-starter-ios-v2

A starter application that demonstrates how to use LINE SDK for iOS.
Objective-C
27
star
67

aes-gcm-siv

AES-GCM-SIV (RFC 8452) implementation for C, Android and Java, with hardware acceleration support.
C
27
star
68

figma-translator-vue-plugin-sample

The sample of Figma translation plugin with Vue
Vue
26
star
69

abc-kmm-shared-storage

A local storage management library for Kotlin Multiplatform Mobile iOS and Android
Kotlin
25
star
70

line-api-use-case-reservation-hairsalon

Hair salon reservation demo application provided by LINE API Use Case
Python
25
star
71

networking-sr

OpenStack Neutron plugin/drivers for Segment Routing IPv6
Python
24
star
72

line-blockchain-developers-sdk-js

Javascript library for line blockchain developers
TypeScript
24
star
73

gradle-multi-project-support-sample

This is a sample of build-recipe-plugin in gradle-multi-project-support
Kotlin
24
star
74

blockchain-sample-link-cinema

A sample service of LINE Blockchain, demonstrating how to utilize LINE Blockchain Developers and LINE BITMAX Wallet.
Go
21
star
75

abc-kmm-analytics-tools

Analytics Tools for Kotlin Multiplatform Mobile iOS and Android
Kotlin
20
star
76

clova-cek-sdk-swift

SDK of the Clova CEK for Swift
Swift
20
star
77

clova-cek-sdk-python

SDK of the Clova CEK for Python
Python
19
star
78

Human-Interaction-Generation

Official implementation of ICCV 2023 Oral Paper "Role-Aware Interaction Generation from Textual Description"
Python
19
star
79

Meta-AI-Video-Similarity-Challenge-3rd-Place-Solution

The 3rd Place Solution of the Meta AI Video Similarity Challenge : Descriptor Track and Matching Track.
Python
17
star
80

BC-node-server-sample

BusinessConnect sample server with NodeJS
JavaScript
16
star
81

centraldogma-python

Python client library for Central Dogma
Python
16
star
82

line-api-use-case-reservation-Restaurant

Restaurant reservation demo application provided by LINE API Use Case
Python
15
star
83

cosmwasm

Fast and reusable WebAssembly smart contract runtime(and library) for lbm-sdk.
Rust
15
star
84

japanese-large-lm-instruction-sft

15
star
85

gorocksdb

A `rocksdb` wrapper for golang applications. This is forked from https://github.com/tecbot/gorocksdb.
Go
15
star
86

line-bot-sample-ms

C#
14
star
87

line-api-use-case-table-order

Table order demo application provided by LINE API Use Case
Python
14
star
88

iavl

Merkleized IAVL+ Tree implementation in Go forked from cosmos/iavl(https://github.com/cosmos/iavl)
Go
14
star
89

clova-cek-sdk-java

SDK of the Clova CEK for Java
Java
13
star
90

wasmvm

Go bindings to the CosmWasm smart contract framework. In particular, it allows you to easily compile, initialize, and execute these contracts from Go.
Go
13
star
91

tm-db

Common database interface for various database backends for Ostracon and LBM SDK. This is forked from Tendermint tm-db(https://github.com/tendermint/tm-db)
Go
13
star
92

blockchain-sample-mage-duel

A sample service implementing a card game using the blockchain, which can serve as a guide on tokenizing game money and items.
C#
13
star
93

clova-cek-sdk-elixir

SDK of the Clova CEK for Elixir
Elixir
13
star
94

line-bot-pyconkr2019

LINE Chatbot for PyCon KR 2019
Python
12
star
95

line-api-use-case-liff

LINE LIFF demo application provided by LINE API Use Case
CSS
11
star
96

line-blockchain-developers-sdk-kt

Kotlin library for line blockchain developers
Kotlin
11
star
97

clova-extension-sample-dice

JavaScript
10
star
98

line-api-use-case-line-login

LINE Login demo application provided by LINE API Use Case
Python
10
star
99

abc-kmm-h3

A library to convert Uber's H3 geo-index to LatLng vertices for Kotlin Multiplatform Mobile iOS and Android
C
10
star
100

clova-cek-sdk-go

SDK of the Clova CEK for Go
Go
9
star