Skip to main content

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.

Metadata

Release files for detect-installer 0.2.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for detect-installer 0.2.1
File Size Uploaded Provenance Actions
detect_installer-0.2.1.tar.gz 3.6 kB Without provenance Details for detect_installer-0.2.1.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for detect-installer 0.2.1
File Interpreter ABI Platform Actions
detect_installer-0.2.1-py3-none-any.whl Python 3 none any Details for detect_installer-0.2.1-py3-none-any.whl

Total release size: 9.0 kB

Release files / detect_installer-0.2.1.tar.gz

Download URL detect_installer-0.2.1.tar.gz
Size 3.6 kB
Tags Source
SHA-256 checksum
How to use checksums
85f889d4d19c1caf5bef89ef389eb920cd8c6c2a868e1eeceec24527b93021e7
BLAKE2b-256 checksum
How to use checksums
cdeb77b0cc7fc0235b0495b32410edebe14cf6757b826135a7f92bb0f5d843b9
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.12.9 {"installer":{"name":"uv","version":"0.12.9","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Release files / detect_installer-0.2.1-py3-none-any.whl

Download URL detect_installer-0.2.1-py3-none-any.whl
Size 5.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
87e2ce7d05cb108b178f8e45bb80d3d88c0cb4b397983345c18ad6562e02e620
BLAKE2b-256 checksum
How to use checksums
61fea245e1d579e7abf47208f7c1ce5684caa2cd956ede5ff646d66d0299d9e8
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.12.9 {"installer":{"name":"uv","version":"0.12.9","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Security for detect-installer 0.2.1

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page