Skip to main content

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

Project description

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.

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

detect_installer-0.1.0.tar.gz (3.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

detect_installer-0.1.0-py3-none-any.whl (4.5 kB view details)

Uploaded Python 3

File details

Details for the file detect_installer-0.1.0.tar.gz.

File metadata

  • Download URL: detect_installer-0.1.0.tar.gz
  • Upload date:
  • Size: 3.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.10.2 {"installer":{"name":"uv","version":"0.10.2","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for detect_installer-0.1.0.tar.gz
Algorithm Hash digest
SHA256 00ad7ba0a36e3cf7d08a40d3643011746dbc112597c7d475cc91c416710ca4e7
MD5 a4de183ce8236fa939f7e020ed2ab236
BLAKE2b-256 5fce6897d812825e9d4c53e3c7112726e800cc5231b013b2223bf64f653ff362

See more details on using hashes here.

File details

Details for the file detect_installer-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: detect_installer-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 4.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.10.2 {"installer":{"name":"uv","version":"0.10.2","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for detect_installer-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 034fb20fd665c36e6ba52b8821525ea07fb4f7f938cac459df889fb33801528a
MD5 855028fde820dfb8c3c02a02cf84edec
BLAKE2b-256 cc348cc73273414405086c58852916e4031812a6a30fe04c057e37ad99397b7f

See more details on using hashes here.

Supported by

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