Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 15 additions & 0 deletions code_data_science/yaml_recipe.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
from IPython.display import display as ipython_display
import base64


def display(yaml_recipe:str):
"""
Converts YAML recipe as a string to a format that can be visualized as a code snippet.
"""

# Create the output dictionary
ipython_display({
"application/vnd.moderne.yamlrecipe": {
"code": base64.b64encode(yaml_recipe)
}
}, raw=True)