Pass parameters to a notebook on jupyterhub/binderhub

Another snippet on this topic posted by @minrk on gitter earlier today:

Try: https://notebooks.gesis.org/binder/v2/gh/gesiscss/smm_demo/master?urlpath=%2Fnotebooks%2Fpython%2Fpolitician%2Ftwitter.ipynb%3Fparam%3Dvalue

filepath is okay, and usually better, because it encodes the location of the file within the repo, which binder then resolves to a url. This doesn’t, however, allow specifying url-specific things like params, so you have to fallback on urlpath if you want to do url things. Any and all url things should be supported, though. The url for a notebook is /notebooks/ not /tree/, and apparently the redirect from /tree to /notebooks doesn’t preserve params, which is why your link isn’t working.

2 Likes