nbqol.env.detect#

Functions

is_running_in_jupyter()

Check if code is running in a Jupyter environment.

is_running_in_vscode()

Check if code is running in Visual Studio Code.

is_running_in_vscode_jupyter()

Check if code is running in a Jupyter notebook within VS Code.

is_running_in_jupyter()[source]#

Check if code is running in a Jupyter environment.

This function checks if the code is running within an IPython kernel, which is the case for Jupyter notebooks and similar environments.

Returns:

True if running in Jupyter, False otherwise

Return type:

bool

Examples

>>> from nbqol import stylizer
>>> stylizer.is_running_in_jupyter()
True  # If running in Jupyter
False  # If running in a standard Python environment
is_running_in_vscode()[source]#

Check if code is running in Visual Studio Code.

This function checks environment variables to determine if the code is running within the Visual Studio Code environment.

Returns:

True if running in VS Code, False otherwise

Return type:

bool

Examples

>>> from nbqol import stylizer
>>> stylizer.is_running_in_vscode()
True  # If running in VS Code
False  # If running elsewhere
is_running_in_vscode_jupyter()[source]#

Check if code is running in a Jupyter notebook within VS Code.

This function combines checks for both Jupyter and VS Code to determine if the code is running in a Jupyter notebook specifically within VS Code.

Returns:

True if running in a VS Code Jupyter notebook, False otherwise

Return type:

bool

Examples

>>> from nbqol import stylizer
>>> stylizer.is_running_in_vscode_jupyter()
True  # If running in a VS Code Jupyter notebook
False  # If running elsewhere