# Python

### About

DeltaDeFi's Python SDK provides utility functions to interact with the API service and sign transactions with provided keys.

### Installation

The SDK is hosted on npmjs.com, so you can directly import it using your favorite package manager.

```python
pip3 install deltadefi
```

### Getting Started

Placing and canceling orders are as simple as below.

```python
import os

from deltadefi import ApiClient
from dotenv import load_dotenv

load_dotenv(".env", override=True)
api_key = os.environ.get("DELTADEFI_API_KEY")
password = os.environ.get("TRADING_PASSWORD")

api = ApiClient(api_key=api_key)
api.load_operation_key(password)
```

### Posting Order

```python
res = api.post_order(
    symbol="ADAUSDM",
    side="sell",
    type="limit",
    quantity=51,
    price=15,
)

print("Order submitted successfully.", res)
```

### Detailed SDK demo

<https://github.com/deltadefi-protocol/sdks-demo/tree/main/python>


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.deltadefi.io/start-trading/developers/sdks/python.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
