Skip to main content

Utilities to identify which environments is your python script running within.

Project description

travis sonar_quality sonar_maintainability sonar_coverage Maintainability pip

Utilities to identify which environments is your python script running within.

How do I get this?

As usual, just run pip:

pip install environments_utils

is_tmux

Return a boolean representing if script is running within a TMUX-like terminal.

from environments_utils import is_tmux

if not is_tmux():
    print("This script is long running, consider starting it within a TMUX-like terminal.")

is_notebook

Return a boolean representing if script is running within a jupyter notebook.

from environments_utils import is_notebook
from tqdm import tqdm_notebook, tqdm as tqdm_cli

tqdm = tqdm_notebook if is_notebook() else tqdm_cli

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page