# general

Python API: `hubai_sdk.utils.general`

## Functions

| Name | Description |
| --- | --- |
| [`is_cli_call`](https://docs.luxonis.com/cloud/hubai/model-registry/hubai-sdk/hubai-sdk-api-reference/utils/general.md) | Return
whether the current process is running via the CLI. |
| [`is_pip_package`](https://docs.luxonis.com/cloud/hubai/model-registry/hubai-sdk/hubai-sdk-api-reference/utils/general.md) |
Determine if the file at the given filepath is part of a pip package. |
| [`sanitize_net_name`](https://docs.luxonis.com/cloud/hubai/model-registry/hubai-sdk/hubai-sdk-api-reference/utils/general.md) |
Sanitize net name or path. If input is a path, only sanitize the basename. If input is a name, sanitize the whole string. Collapse
multiple underscores. |
|
[`significant_update_available`](https://docs.luxonis.com/cloud/hubai/model-registry/hubai-sdk/hubai-sdk-api-reference/utils/general.md)
| Return whether a newer version warrants notifying the user. |
| [`version_check`](https://docs.luxonis.com/cloud/hubai/model-registry/hubai-sdk/hubai-sdk-api-reference/utils/general.md) |
Check PyPI for a newer SDK version and exit on major/minor updates. |

### function `is_cli_call`

```python
def is_cli_call() -> bool
```

Return whether the current process is running via the CLI.

### function `is_pip_package`

```python
def is_pip_package(filepath: str = __name__) -> bool
```

Determine if the file at the given filepath is part of a pip package.

Args

| Name | Type | Description | Default |
| --- | --- | --- | --- |
| `filepath` | `str` | The filepath to check. | `__name__` |

Returns

| Type | Description |
| --- | --- |
| `bool` | Whether the file is part of an installed package. |

### function `sanitize_net_name`

```python
def sanitize_net_name(name: str, with_suffix: bool = False) -> str
```

Sanitize net name or path. If input is a path, only sanitize the basename. If input is a name, sanitize the whole string. Collapse
multiple underscores.

Args

| Name | Type | Description | Default |
| --- | --- | --- | --- |
| `name` | `str` | The name or path to sanitize. | required |
| `with_suffix` | `bool` | Whether to preserve the suffix (file extension) without sanitizing it. | `False` |

Returns

| Type | Description |
| --- | --- |
| `str` |  |

### function `significant_update_available`

```python
def significant_update_available(cur: Version, new: Version) -> bool
```

Return whether a newer version warrants notifying the user.

### function `version_check`

```python
def version_check(current_version: str)
```

Check PyPI for a newer SDK version and exit on major/minor updates.

## Module Attributes

| Name | Type | Description |
| --- | --- | --- |
| [`PYPI_URL`](https://docs.luxonis.com/cloud/hubai/model-registry/hubai-sdk/hubai-sdk-api-reference/utils/general.md) | `str` | |

### constant `PYPI_URL`

```python
PYPI_URL: str = 'https://pypi.org/pypi/hubai-sdk/json'
```
