I'd like a search function function inside Domo Jupyter Workspace. I'm constantly looking for code snippets I recently created that I want to reused but can't find.
Assume you recently wrote an append routine and want to find that code? You want to search for all ipynb files to find code that contains the word "append".
I can do this in my own folder with downloaded files.
Example:
import os
search_string = 'append'
directory = 'C:\Disaster Recovery'
for root, dirs, files in os.walk(directory):
for file in files:
if file.endswith('.ipynb'):
filepath = os.path.join(root, file)
with open(filepath, 'r', encoding='utf-8') as f:
content = f.read()
if search_string in content:
print(f"Found '{search_string}' in {filepath}")
But I'd like to do it directly in Jupyter. There is currently a search for a file, but I want to search inside the files.