Returns a ResourceList of the dataset’s snapshots. If there are more than 20, the default is the first 20 snapshots, but appending .all() returns a representation of all matching snapshots. You can iterate over a ResourceList as you would a list.

The examples below demonstrate how to use .all() and list slicing to obtain the snapshots you want.

Required arguments

None

Optional keyword arguments

NameTypeDescriptionRequired?
filter string Returns only snapshots where the specified attribute matches the specified value, for example, created_at>2018-03-09. created_at and record_start_date are supported. false
ingest_status string Returns only snapshots where the ingest_status attribute matches the specified value (SUCCESS, FAILURE, or INGESTING). false
sort array List of snapshot attributes indicating how to sort the snapshots. created_at, record_start_date, start_date, and end_date are supported. For example, -created_at sorts the snapshots by creation date, with the most recent listed first. created_at is the default sort attribute. false

Returns

A ResourceList of snapshot models.

If you append a list slicing operator ([]), the SDK returns a Python generator. You can iterate over a generator as you would a list.

Examples

The first example returns all snapshots created after July 1, 2018 as a ResourceList.

public = enigma.Public()
dataset = public.datasets.get('d8c29d0d-f283-4eb5-b4d4-460c9779d05d')
snapshots = dataset.snapshots(filter='created_at>2018-07-01').all()

The next example returns snapshots 21-30 (by date created). Because we’re using list slicing, this example returns a generator.

public = enigma.Public()
dataset = public.datasets.get('d8c29d0d-f283-4eb5-b4d4-460c9779d05d')
snapshots = dataset.snapshots()[20:30]