--- id: shellingham version: "1.5.4" license: ISC License license_treatment: permissive maintenance: active --- # shellingham — Tool to Detect Surrounding Shell License: permissive · Maintenance: active · Popularity: top 1,000 on PyPI ## Install pip install shellingham uv add shellingham poetry add shellingham ## Description ============================================= Shellingham: Tool to Detect Surrounding Shell ============================================= .. image:: https://img.shields.io/pypi/v/shellingham.svg :target: https://pypi.org/project/shellingham/ Shellingham detects what shell the current Python executable is running in. Usage ===== .. code-block:: python >>> import shellingham >>> shellingham.detect_shell() ('bash', '/bin/bash') ``detect_shell`` pokes around the process's running environment to determine what shell it is run in. It returns a 2-tuple: * The shell name, always lowercased. * The command used to run the shell. ``ShellDetectionFailure`` is raised if ``detect_shell`` fails to detect the surrounding shell. Notes ===== * The shell name is always lowercased. * On Windows, the shell name is the name of the executable, minus the file extension. Notes for Application Developers ================================ Remember, your application's user is not necessarily using a shell. Shellingham raises ``ShellDetectionFailure`` if there is no shell to detect, but *your application should almost never do this to your user*. A practical approach to... ## AI interpretation — verify before relying Shellingham detects which shell the current Python process is running in and returns both the shell name and its command path. It raises ShellDetectionFailure if no shell is detected. Verdict: A lightweight, zero-dependency utility for shell detection with a clean API and permissive license. Active maintenance, broad Python version support, and no known vulnerabilities make it a reliable choice for tools that need to identify the user's shell environment. [View on SkillFed](https://skillfed.io/packages/shellingham) · [View on PyPI](https://pypi.org/project/shellingham/)