# Python API Example

**Example**: The following example show on how to read retrieve data where equipment type is 'CHASIS'

## Step 1: Import required library (CaaSClient) <a href="#step-1-import-required-library-caasclient" id="step-1-import-required-library-caasclient"></a>

```
from cfxdx.dataapi import CaaSClient
```

## Step 2: Credentials to connect to the system. <a href="#step-2-credentials-to-connect-to-the-system" id="step-2-credentials-to-connect-to-the-system"></a>

Use API keys to connect to the system

```
credentials = {   "login-method": "access-key",   "host": "hostname or ipaddress",   "access-key": "value for API-access-key",   "secret-key": "value for API-secret-key"}
```

**Step 3: Create CaaSClient object**

```
client = CaaSClient(credentials, page_size=500)
```

**Step 4**: **Connect to inventory API and execute (alternative API )**

```
inv = client.assetInventory()
```

## Step 5: **Get the number of rows in inventory table** <a href="#step-5-get-the-number-of-rows-in-inventory-table" id="step-5-get-the-number-of-rows-in-inventory-table"></a>

**Step 6: Get number of modules in inventory**

```
count = inv.count(cfxql_query="Equipment_Type is 'MODULE'")
```

**Step 7: Using Inventory API get all CHASSIS (return value is a pandas DataFrame object)**

```
df = inv.get_data(cfxql_query="Equipment_Type is 'CHASSIS'", max_rows=1000)
```

Now you can query the dataframe df using normal Pandas functions.
