Config file and command line options

Contents

Config file and command line options#

Jupyter nbclient can be run with a variety of command line arguments. A list of available options can be found below in the options section.

Options#

This list of options can be generated by running the following and hitting enter:

$ jupyter execute --help-all
Application.log_datefmtUnicode

Default: '%Y-%m-%d %H:%M:%S'

The date format used by logging formatters for %(asctime)s

Application.log_formatUnicode

Default: '[%(name)s]%(highlevel)s %(message)s'

The Logging format template

Application.log_levelany of 0``|``10``|``20``|``30``|``40``|``50``|’DEBUG’|’INFO’|’WARN’|’ERROR’|’CRITICAL’``

Default: 30

Set the log level by value or name.

Application.logging_configDict

Default: {}

Configure additional log handlers.

The default stderr logs handler is configured by the log_level, log_datefmt and log_format settings.

This configuration can be used to configure additional handlers (e.g. to output the log to a file) or for finer control over the default handlers.

If provided this should be a logging configuration dictionary, for more information see: https://docs.python.org/3/library/logging.config.html#logging-config-dictschema

This dictionary is merged with the base logging configuration which defines the following:

  • A logging formatter intended for interactive use called console.

  • A logging handler that writes to stderr called console which uses the formatter console.

  • A logger with the name of this application set to DEBUG level.

This example adds a new handler that writes to a file:

c.Application.logging_config = {
    "handlers": {
        "file": {
            "class": "logging.FileHandler",
            "level": "DEBUG",
            "filename": "<path/to/file>",
        }
    },
    "loggers": {
        "<application-name>": {
            "level": "DEBUG",
            # NOTE: if you don't list the default "console"
            # handler here then it will be disabled
            "handlers": ["console", "file"],
        },
    },
}
Application.show_configBool

Default: False

Instead of starting the Application, dump configuration to stdout

Application.show_config_jsonBool

Default: False

Instead of starting the Application, dump configuration to stdout (as JSON)

JupyterApp.answer_yesBool

Default: False

Answer yes to any prompts.

JupyterApp.config_fileUnicode

Default: ''

Full path of a config file.

JupyterApp.config_file_nameUnicode

Default: ''

Specify a config file to load.

JupyterApp.generate_configBool

Default: False

Generate default config file.

JupyterApp.log_datefmtUnicode

Default: '%Y-%m-%d %H:%M:%S'

The date format used by logging formatters for %(asctime)s

JupyterApp.log_formatUnicode

Default: '[%(name)s]%(highlevel)s %(message)s'

The Logging format template

JupyterApp.log_levelany of 0``|``10``|``20``|``30``|``40``|``50``|’DEBUG’|’INFO’|’WARN’|’ERROR’|’CRITICAL’``

Default: 30

Set the log level by value or name.

JupyterApp.logging_configDict

Default: {}

Configure additional log handlers.

The default stderr logs handler is configured by the log_level, log_datefmt and log_format settings.

This configuration can be used to configure additional handlers (e.g. to output the log to a file) or for finer control over the default handlers.

If provided this should be a logging configuration dictionary, for more information see: https://docs.python.org/3/library/logging.config.html#logging-config-dictschema

This dictionary is merged with the base logging configuration which defines the following:

  • A logging formatter intended for interactive use called console.

  • A logging handler that writes to stderr called console which uses the formatter console.

  • A logger with the name of this application set to DEBUG level.

This example adds a new handler that writes to a file:

c.Application.logging_config = {
    "handlers": {
        "file": {
            "class": "logging.FileHandler",
            "level": "DEBUG",
            "filename": "<path/to/file>",
        }
    },
    "loggers": {
        "<application-name>": {
            "level": "DEBUG",
            # NOTE: if you don't list the default "console"
            # handler here then it will be disabled
            "handlers": ["console", "file"],
        },
    },
}
JupyterApp.show_configBool

Default: False

Instead of starting the Application, dump configuration to stdout

JupyterApp.show_config_jsonBool

Default: False

Instead of starting the Application, dump configuration to stdout (as JSON)

NbClientApp.allow_errorsBool

Default: False

When a cell raises an error the default behavior is that execution is stopped and a nbclient.exceptions.CellExecutionError is raised. If this flag is provided, errors are ignored and execution is continued until the end of the notebook.

NbClientApp.answer_yesBool

Default: False

Answer yes to any prompts.

NbClientApp.config_fileUnicode

Default: ''

Full path of a config file.

NbClientApp.config_file_nameUnicode

Default: ''

Specify a config file to load.

NbClientApp.generate_configBool

Default: False

Generate default config file.

NbClientApp.inplaceBool

Default: False

Default is execute notebook without writing the newly executed notebook. If this flag is provided, the newly generated notebook will overwrite the input notebook.

NbClientApp.kernel_nameUnicode

Default: ''

Name of kernel to use to execute the cells. If not set, use the kernel_spec embedded in the notebook.

NbClientApp.log_datefmtUnicode

Default: '%Y-%m-%d %H:%M:%S'

The date format used by logging formatters for %(asctime)s

NbClientApp.log_formatUnicode

Default: '[%(name)s]%(highlevel)s %(message)s'

The Logging format template

NbClientApp.log_levelany of 0``|``10``|``20``|``30``|``40``|``50``|’DEBUG’|’INFO’|’WARN’|’ERROR’|’CRITICAL’``

Default: 30

Set the log level by value or name.

NbClientApp.logging_configDict

Default: {}

Configure additional log handlers.

The default stderr logs handler is configured by the log_level, log_datefmt and log_format settings.

This configuration can be used to configure additional handlers (e.g. to output the log to a file) or for finer control over the default handlers.

If provided this should be a logging configuration dictionary, for more information see: https://docs.python.org/3/library/logging.config.html#logging-config-dictschema

This dictionary is merged with the base logging configuration which defines the following:

  • A logging formatter intended for interactive use called console.

  • A logging handler that writes to stderr called console which uses the formatter console.

  • A logger with the name of this application set to DEBUG level.

This example adds a new handler that writes to a file:

c.Application.logging_config = {
    "handlers": {
        "file": {
            "class": "logging.FileHandler",
            "level": "DEBUG",
            "filename": "<path/to/file>",
        }
    },
    "loggers": {
        "<application-name>": {
            "level": "DEBUG",
            # NOTE: if you don't list the default "console"
            # handler here then it will be disabled
            "handlers": ["console", "file"],
        },
    },
}
NbClientApp.notebooksList

Default: []

Path of notebooks to convert

NbClientApp.output_baseUnicode

Default: None

Write executed notebook to this file base name. Supports pattern replacements '{notebook_name}', the name of the input notebook file without extension. Note that output is always relative to the parent directory of the input notebook.

NbClientApp.show_configBool

Default: False

Instead of starting the Application, dump configuration to stdout

NbClientApp.show_config_jsonBool

Default: False

Instead of starting the Application, dump configuration to stdout (as JSON)

NbClientApp.skip_cells_with_tagUnicode

Default: 'skip-execution'

Name of the cell tag to use to denote a cell that should be skipped.

NbClientApp.startup_timeoutInt

Default: 60

The time to wait (in seconds) for the kernel to start. If kernel startup takes longer, a RuntimeError is raised.

NbClientApp.timeoutInt

Default: None

The time to wait (in seconds) for output from executions. If a cell execution takes longer, a TimeoutError is raised. -1 will disable the timeout.