Is it possible to search for notebooks in Jupyter hub.
Here is a piece of python code which I used to search by generating a json of ipynb notebook and link it to my proxy link,
'''
Task : To search for a particular notebook link in jupyter notebook
Author : Vigneshwer
Date : 14th July 2016
Version : 1.0
'''
#loading modules
import os
import fnmatch
import json
#search location and extension
dir_location = "./"
search_ext = "ipynb"
#proxy link
#list of ipython note book names
list_ipynb_name = {}
#searching for all files named .ipynb and saving in a json format
for root, dirs, files in os.walk(dir_location):
for file_name in files:
if fnmatch.fnmatch(file_name,"*."+search_ext):
list_ipynb_name[file_name.split(".")[0]] = proxy_link + str(root[len(dir_location):]) + "/" + str(file_name)
#saving to a json file
with open("ipynb_list.json", "w") as file_object:
file_object.write(json.dumps(list_ipynb_name,file_object,indent=4))
#loading from the json file
with open('ipynb_list.json') as data_file:
data = json.load(data_file)
#searching for a key in json file
search_query = raw_input("Enter the key to search for :-")
flag=False
for key in data.keys():
if search_query == key:
print "Ipython notebook link :- " + data[key]
flag=True
break
if not flag:
print "Ipython Notebook not found"
Other ideas would be appreciated, would like to also integrate the logic to jupyter hub with a UI for people to use, perhaps using elasticsearch or solr.