Ejemplo n.º 1
0
    def test_notebook(self):
        src = os.path.join(os.pardir, 'examples',
                           'pythreejs test scenes.ipynb')
        fname = get_fname('pythreejs_test_scenes.html')

        NbConvertApp.launch_instance(
            argv=['--execute', '--to', 'html', '--output', fname, src])
def export_pdf(nbpath, template=None):
    from nbconvert.nbconvertapp import NbConvertApp
    if template is None:
        template = os.environ.get(ENV_VARS['export_pdf'],
                                  'hide_code_cells_pdf')
    NbConvertApp.launch_instance(
        [nbpath, '--template', template, '--to', 'pdf'])
def export_pdf(nbpath, template=None):
    from nbconvert.nbconvertapp import NbConvertApp

    if template is None:
        template = os.environ.get(ENV_VARS["export_pdf"],
                                  "hide_code_cells_pdf")
    NbConvertApp.launch_instance(
        [nbpath, "--template", template, "--to", "pdf"])
Ejemplo n.º 4
0
def run_quality_report(cik: str,
                       regen: bool = False,
                       convert_to_html: bool = False):
    nb_file = f'../notebooks/reports/{cik}.ipynb'
    if not regen and Path(nb_file).exists():
        logger.info(f"Notebook exists for {cik}. Skipping.")
        return

    pm.execute_notebook('resources/edgar_prelim_quality.ipynb',
                        nb_file,
                        parameters={'cik': cik})

    if convert_to_html:
        args = [
            "--Application.log_level=ERROR",
            "--TemplateExporter.exclude_input=True",
            "--output-dir=../out/notebooks", nb_file
        ]
        NbConvertApp.launch_instance(args)
Ejemplo n.º 5
0
def export_html(nbpath, template=_html_no_code_template):
    NbConvertApp.launch_instance([nbpath, '--template', template, '--to', 'html'])
Ejemplo n.º 6
0
def export_pdf(nbpath, template=_pdf_no_code_template):
    NbConvertApp.launch_instance([nbpath, '--template', template, '--to', 'pdf'])