nbprint.config.outputs.NBConvertOutputs

pydantic model nbprint.config.outputs.NBConvertOutputs[source]

Bases: Outputs

Show JSON schema
{
   "title": "NBConvertOutputs",
   "type": "object",
   "properties": {
      "tags": {
         "items": {
            "type": "string"
         },
         "title": "Tags",
         "type": "array"
      },
      "role": {
         "$ref": "#/$defs/Role",
         "default": "outputs"
      },
      "ignore": {
         "default": true,
         "title": "Ignore",
         "type": "boolean"
      },
      "css": {
         "anyOf": [
            {
               "type": "string"
            },
            {
               "format": "path",
               "type": "string"
            },
            {
               "type": "null"
            }
         ],
         "default": "",
         "title": "Css"
      },
      "esm": {
         "anyOf": [
            {
               "type": "string"
            },
            {
               "format": "path",
               "type": "string"
            },
            {
               "type": "null"
            }
         ],
         "default": "",
         "title": "Esm"
      },
      "classname": {
         "anyOf": [
            {
               "type": "string"
            },
            {
               "items": {
                  "type": "string"
               },
               "type": "array"
            },
            {
               "type": "null"
            }
         ],
         "default": "",
         "title": "Classname"
      },
      "attrs": {
         "anyOf": [
            {
               "additionalProperties": {
                  "type": "string"
               },
               "type": "object"
            },
            {
               "type": "null"
            }
         ],
         "title": "Attrs"
      },
      "root": {
         "default": "/home/runner/work/nbprint/nbprint/outputs",
         "format": "path",
         "title": "Root",
         "type": "string"
      },
      "naming": {
         "default": "{{name}}-{{date}}",
         "title": "Naming",
         "type": "string"
      },
      "embedded": {
         "default": false,
         "description": "Whether this output is expected to run from its embedding inside the notebook.",
         "title": "Embedded",
         "type": "boolean"
      },
      "hook": {
         "default": null,
         "title": "Hook"
      },
      "postprocess": {
         "default": null,
         "title": "Postprocess"
      },
      "target": {
         "anyOf": [
            {
               "enum": [
                  "ipynb",
                  "notebook",
                  "html",
                  "webhtml",
                  "pdf",
                  "webpdf"
               ],
               "type": "string"
            },
            {
               "type": "null"
            }
         ],
         "default": "html",
         "title": "Target"
      },
      "execute": {
         "anyOf": [
            {
               "type": "boolean"
            },
            {
               "type": "null"
            }
         ],
         "default": true,
         "title": "Execute"
      },
      "timeout": {
         "anyOf": [
            {
               "type": "integer"
            },
            {
               "type": "null"
            }
         ],
         "default": 600,
         "title": "Timeout"
      },
      "template": {
         "anyOf": [
            {
               "type": "string"
            },
            {
               "type": "null"
            }
         ],
         "default": "nbprint",
         "title": "Template"
      },
      "collect_outputs": {
         "default": false,
         "description": "Whether to collect cell outputs into the context. Cells with tag `nbprint:output:<key>` will be collected under `<key>`.",
         "title": "Collect Outputs",
         "type": "boolean"
      },
      "execute_hook": {
         "default": null,
         "title": "Execute Hook"
      },
      "nbconvert_hook": {
         "default": null,
         "title": "Nbconvert Hook"
      }
   },
   "$defs": {
      "Role": {
         "enum": [
            "undefined",
            "configuration",
            "context",
            "outputs",
            "parameters",
            "content",
            "page",
            "layout"
         ],
         "title": "Role",
         "type": "string"
      }
   }
}

Fields:
  • collect_outputs (bool)

  • execute (bool | None)

  • execute_hook (ccflow.exttypes.pyobjectpath.PyObjectPath | None)

  • nbconvert_hook (ccflow.exttypes.pyobjectpath.PyObjectPath | None)

  • target (Literal['ipynb', 'notebook', 'html', 'webhtml', 'pdf', 'webpdf'] | None)

  • template (str | None)

  • timeout (int | None)

field target: Literal['ipynb', 'notebook', 'html', 'webhtml', 'pdf', 'webpdf'] | None = 'html'
field execute: bool | None = True
field timeout: int | None = 600
field template: str | None = 'nbprint'
field collect_outputs: bool = False

Whether to collect cell outputs into the context. Cells with tag nbprint:output:<key> will be collected under <key>.

field execute_hook: PyObjectPath | None = None

A callable hook that is called after nbconvert execution of the notebook. It is passed the config instance. If it returns something non-None, that value is returned by run instead of the output path.NOTE: Parent/child class hooks may also be called.

field nbconvert_hook: PyObjectPath | None = None

A callable hook that is called after nbconvert of the previously executed notebook. It is passed the config instance. If it returns something non-None, that value is returned by run instead of the output path.NOTE: Parent/child class hooks may also be called.

property outputs: dict[int | str, list[dict[str, str]]]
NBConvertOutputs.validate_target[source]
run(config: Configuration, gen: NotebookNode) Path[source]
model_post_init(context: Any, /) None

This function is meant to behave like a BaseModel method to initialise private attributes.

It takes context as an argument since that’s what pydantic-core passes when calling it.

Parameters:
  • self – The BaseModel instance.

  • context – The context.