# Quick Tip : Using NotebookUtils To Get Fabric Lakehouse Properties

Notebookutils in Fabric now has `getWithProperties()` method to get the properties of a lakehouse. Earlier the `get()` method only returned abfs path and not the SQL endpoint.

![](https://cdn.hashnode.com/res/hashnode/image/upload/v1724704429110/1ab93676-95f9-4236-8963-3fb97991a906.png align="center")

By default it returns the JSON:

```json
//sample output 

{'id': '<>',
 'type': 'Lakehouse',
 'displayName': '<name>',
 'description': '',
 'workspaceId': '<>',
 'properties': {'oneLakeTablesPath': 'https://onelake.dfs.fabric.microsoft.com/<>/<>/Tables',
  'oneLakeFilesPath': 'https://onelake.dfs.fabric.microsoft.com/<>/<>/Files',
  'sqlEndpointProperties': {'connectionString': '<>.datawarehouse.fabric.microsoft.com', 'id': '<>', 'provisioningStatus': 'Success'},
  'abfsPath': 'abfss://<>@onelake.dfs.fabric.microsoft.com/<>'}}
```

Below script normalizes the JSON to a pandas df:

```python
import pandas as pd
import sempy.fabric as fabric

def lakehouse_properties(lakehouse_name, workspace=None):
    """
    Sandeep Pawar | fabric.guru
    Returns properties of a lakehouse as a pandas df.
    Default workspace is used if workspace is None.
    
    """
    workspace = fabric.resolve_workspace_id(workspace) or fabric.get_workspace_id()
    
    # Get the Lakehouse data
    data = notebookutils.lakehouse.getWithProperties(name=lakehouse_name, workspaceId=workspace)
        
    flattened_data = {
        'lakehouse_id': data['id'],
        'type': data['type'],
        'lakehouse_name': data['displayName'],
        'description': data['description'],
        'workspaceId': data['workspaceId'],
        'oneLakeTablesPath': data['properties']['oneLakeTablesPath'],
        'oneLakeFilesPath': data['properties']['oneLakeFilesPath'],
        'abfsPath': data['properties']['abfsPath'],
        'sqlep_connectionString': data['properties']['sqlEndpointProperties']['connectionString'],
        'sqlep_id': data['properties']['sqlEndpointProperties']['id'],
        'sqlep_provisioningStatus': data['properties']['sqlEndpointProperties']['provisioningStatus']
    }
       
    df = pd.DataFrame([flattened_data])

    # Column order
    column_order = [
        'lakehouse_id', 'type', 'lakehouse_name', 'description', 'workspaceId',
        'oneLakeTablesPath', 'oneLakeFilesPath',
        'sqlep_connectionString',
        'sqlep_id',
        'sqlep_provisioningStatus',
        'abfsPath'
    ]
    df = df[column_order]

    return df

lakehouse_properties("<lakehouse_name>")
```

To get properties of all lakehouses in a workspace:

```python
df = pd.concat([lakehouse_properties(lh) for lh in fabric.list_items(type="Lakehouse")['Display Name']])
```

![](https://cdn.hashnode.com/res/hashnode/image/upload/v1724705068996/b43d203c-0264-4afb-a034-c07c84e38466.png align="center")
