pythonjsonlogger.utils
🔗
Utilities for Python JSON Logger
package_is_available
🔗
package_is_available(
name: str,
*,
throw_error: bool = False,
extras_name: str | None = None
) -> bool
Determine if the given package is available for import.
PARAMETER | DESCRIPTION |
---|---|
name |
Import name of the package to check.
TYPE:
|
throw_error |
Throw an error if the package is unavailable.
TYPE:
|
extras_name |
Extra dependency name to use in
TYPE:
|
RAISES | DESCRIPTION |
---|---|
MissingPackageError
|
When |
RETURNS | DESCRIPTION |
---|---|
bool
|
If the package is available for import. |