Running notebooks with parameters¶
Currently, parameters passed in the ARGUMENTS string are parsed into the sys.argv list using whitespace as the delimiter.
Example: Execute a notebook project with parameters¶
The following example passes two arguments (env and prod) using ARGUMENTS = ‘env prod’.
The first element (sys.argv[0]) is the notebook filename, followed by the space-separated arguments.
View all arguments¶
To inspect the full list of parameters passed to the session, use the sys module.
Output example:
Print each argument¶
To process or log each parameter individually, loop through the sys.argv list.
Output example:
Access a specific argument¶
Parameters are accessed by their index in the list. Because sys.argv[0] is the notebook name, the first user parameter starts at index[1].
Output example:
For full syntax and parameter details, see EXECUTE NOTEBOOK PROJECT.