Asynchronous API
This section details the asynchronous components of the pipmaster library, primarily found within the pipmaster.async_package_manager module.
Asynchronous Package Manager using pip with enhanced visual feedback.
Provides async class and functions with ASCIIColors status indicators.
Author: ParisNeo Created: 23/04/2025 Last Updated: 13/02/2026
- class pipmaster.async_package_manager.AsyncPackageManager(python_executable: str | None = None, pip_command_base: List[str] | None = None, venv_path: str | None = None)[source]
Bases:
objectManages Python package installations and queries using pip asynchronously. Enhanced with ASCIIColors visual feedback.
- async install(package: str, index_url: str | None = None, force_reinstall: bool = False, upgrade: bool = True, extra_args: List[str] | None = None, dry_run: bool = False, verbose: bool = False) bool[source]
Async install with visual feedback.
- async install_if_missing(package: str, version_specifier: str | None = None, always_update: bool = False, index_url: str | None = None, extra_args: List[str] | None = None, dry_run: bool = False, verbose: bool = False) bool[source]
Async conditional install with visual feedback.
- async ensure_packages(requirements: str | Dict[str, str | None] | List[str], index_url: str | None = None, extra_args: List[str] | None = None, dry_run: bool = False, verbose: bool = False) bool[source]
Async ensure with pleasant batch feedback.
- async ensure_requirements(requirements_file: str, dry_run: bool = False, verbose: bool = False) bool[source]
Async requirements.txt processing.
- async install_multiple(packages: List[str], index_url: str | None = None, force_reinstall: bool = False, upgrade: bool = True, extra_args: List[str] | None = None, dry_run: bool = False, verbose: bool = False) bool[source]
Async batch install with progress feedback.
- async uninstall(package: str, extra_args: List[str] | None = None, dry_run: bool = False, verbose: bool = False) bool[source]
Async uninstall with visual feedback.
- async pipmaster.async_package_manager.async_install(package: str, **kwargs: Any) bool[source]
Installs a single package asynchronously.
- async pipmaster.async_package_manager.async_install_if_missing(package: str, **kwargs: Any) bool[source]
Conditionally installs a single package asynchronously.
- async pipmaster.async_package_manager.async_ensure_packages(requirements: str | Dict[str, str | None] | List[str], **kwargs: Any) bool[source]
Ensures a set of requirements are met asynchronously.
- async pipmaster.async_package_manager.async_ensure_requirements(requirements_file: str, **kwargs: Any) bool[source]
Ensures requirements from a file are met asynchronously.
- async pipmaster.async_package_manager.async_install_multiple(packages: List[str], **kwargs: Any) bool[source]
Installs multiple packages asynchronously.
- async pipmaster.async_package_manager.async_uninstall(package: str, **kwargs: Any) bool[source]
Uninstalls a single package asynchronously.
- async pipmaster.async_package_manager.async_uninstall_multiple(packages: List[str], **kwargs: Any) bool[source]
Uninstalls multiple packages asynchronously.
- async pipmaster.async_package_manager.async_get_package_info(package_name: str) str | None[source]
Gets package details asynchronously.
- async pipmaster.async_package_manager.async_check_vulnerabilities(**kwargs: Any) Tuple[bool, str][source]
Checks for vulnerabilities asynchronously.
- pipmaster.async_package_manager.get_async_pip_manager_for_version(target_python_version: str, venv_path: str) AsyncPackageManager[source]
Creates an AsyncPackageManager targeting a specific portable Python version.
Note
Similar to the synchronous API, async functions like async_install are exposed at the top level (e.g., pipmaster.async_install) as convenience wrappers around a default AsyncPackageManager instance.
Warning
Functions for checking package status (is_installed(), get_installed_version(), is_version_compatible()) do not have direct async counterparts as they rely on the synchronous importlib.metadata library. See the Asynchronous Operations guide for strategies on using them in async code.