# Chalk Python SDK Reference: URL Functions
source: https://docs.chalk.ai/api-docs#section-url-functions

## `url_extract_host(expr)`
source: https://docs.chalk.ai/api-docs#url_extract_host

Extract the host from a URL.

For example, the host of `https://www.google.com/cats` is `www.google.com`.

**Examples**

```python
import chalk.functions as F
from chalk.features import _, features
@features
class Company:
    id: int
    website: str
    host: str = F.url_extract_host(_.website)
```

## `url_extract_path(expr)`
source: https://docs.chalk.ai/api-docs#url_extract_path

Extract the path from a URL.

For example, the host of `https://www.google.com/cats` is `/cats`.

**Examples**

```python
import chalk.functions as F
from chalk.features import _, features
@features
class Company:
    id: int
    website: str
    path: str = F.url_extract_path(_.website)
```

## `url_extract_protocol(expr)`
source: https://docs.chalk.ai/api-docs#url_extract_protocol

Extract the protocol from a URL.

For example, the protocol of `https://www.google.com/cats` is `https`.

**Parameters**

- `expr`: `Any`
  The URL to extract the protocol from.

**Examples**

```python
import chalk.functions as F
from chalk.features import _, features
@features
class Company:
    id: int
    website: str
    protocol: str = F.url_extract_protocol(_.website)
```
