# Python SDK

The Python SDK can be used for programmatically creating projects and uploading data to them.

{% hint style="info" %}
We recommend using the UI to create projects as part of a normal workflow. This will provide the best experience and most options for project setup. For more information see [Projects](https://github.com/dbnlAI/docs/blob/main/reference/workflow/projects.md).
{% endhint %}

See [SDK Log Ingestion](https://github.com/dbnlAI/docs/blob/main/reference/configuration/data-connections/sdk-log-ingestion.md) for more information and examples on using the SDK to upload log data to your deployment.

## Installation

To install the latest SDK, run:

```shell
pip install --upgrade dbnl
```

## SDK Functions

* [`convert_otlp_traces_data()`](/reference/python-sdk/sdk-functions.md#convert_otlp_traces_data)
* [`create_filter()`](/reference/python-sdk/sdk-functions.md#create_filter)
* [`create_llm_model()`](/reference/python-sdk/sdk-functions.md#create_llm_model)
* [`create_metric()`](/reference/python-sdk/sdk-functions.md#create_metric)
* [`create_project()`](/reference/python-sdk/sdk-functions.md#create_project)
* [`delete_filter()`](/reference/python-sdk/sdk-functions.md#delete_filter)
* [`delete_llm_model()`](/reference/python-sdk/sdk-functions.md#delete_llm_model)
* [`delete_metric()`](/reference/python-sdk/sdk-functions.md#delete_metric)
* [`flatten_otlp_traces_data()`](/reference/python-sdk/sdk-functions.md#flatten_otlp_traces_data)
* [`get_filter()`](/reference/python-sdk/sdk-functions.md#get_filter)
* [`get_llm_model()`](/reference/python-sdk/sdk-functions.md#get_llm_model)
* [`get_metric()`](/reference/python-sdk/sdk-functions.md#get_metric)
* [`get_or_create_filter()`](/reference/python-sdk/sdk-functions.md#get_or_create_filter)
* [`get_or_create_llm_model()`](/reference/python-sdk/sdk-functions.md#get_or_create_llm_model)
* [`get_or_create_metric()`](/reference/python-sdk/sdk-functions.md#get_or_create_metric)
* [`get_or_create_project()`](/reference/python-sdk/sdk-functions.md#get_or_create_project)
* [`get_project()`](/reference/python-sdk/sdk-functions.md#get_project)
* [`init_tracing()`](/reference/python-sdk/sdk-functions.md#init_tracing)
* [`log()`](/reference/python-sdk/sdk-functions.md#log)
* [`login()`](/reference/python-sdk/sdk-functions.md#login)
* [`update_filter()`](/reference/python-sdk/sdk-functions.md#update_filter)
* [`update_llm_model()`](/reference/python-sdk/sdk-functions.md#update_llm_model)
* [`update_metric()`](/reference/python-sdk/sdk-functions.md#update_metric)

## Classes

* [`LLMModel`](/reference/python-sdk/classes.md#LLMModel)
* [`Metric`](/reference/python-sdk/classes.md#Metric)
* [`Project`](/reference/python-sdk/classes.md#Project)


---

# 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.dbnl.com/reference/python-sdk.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.
