nbless.helpers package

Submodules

nbless.helpers.get_stem module

nbless.helpers.get_stem.get_stem(input_name: str) → str[source]

nbless.helpers.read_file module

nbless.helpers.read_file.read_file(filename: str) → str[source]

nbless.helpers.write_file module

nbless.helpers.write_file.write_file(filename: str, contents: str) → None[source]

Writes contents to a file with a given filename :param filename: The name of the target file :param contents: The contents of the target file

Examples

>>> import tempfile
>>> outfile_path = tempfile.mkstemp()[1]
>>> write_file(outfile_path, "Test file contents")
>>> with open(outfile_path) as file:
...     file.read()
'Test file contents'

Module contents