> ## Documentation Index
> Fetch the complete documentation index at: https://docs.delfinance.com.br/llms.txt
> Use this file to discover all available pages before exploring further.

# Python SDK

> Instale e configure o SDK oficial da Delfinance para Python.

## Instalação

<CodeGroup>
  ```bash pip theme={null}
  pip install Delfinance-api-sdk
  ```

  ```bash poetry theme={null}
  poetry add Delfinance-api-sdk
  ```
</CodeGroup>

Requer Python 3.8 ou superior.

## Configuração inicial

```python theme={null}
from Delfinance import Delfinance
import os

client = Delfinance(
    environment="sandbox",  # ou "production"
    client_id=os.getenv("DELFINANCE_CLIENT_ID"),
    client_secret=os.getenv("DELFINANCE_CLIENT_SECRET"),
    cert_path="./certificado.crt",
    key_path="./chave-privada.key"
)
```

| Parâmetro       | Tipo  | Descrição                                |
| --------------- | ----- | ---------------------------------------- |
| `environment`   | `str` | `"sandbox"` ou `"production"`            |
| `client_id`     | `str` | API key do Portal do Desenvolvedor       |
| `client_secret` | `str` | Client secret do Portal do Desenvolvedor |
| `cert_path`     | `str` | Caminho para o certificado mTLS (`.crt`) |
| `key_path`      | `str` | Caminho para a chave privada (`.key`)    |

## Publicado em

<Card title="PyPI — Delfinance-api-sdk" icon="python" href="https://pypi.org/project/Delfinance-api-sdk/">
  Veja versões, changelog e dependências no PyPI.
</Card>
