Python API reference


The nbreport.compute module supports running Jupyter notebooks to compute output cells.


compute_notebook_file(path[, as_version]) Compute an ipynb notebook file and save it in place.
compute_notebook(notebook[, dirname, …]) Compute a notebook object.


The nbreport.processing module provides internal helpers for the command line apps.


is_url(path_or_url) Test if the token represents a URL or a local path.
create_instance(report_repo[, instance_id, …]) Create a report instance.


The nbreport.repo module provides APIs for managing report repositories.


ReportRepo(dirname) Report repository.
ReportConfig(path[, data]) Configuration for a report repository or instance (the nbreport.yaml file).


The nbreport.templating module provides APIs for rendering templated cells in Jupyter notebooks.

Each cell in a notebook has a source member. This source is what a user edits in the Jupyter notebook, be it a Markdown cell or a code (Python) cell. nbreport treats each cell’s source as a Jinja template.


render_notebook(notebook, context, jinja_env) Render the Jinja-templated cells of a notebook.
render_cell(cell, context, jinja_env) Render the Jinja-templated source of a single notebook cell.
load_template_environment([context_path, …]) Load the context (cookiecutter.json) and Jinja template environment.


The nbreport.userconfig module provides interfaces to the ~/.nbreport.yaml file, which is used to store GitHub credentials.


create_empty_config() Create an empty configuration object.
read_config([path]) Read an existing nbreport YAML-formatted configuration file.
get_config_path([path]) Get the path to the configuration file.
write_config(config[, path]) Write the configuration data to a YAML file
insert_github_config(config, username, token) Insert a github field into the configuration data with GitHub authentication information (username and personal access token).