Is it possible to host nbviewer locally?

I want to bring nbviewer to my work. Since I cannot share company data (put it on github), I will need to install nbviewer locally. There are installation instructions on Heroku, but this will not work for me. Has anyone tried to do this? Is it even worth the effort? Any other alternatives? Thank you

Steps to run nbviewer on your local computer:

Step 1: Download nbviewer from github
Step 2: Download nbconvert from github
Step 3: Put nbconvert content to the "nbconvert" folder inside nbviewer

Step 4: Get Required Libraries
easy_install Flask == 0.9
easy_install Flask-Markdown
Easy_install requests
easy_install Pygments (ships with python xy)
easy_install Markdown == 2.2.0
easy_install pylibmc == 1.2.3
easy_install tornado
easy_install newrelic (could not install additional extension c, but I think that this is normal)
easy_install pyzmq (comes with python xy)

Step 5: Edit gist.py
Comment on all these lines:

#from flask.ext.cache import Cache line 17 #from lib.MemcachedMultipart import multipartmemecached line 20 #cache = Cache(app, config=config) line 63 #@cache.cached(5*hours) line 92 #@cache.cached(5*hours) line 107 #@cache.cached(5*hours) line 112 #@cache.cached(5*hours) line 117 #@cache.cached(5*hours) line 122 #@cache.cached(5*hours) line 127 #@cache.cached(1*minutes) line 133 #@cache.memoize() line 177 #@cache.memoize(10*minutes) line 201 

Step6: Launch app.py
Step7: hit localhost: 5000

How to solve the problem with authentication? (laptops are in password protected repo mode)
ERROR: Request failed: GET http svn / BizIntel / Trunk / notebook.ipynb: 401 Authorization required

Answer: http-username: password@svn /BizIntel/Trunk/notebook.ipynb

enjoy it!

+6
source share
1 answer

Yes, nbviewer can be installed locally, which is usually how we develop it. Yon can use heroku foreman if you want the setup to be close to the startup hero on your own machine.

If you need something simple, just clone nbviewer, install the dependencies in requirements.txt and run python app.py (perhaps a submodule for git update . There may be several environement variables to set as memcached, but you should be able to disable it.

Then you can open a browser on localhost: 5000, and you should have your own version of nbviewer running locally.

It will not eliminate the need to access the ipynb file through a local url to work, but if it is installed behind the company’s firewall, this should not be a problem.

Feel free to open issues on github if necessary.

+9
source

Source: https://habr.com/ru/post/944404/


All Articles