> ## Documentation Index
> Fetch the complete documentation index at: https://takeprofit.com/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Package indie.data.sources

Typed data source descriptors, including external `Csv`/`DataFeed` and built-in profiles.

***

## Types

### `Csv`

*type*

Descriptor of an external CSV data source (URL and time column). Passed via the `source` argument of `Context.calc_on` or `request_series` to use data from an external CSV file in an indicator. The descriptor carries no time frame: it is declared at the call site, via the `time_frame` argument.

**1. Parent**

[`IExternalSource`](https://takeprofit.com/docs/indie/Library-reference/package-indie-data-sources#class_IExternalSource)

**2. Methods**

[Navigate to method\_Csv\_init](#method_Csv_init)

**init**

(url, time\_column) -> None

Creates a descriptor of an external CSV data source. `url` must be a public HTTPS link to a CSV file. `time_column` is the name of the header column that contains row timestamps.

**parameters info**

url

str

required

Public HTTPS URL of the CSV file. The file is downloaded by TakeProfit servers when the indicator instance is created.

time\_column

str

default:
"time"

Name of the CSV header column that contains row timestamps. Matched case-insensitively. Default is `time`.

> [!NOTE]
>
> More info on this topic you can find in [External data](https://takeprofit.com/docs/indie/External-data/External-data-overview.md) chapter.

> [!NOTE]
>
> See also: [`Context.calc_on()`](https://takeprofit.com/docs/indie/Library-reference/package-indie#method_Context_calc_on)[`request_series()`](https://takeprofit.com/docs/indie/Library-reference/package-indie#func_request_series)[`@data_context()`](https://takeprofit.com/docs/indie/Library-reference/package-indie#decor_data_context)[`DataFeed`](https://takeprofit.com/docs/indie/Library-reference/package-indie-data-sources#class_DataFeed)

***

### `DataFeed`

*type*

Descriptor of an external live data feed. Passed via the `source` argument of `Context.calc_on` or `request_series` to stream records into an indicator while it runs. A feed carries no time frame: records are point-in-time events, so passing `time_frame` or `lookahead` next to a DataFeed source is an error.

**1. Parent**

[`IExternalSource`](https://takeprofit.com/docs/indie/Library-reference/package-indie-data-sources#class_IExternalSource)

**2. Methods**

[Navigate to method\_DataFeed\_init](#method_DataFeed_init)

**init**

(url, stale\_after) -> None

Creates a descriptor of an external live data feed. The `url` scheme selects the transport: `wss://` is WebSocket, `https://` is SSE; insecure `ws://` and `http://` are rejected. `stale_after` is how long the feed may stay silent before the stream is treated as quiet.

**parameters info**

url

str

required

Feed URL. The scheme selects the transport: `wss://` is WebSocket, `https://` is SSE. Insecure `ws://` and `http://` are rejected.

stale\_after

indie.Optional\[datetime.timedelta]

default:
None

How long the feed may stay silent before the platform treats the stream as quiet. Whole seconds only. When omitted, the platform default applies.

> [!NOTE]
>
> More info on this topic you can find in [External data](https://takeprofit.com/docs/indie/External-data/External-data-overview.md) chapter.

> [!NOTE]
>
> See also: [`Context.calc_on()`](https://takeprofit.com/docs/indie/Library-reference/package-indie#method_Context_calc_on)[`request_series()`](https://takeprofit.com/docs/indie/Library-reference/package-indie#func_request_series)[`@data_context()`](https://takeprofit.com/docs/indie/Library-reference/package-indie#decor_data_context)[`Csv`](https://takeprofit.com/docs/indie/Library-reference/package-indie-data-sources#class_Csv)

***

### `IExternalSource`

*type*

Common base type of typed data source descriptors, including external and built-in sources.

***

### `Tpo`

*type*

Descriptor of the built-in Time Price Opportunity (TPO) data source for the chart instrument.

**1. Parent**

[`IExternalSource`](https://takeprofit.com/docs/indie/Library-reference/package-indie-data-sources#class_IExternalSource)

**2. Methods**

[Navigate to method\_Tpo\_init](#method_Tpo_init)

**init**

(session\_types, merge\_sessions, block\_size, row\_size\_ticks) -> None

Creates the built-in Time Price Opportunity (TPO) data source descriptor.

**parameters info**

session\_types

list\[indie.data.sources.session\_types]

default:
\[indie.data.sources.session\_types.MAIN\_SESSION, indie.data.sources.session\_types.PRE\_MARKET, indie.data.sources.session\_types.POST\_MARKET]

Trading sessions included in TPO profiles. Supported values are `PRE_MARKET`, `MAIN_SESSION`, and `POST_MARKET`. By default, all three session types are included.

merge\_sessions

indie.data.sources.tpo\_merge\_sessions

default:
indie.data.sources.tpo\_merge\_sessions.MERGE\_ALL

How selected sessions are combined into profiles. Use `tpo_merge_sessions.MERGE_ALL` or `tpo_merge_sessions.GROUP_BY_TYPE`. Default is `MERGE_ALL`.

block\_size

str

default:
"30m"

Duration of one lettered TPO block: `30m`, `1h`, `2h`, or `4h`. It is independent of the chart time frame and of the requested TPO profile period. Default is `30m`.

row\_size\_ticks

int

default:
0

Height of one price row in instrument ticks. `0` lets the service choose the row size automatically.

> [!NOTE]
>
> See also: [`request_series()`](https://takeprofit.com/docs/indie/Library-reference/package-indie#func_request_series)

***

### `VolumeFootprint`

*type*

Descriptor of the built-in Volume Footprint data source for the chart instrument.

**1. Parent**

[`IExternalSource`](https://takeprofit.com/docs/indie/Library-reference/package-indie-data-sources#class_IExternalSource)

**2. Methods**

[Navigate to method\_VolumeFootprint\_init](#method_VolumeFootprint_init)

**init**

(session\_types, row\_size\_ticks) -> None

Creates the built-in Volume Footprint data source descriptor.

**parameters info**

session\_types

list\[indie.data.sources.session\_types]

default:
\[indie.data.sources.session\_types.MAIN\_SESSION, indie.data.sources.session\_types.PRE\_MARKET, indie.data.sources.session\_types.POST\_MARKET]

Trading sessions included in Volume Footprint profiles. Use values from `session_types`. By default, `MAIN_SESSION`, `PRE_MARKET`, and `POST_MARKET` are included.

row\_size\_ticks

int

default:
0

Requested height of one price row in instrument ticks. `0` lets the service choose the row size automatically.

> [!NOTE]
>
> See also: [`VolumeFootprintProfile`](https://takeprofit.com/docs/indie/Library-reference/package-indie-data#class_VolumeFootprintProfile)[`request_series()`](https://takeprofit.com/docs/indie/Library-reference/package-indie#func_request_series)

***

## Enums

### `session_types`

*enum*

Trading session types accepted by built-in profile data sources.

**1. Static fields**

[Navigate to const\_source\_session\_types\_MAIN\_SESSION](#const_source_session_types_MAIN_SESSION)

MAIN\_SESSION

indie.data.sources.session\_types

The instrument regular trading session.

[Navigate to const\_source\_session\_types\_PRE\_MARKET](#const_source_session_types_PRE_MARKET)

PRE\_MARKET

indie.data.sources.session\_types

The instrument pre-market trading session.

[Navigate to const\_source\_session\_types\_POST\_MARKET](#const_source_session_types_POST_MARKET)

POST\_MARKET

indie.data.sources.session\_types

The instrument post-market trading session.

***

### `tpo_merge_sessions`

*enum*

Controls how selected trading sessions are combined into TPO profiles.

**1. Static fields**

[Navigate to const\_tpo\_merge\_sessions\_MERGE\_ALL](#const_tpo_merge_sessions_MERGE_ALL)

MERGE\_ALL

indie.data.sources.tpo\_merge\_sessions

Combines all selected sessions into one profile per requested TPO period.

[Navigate to const\_tpo\_merge\_sessions\_GROUP\_BY\_TYPE](#const_tpo_merge_sessions_GROUP_BY_TYPE)

GROUP\_BY\_TYPE

indie.data.sources.tpo\_merge\_sessions

Combines selected sessions of the same type into separate profiles per requested TPO period.

***


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.