# tff.program.FederatedDataSource

<br />

|---|
| [![](https://www.tensorflow.org/images/GitHub-Mark-32px.png) View source on GitHub](https://github.com/tensorflow/federated/blob/v0.87.0 Version 2.0, January 2004 Licensed under the Apache License, Version 2.0 (the) |

An abstract interface for representing federated data sources.

This interface abstracts away the specifics of working with various types of
data sources.

Things one can do with a data source:

- Determine the type of the data supplied by this data source by inspecting
  the `federated_type` property. The type returned should be a federated type.
  Note that depending on whether this data source contains one or a number of
  federated datasets, the type may or may not be a struct (with individual
  datasets appearing as elements of this struct).

- Construct a new iterator for this data source by invoking `iterator` on it.
  Each iterator represents an independent pass over the data from this data
  source.

<br />

<br />

<br />

| ## Attributes ||
|---|---|
| `federated_type` | The type of the data returned by calling `select` on an iterator. |

<br />

## Methods

### `iterator`

[View source](https://github.com/tensorflow/federated/blob/v0.87.0
Version 2.0, January 2004
Licensed under the Apache License, Version 2.0 (the)

    @abc.abstractmethod
    iterator() -> https://www.tensorflow.org/federated/api_docs/python/tff/program/FederatedDataSourceIterator

Returns a new iterator for retrieving data from this data source.