ipypublish.convert.main module

class ipypublish.convert.main.IpyPubMain(*args, **kwargs)[source]

Bases: traitlets.config.configurable.Configurable

conversion

A trait for unicode strings.

default_exporter_config

An instance of a Python dict.

default_ppconfig_kwargs

An instance of a Python dict.

default_pporder_kwargs

An instance of a Python dict.

export_notebook(final_nb, exporter_cls, config, jinja_template)[source]
files_folder_placeholder

A trait for unicode strings.

folder_suffix

A trait for unicode strings.

ignore_prefix

A trait for unicode strings.

log_file_formatstr

A trait for unicode strings.

log_file_path

A trait for unicode strings.

log_level_file

An enum whose value must be in a given sequence.

log_level_stdout

An enum whose value must be in a given sequence.

log_stdout_formatstr

A trait for unicode strings.

log_to_file

A boolean (True, False) trait.

log_to_stdout

A boolean (True, False) trait.

property logger
meta_path_placeholder

A trait for unicode strings.

outpath

A trait type representing a Union type.

plugin_folder_paths

An instance of a Python set.

pre_conversion_funcs

An instance of a Python dict.

publish(ipynb_path, nb_node=None)[source]

convert one or more Jupyter notebooks to a published format

paths can be string of an existing file or folder, or a pathlib.Path like object

all files linked in the documents are placed into a single files_folder

Parameters
Returns

outdata – containing keys; “outpath”, “exporter”, “stream”, “main_filepath”, “resources”

Return type

dict

validate_nb_metadata

A boolean (True, False) trait.

ipypublish.convert.main.dict_to_config(config, unflatten=True, key_as_tuple=False)[source]
ipypublish.convert.main.replace_placeholders(mapping, replacements)[source]

recurse through a mapping and perform (in-place) string replacements

Parameters
  • mapping – any object which has an items() attribute

  • replacements (dict) – {placeholder: replacement}