# Loading Data

Load your data into Python to use it for SDV modeling. SDV supports many different types of data formats for import and export.

{% hint style="info" %}
**Don't have any data yet?** The SDV library contains many different demo datasets that you can use to get started. To learn more, see the [SDV Demo Data](https://docs.sdv.dev/sdv/multi-table-data/data-preparation/loading-data/demo-data) page.
{% endhint %}

## Local Data

If your data is already available as local files (on your own machine), load them into SDV using the functions below.

<table 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><a href="loading-data/csv"><strong>CSV Data</strong></a></td><td>Load multiple CSV files into Python.</td><td><a href="loading-data/csv">csv</a></td></tr><tr><td><a href="loading-data/excel"><strong>Excel Spreadsheet</strong></a></td><td>Load an entire Excel spreadsheet into Python.</td><td><a href="loading-data/excel">excel</a></td></tr></tbody></table>

## **❖** Connect to a database (AI Connectors)

{% hint style="info" %}
❖ **SDV Enterprise Bundle**. This feature is available as part of the **AI Connectors Bundle**, an optional add-on to SDV Enterprise. For more information, please visit the [AI Connectors Bundle](https://docs.sdv.dev/sdv/explore/sdv-bundles/ai-connectors) page.
{% endhint %}

If your data is available in a database, use our AI Connectors feature to directly import some data for SDV. Later you can use the same connector to export synthetic data into a new database.

<table data-view="cards"><thead><tr><th align="center"></th><th data-hidden data-card-target data-type="content-ref"></th><th data-hidden data-card-cover data-type="image">Cover image</th></tr></thead><tbody><tr><td align="center">❖ <a href="loading-data/alloydb"><strong>AlloyDB</strong></a></td><td><a href="loading-data/alloydb">alloydb</a></td><td><a href="https://1967107441-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FfNxEeZzl9uFiJ4Zf4BRZ%2Fuploads%2FkJ1bOR4AbOLLD1SkiFzg%2FAlloyDB.png?alt=media&#x26;token=cf944e36-a8d7-473f-9938-633d50a770fd">AlloyDB.png</a></td></tr><tr><td align="center">❖<a href="loading-data/bigquery"> <strong>BigQuery</strong></a></td><td><a href="loading-data/bigquery">bigquery</a></td><td><a href="https://1967107441-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FfNxEeZzl9uFiJ4Zf4BRZ%2Fuploads%2FuYpWlTYYH1CYOr07wzfG%2FBigQuery.png?alt=media&#x26;token=cd7b2e45-cd8b-4132-a06f-5518ce84f829">BigQuery.png</a></td></tr><tr><td align="center">❖ <a href="loading-data/mssql"><strong>MSSQL</strong></a></td><td><a href="loading-data/mssql">mssql</a></td><td><a href="https://1967107441-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FfNxEeZzl9uFiJ4Zf4BRZ%2Fuploads%2FPHBms1a4bQgSdGQKCAoJ%2FMSSQL.png?alt=media&#x26;token=a6f2021f-1cfa-4b09-9243-0173db44fc4a">MSSQL.png</a></td></tr><tr><td align="center">❖ <a href="loading-data/oracle"><strong>Oracle</strong></a></td><td><a href="loading-data/oracle">oracle</a></td><td><a href="https://1967107441-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FfNxEeZzl9uFiJ4Zf4BRZ%2Fuploads%2FZfj0JCHAUEh35s1qaTsk%2FOracle.png?alt=media&#x26;token=a8ba5d36-54ef-476c-9557-86a6ecf676f8">Oracle.png</a></td></tr><tr><td align="center">❖ <a href="loading-data/postgresql"><strong>PostgreSQL</strong></a></td><td><a href="loading-data/postgresql">postgresql</a></td><td><a href="https://1967107441-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FfNxEeZzl9uFiJ4Zf4BRZ%2Fuploads%2FaoQYOyetcdahpAvL3aAS%2FPostgreSQL.png?alt=media&#x26;token=4ad8e042-3ffd-4af7-98b4-584ac6191884">PostgreSQL.png</a></td></tr><tr><td align="center">❖ <a href="loading-data/spanner"><strong>Spanner</strong></a></td><td><a href="loading-data/spanner">spanner</a></td><td><a href="https://1967107441-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FfNxEeZzl9uFiJ4Zf4BRZ%2Fuploads%2FYlYJaZhTyVM24IriuOns%2FSpanner.png?alt=media&#x26;token=6f0a8473-7699-42fa-9783-358ee372bedf">Spanner.png</a></td></tr></tbody></table>

## Do you have data in other formats?

The SDV uses the [pandas library](https://pandas.pydata.org/) for data manipulation and synthesizing. If your data is in any other format, load it in as a [pandas.DataFrame](https://pandas.pydata.org/docs/reference/api/pandas.DataFrame.html) object to use in the SDV. For multi table data, make sure you format your data as a dictionary, mapping each table name to a different DataFrame object.

```python
multi_table_data = {
    'table_name_1': <pandas.DataFrame>,
    'table_name_2': <pandas.DataFrame>,
    ...
}
```

Pandas offers many methods to load in different types of data. For example: [SQL table](https://pandas.pydata.org/docs/reference/api/pandas.read_sql_table.html#pandas.read_sql_table) or  [JSON string](https://pandas.pydata.org/docs/reference/api/pandas.read_json.html#pandas.read_json).

```python
import pandas as pd

data_table_1 = pd.read_json('file://localhost/path/to/table_1.json')
data_table_2 = pd.read_json('file://localhost/path/to/table_2.json')
```

For more options, see the [pandas reference](https://pandas.pydata.org/docs/reference/io.html).


---

# 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.sdv.dev/sdv/multi-table-data/data-preparation/loading-data.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.
