> For the complete documentation index, see [llms.txt](https://developerdocs.instructure.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://developerdocs.instructure.com/services/dap/lib-index.md).

# Client Library

Access your organization’s Instructure data directly within your code.

The **Data Access Platform (DAP) Python Client Library** provides a convenient way to interact with DAP’s data resources. Designed for developers, data analysts, and IT admins, this library allows efficient access to datasets, enabling streamlined data queries, transformations, and integrations with other data tools.

Built on top of the [Query API](https://developerdocs.instructure.com/services/dap/query-api.md), DAP Library provides the following features:

* **Data Retrieval**: Supports both **snapshot** and **incremental** queries for up-to-date data access.
* **Multiple Output Formats**: Retrieves data in popular formats, including **CSV**, **TSV**, **JSONL**, and **Parquet**.
* **Automatic Authentication**: Simplifies OAuth-based access with built-in authentication using client credentials, requesting an access token restricted to each table it reads.
* **Discovery**: Lists the namespaces and tables the DAP API exposes, regardless of what an API key may read.
* **Synchronize to local databases**: Replicate data to supported SQL databases

Before using DAP Library, it is recommended to familiarize yourself with the [key concepts of DAP](https://developerdocs.instructure.com/services/dap/key-concepts.md).

## Configuration

The library needs three values, read from the environment or passed to `DAPClient`:

| Variable            | Purpose                                                                                                                                                                    |
| ------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `DAP_API_URL`       | Base URL of your [regional API Gateway](https://developerdocs.instructure.com/services/dap/dap-cli-readme/dap-cli-security.md#regional-api-base-url). Required, no default |
| `DAP_CLIENT_ID`     | Client ID from the [Instructure Identity Service](https://identity.instructure.com)                                                                                        |
| `DAP_CLIENT_SECRET` | Client secret for that key                                                                                                                                                 |

An API key is restricted to a set of tables it may read. See [Table access](https://developerdocs.instructure.com/services/dap/dap-cli-readme/dap-cli-security.md#table-access) for what that means in practice, and [Code examples](https://developerdocs.instructure.com/services/dap/lib-index/lib-examples.md#table-access) for the library-side detail.

## Requirements

* **Supported Operating Systems:** Ubuntu 22, Windows 11 (via [WSL](https://learn.microsoft.com/en-us/windows/wsl/)-based Python only), Windows Server 2022 (via [WSL](https://learn.microsoft.com/en-us/windows/wsl/)-based Python only), MacOS 14+
* **Supported Database Integrations:** PostgreSQL 16.3+, MySQL 8.2+, Microsoft SQL Server 2019+
* **Supported Python Versions:** Python 3.11+

## Download

Get the latest source code on [Pypi](https://pypi.org/project/instructure-dap-client/#files)

Or install it using pip

```sh
pip3 install "instructure-dap-client"
```

## Where To Get Help

<table data-card-size="large" data-view="cards"><thead><tr><th></th><th></th><th data-hidden data-card-target data-type="content-ref"></th></tr></thead><tbody><tr><td>DAP Community</td><td>Visit our forums to connect with the community and learn more about DAP.</td><td><a href="https://community.canvaslms.com/t5/Data-and-Analytics-Group/gh-p/data">https://community.canvaslms.com/t5/Data-and-Analytics-Group/gh-p/data</a></td></tr><tr><td>Support</td><td>To report bugs or request new features, open a ticket for our Support Team.</td><td><a href="mailto:canvasdatahelp@instructure.com">mailto:canvasdatahelp@instructure.com</a></td></tr></tbody></table>


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

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

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://developerdocs.instructure.com/services/dap/lib-index.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

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.
