> ## Documentation Index
> Fetch the complete documentation index at: https://clumio.reclear.io/llms.txt
> Use this file to discover all available pages before exploring further.

# Use the Python SDK

> Object-oriented Python client for Clumio policies, protection groups, discovery and restores.

The `clumio-python-sdk` package wraps the Clumio REST API in an object-oriented client. Resources are
exposed as properties on the client, and operations are invoked on the resource.

## Install

```bash theme={null}
pip install 'git+https://github.com/clumio-code/clumio-python-sdk.git@<version>#egg=clumioapi'
```

Requires Python 3.9 or later. The repository README documents installation from GitHub rather than
PyPI.

## Authenticate

```python theme={null}
from clumioapi import configuration, clumioapi_client

config = configuration.Configuration(
    api_token="<your_api_token>",
    hostname="us-west-2.api.clumio.com",
)

client = clumioapi_client.ClumioAPIClient(config=config)
```

`hostname` must match the control plane that issued the token. See
[Authentication](/developer-tools/authentication).

## Use it

Resources are available as properties. Operations are versioned, which is why the suffix appears in
the accessor:

```python theme={null}
policy_defn = client.policy_definitions_v1.list_policy_definitions()
```

<AccordionGroup>
  <Accordion title="Common resources">
    | Property                         | Covers                                            |
    | -------------------------------- | ------------------------------------------------- |
    | `client.policy_definitions_v1`   | Create, list and update backup policy definitions |
    | `client.protection_groups_v1`    | Protection groups and their rules                 |
    | `client.aws_connections_v1`      | AWS account connections                           |
    | `client.organizational_units_v1` | Organisational units                              |
    | `client.restored_files_v1`       | File-level restores                               |
    | `client.users_v1`                | Users and roles                                   |
  </Accordion>

  <Accordion title="List operations are paginated">
    Each resource has a `<resource>_paginator` property that follows the API's `_links.next` chain.
    The standard controller returns one page and accepts `limit` and `start` when you need to manage
    paging directly.
  </Accordion>

  <Accordion title="Errors">
    API errors raise an exception carrying the HTTP status and API error body. Log both when diagnosing
    a failed request.
  </Accordion>
</AccordionGroup>

## Next

<CardGroup cols={2}>
  <Card title="REST API reference" icon="square-terminal" href="https://api.commvault.com/docs/latest/api/cv/ClumioAPIs/clumio-rest-api/" arrow>
    The endpoint-level reference behind every SDK method.
  </Card>

  <Card title="Source and issues" icon="github" href="https://github.com/clumio-code/clumio-python-sdk" arrow>
    Read the code, report a bug, or open a pull request.
  </Card>
</CardGroup>
