<jupyter_start><jupyter_text>exploratoryprogramming> nbdev 'Hello World!' example<jupyter_code>#hide
from nbdev.showdoc import *<jupyter_output><empty_output><jupyter_text>Add a new function<jupyter_code>#export
def say_hello(to):
    "Say hello to somebody"
    return f'Hello {to}!'<jupyter_output><empty_output><jupyter_text>Add some examples and testsHere is an example of the function use:<jupyter_code>say_hello("David")<jupyter_output><empty_output><jupyter_text>Examples can also include plots, images, etc.<jupyter_code>from IPython.display import display,SVG
display(SVG('<svg height="100"><circle cx="50" cy="50" r="40"/></svg>'))<jupyter_output><empty_output><jupyter_text>Then we can add tests for the function:<jupyter_code>assert say_hello("David") == "Hello David!"
assert say_hello("David") != "Hello Diana!"<jupyter_output><empty_output><jupyter_text>Add a classTo be done at a later date<jupyter_code>from nbdev.export import *
notebook2script()<jupyter_output>Converted 00_core.ipynb.
Converted index.ipynb.
{'fraction_non_alphanumeric': 0.12560856864654332, 'fraction_numerical': 0.011684518013631937, 'mean_word_length': 9.821052631578947, 'pattern_counts': {'":': 0, '<': 27, '<?xml version=': 0, '>': 28, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '6', 'dir': 'jupyter-structured-clean-dedup', 'id': '626326', 'license': 'Apache-2.0', 'n_tokens_mistral': 381, 'n_tokens_neox': 368, 'n_words': 74, 'path': '00_core.ipynb', 'repo_name': 'Dgtlnetwks/ExploratoryProgramming', 'size': '1027'}