Infrastructure as Code

Repositories with services as code

detect-installer (0.2.1)

Published 2026-09-17 00:04:05 +03:00 by mpavlov

Installation

pip install --index-url https://olssonul.com/api/packages/iac/pypi/simple/ --extra-index-url https://pypi.org/simple detect-installer

About this package

Detect how a Python package was installed and get the correct upgrade command

detect-installer

Detect how a Python package was installed and get the correct upgrade command.

Supports pip, uv (project and pip modes), uv tool, pipx, Homebrew, Conda, and Mamba.

Installation

pip install detect-installer

Usage

from detect_installer import detect_installer

info = detect_installer("rich")

if info is None:
    print("Package is not installed")
else:
    print(info.installer)    # e.g. Installer.PIP
    print(info.upgrade_cmd)  # e.g. "pip install -U rich"

Vendoring

This library has zero dependencies and is published under the 0BSD license, so you can copy src/detect_installer/_detect.py directly into your project if you'd prefer to avoid adding a dependency.

License

0BSD - free to use, copy, modify, and distribute with or without fee.

Requirements

Requires Python: >=3.10
Details
PyPI
2026-09-17 00:04:05 +03:00
26
Patrick Arminio
5.2 KiB
Assets (1)
Versions (1) View all
0.2.1 2026-09-17