MCPcopy Create free account
hub / github.com/AgentOps-AI/agentops / convert_notebook_to_markdown

Function convert_notebook_to_markdown

examples/generate_documentation.py:42–55  ·  view source on GitHub ↗

Convert Jupyter notebook to markdown using jupyter nbconvert.

(notebook_path)

Source from the content-addressed store, hash-verified

40
41
42def convert_notebook_to_markdown(notebook_path):
43 """Convert Jupyter notebook to markdown using jupyter nbconvert."""
44 try:
45 result = subprocess.run(
46 ["jupyter", "nbconvert", "--to", "markdown", "--stdout", notebook_path],
47 capture_output=True,
48 text=True,
49 check=True,
50 )
51 return result.stdout
52 except subprocess.CalledProcessError as e:
53 sys.exit(f"Error: Failed to convert notebook: {e}\nstderr: {e.stderr}")
54 except FileNotFoundError:
55 sys.exit("Error: jupyter nbconvert not found. Please install jupyter: pip install jupyter")
56
57
58def process_pip_installations(markdown_content):

Callers 1

mainFunction · 0.85

Calls 1

runMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…