Skip to main content

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

Project description

Travis CI build SonarCloud Quality SonarCloud Maintainability Codacy Maintainability Maintainability Pypi project Pypi total project downloads

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

How do I install this package?

As usual, just download it using pip:

pip install environments_utils

Tests Coverage

Since some software handling coverages sometime get slightly different results, here’s three of them:

Coveralls Coverage SonarCloud Coverage Code Climate Coverate

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

Operative system identifiers

Utilities to identify the operative system running the app.

from environments_utils import is_macos, is_windows, is_linux

if is_macos():
    print("The OS is macOS")

if is_windows():
    print("The OS is Windows")

if is_linux():
    print("The OS is Linux")

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

environments_utils-1.0.3.tar.gz (3.5 kB view details)

Uploaded Source

File details

Details for the file environments_utils-1.0.3.tar.gz.

File metadata

  • Download URL: environments_utils-1.0.3.tar.gz
  • Upload date:
  • Size: 3.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.24.0 setuptools/45.2.0.post20200210 requests-toolbelt/0.9.1 tqdm/4.60.0 CPython/3.7.6

File hashes

Hashes for environments_utils-1.0.3.tar.gz
Algorithm Hash digest
SHA256 2bca30f5e26ad872f168c17119065b58bb3cc4e4339ae4048e7273f68706db74
MD5 84ebd2f59106db339b8ae45253debe47
BLAKE2b-256 a4147bb0736e922d12f6ce90b908450f5897ac2eefd8128336f47ee05237896b

See more details on using hashes here.

Provenance

Supported by

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