---
title: "get_data_sources"
description: "get_data_sources — the data sources of the open project."
url: "https://docs.justcat.it/reference/python-module/get-data-sources/"
---
# get_data_sources

## Signature

```python
cat.get_data_sources()
```

## Parameters

None.

## What it does

Returns the data sources CAT loaded when the project was opened — from the project file and from every data-source list the project points to. Nothing is connected; this is what the project *defines*.

## Returns

A .NET collection of `DataSourceDefinition` objects: `Name`, `ProviderTypeAndVersion` (for example `SqlServer@2`), `ConnectionString` (with environment variables already expanded), `Settings`, `DataSourceListID`, `DataSourceID`, and the `*Raw` twins with the values as written in the file.

## Raises

The sign-in and plan check (first call of the process) raises the `CatPortalError` family listed on the [Introduction](https://docs.justcat.it/reference/python-module/introduction/ "Introduction") page. With no open project: in the current version a bare `TypeError: exceptions must derive from BaseException` (not a readable message) — call `open_project` first.

## Examples

```python
cat.open_project("D:/Testing/DwhTests.cat.yaml")
for ds in cat.get_data_sources():
    print(ds.Name, ds.ProviderTypeAndVersion)

names = [ds.Name for ds in cat.get_data_sources()]   # the names invoke_command accepts
```

## Related

- [Introduction](https://docs.justcat.it/reference/python-module/introduction/ "Introduction") — session model, logging, .NET objects, exceptions, sign-in.
- [Data sources](https://docs.justcat.it/reference/data-sources/ "Data sources") — the properties.
- [`get_data_source_lists`](https://docs.justcat.it/reference/python-module/get-data-source-lists/ "get_data_source_lists") · [`invoke_command`](https://docs.justcat.it/reference/python-module/invoke-command/ "invoke_command").

