nbprint.config.outputs.EmailOutputs

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

Bases: NBConvertOutputs

Show JSON schema
{
   "title": "EmailOutputs",
   "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",
                  "html",
                  "webhtml",
                  "pdf",
                  "webpdf"
               ],
               "type": "string"
            },
            {
               "type": "null"
            }
         ],
         "default": "ipynb",
         "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"
      },
      "body": {
         "anyOf": [
            {
               "type": "string"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "Body of the email, defaults to output name",
         "title": "Body"
      },
      "subject": {
         "anyOf": [
            {
               "type": "string"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "Subject of the email, defaults to output name",
         "title": "Subject"
      },
      "to": {
         "description": "Recipient email addresses",
         "items": {
            "type": "string"
         },
         "title": "To",
         "type": "array"
      },
      "from_": {
         "anyOf": [
            {
               "maxItems": 2,
               "minItems": 2,
               "prefixItems": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "string"
                  }
               ],
               "type": "array"
            },
            {
               "type": "string"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "Sender email address",
         "title": "From"
      },
      "cc": {
         "anyOf": [
            {
               "maxItems": 2,
               "minItems": 2,
               "prefixItems": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "string"
                  }
               ],
               "type": "array"
            },
            {
               "type": "string"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "CC email address",
         "title": "Cc"
      },
      "bcc": {
         "anyOf": [
            {
               "maxItems": 2,
               "minItems": 2,
               "prefixItems": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "string"
                  }
               ],
               "type": "array"
            },
            {
               "type": "string"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "BCC email address",
         "title": "Bcc"
      },
      "smtp": {
         "$ref": "#/$defs/SMTP"
      }
   },
   "$defs": {
      "Role": {
         "enum": [
            "undefined",
            "configuration",
            "context",
            "outputs",
            "parameters",
            "content",
            "page",
            "layout"
         ],
         "title": "Role",
         "type": "string"
      },
      "SMTP": {
         "additionalProperties": false,
         "properties": {
            "host": {
               "description": "SMTP server host",
               "title": "Host",
               "type": "string"
            },
            "port": {
               "anyOf": [
                  {
                     "type": "integer"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": 25,
               "description": "SMTP server port",
               "title": "Port"
            },
            "user": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "SMTP server username",
               "title": "User"
            },
            "password": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "SMTP server password",
               "title": "Password"
            },
            "tls": {
               "anyOf": [
                  {
                     "type": "boolean"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": false,
               "description": "Use TLS for SMTP connection",
               "title": "Tls"
            },
            "ssl": {
               "anyOf": [
                  {
                     "type": "boolean"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": false,
               "description": "Use SSL for SMTP connection",
               "title": "Ssl"
            },
            "timeout": {
               "anyOf": [
                  {
                     "type": "integer"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": 30,
               "description": "Timeout for SMTP connection in seconds",
               "title": "Timeout"
            }
         },
         "required": [
            "host"
         ],
         "title": "SMTP",
         "type": "object"
      }
   },
   "required": [
      "to",
      "smtp"
   ]
}

Fields:
  • bcc (tuple[str, str] | str | None)

  • body (str | None)

  • cc (tuple[str, str] | str | None)

  • from_ (tuple[str, str] | str | None)

  • postprocess (ccflow.exttypes.pyobjectpath.PyObjectPath)

  • smtp (Annotated[nbprint.config.outputs.email.SMTP, pydantic.functional_serializers.SerializeAsAny()])

  • subject (str | None)

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

  • to (Annotated[list[str], pydantic.functional_serializers.SerializeAsAny()])

field target: Literal['ipynb', 'html', 'webhtml', 'pdf', 'webpdf'] | None = 'ipynb'
field body: str | None = None

Body of the email, defaults to output name

field subject: str | None = None

Subject of the email, defaults to output name

field to: Annotated[list[str], SerializeAsAny()] [Required]

Recipient email addresses

field from_: tuple[str, str] | str | None = None

Sender email address

field cc: tuple[str, str] | str | None = None

CC email address

field bcc: tuple[str, str] | str | None = None

BCC email address

field smtp: Annotated[SMTP, SerializeAsAny()] [Required]
field postprocess: PyObjectPath = 'nbprint.config.outputs.email.email_postprocess'

A callable hook that is called after all processing completes to email the results.

make_message(config: Configuration) Message[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.