<!-- # hard line break macro for HTML -->

# fiftyone.core.tags

Implementation for temporal tags.

Temporal tags are sample-scoped records stored in the dedicated
`tags` collection. Dataset/sample lifecycle hooks, import/export
sidecars, and low-level orphan cleanup all flow through this module so the
storage contract stays in one place.

The collection and indexes are created lazily on first write. CRUD
bumps linked sample and dataset `last_modified_at` values; lifecycle cleanup
helpers rely on their own owning operations for freshness.

Copyright 2017-2026, Voxel51, Inc.
<br/>
[voxel51.com](https://voxel51.com/)
<br/>
<br/>

**Classes:**

| [`TagKind`](#fiftyone.core.tags.TagKind)(\*values)                                    |                                                                       |
|---------------------------------------------------------------------------------------|-----------------------------------------------------------------------|
| [`TemporalTag`](#fiftyone.core.tags.TemporalTag)(sample_id, start, end, tag[, ...])   | A temporal tag interval on one multimodal sample.                     |
| [`TemporalTagFilter`](#fiftyone.core.tags.TemporalTagFilter)([sample_ids, tags, ...]) | Filter for multimodal temporal tag queries.                           |
| [`TemporalTags`](#fiftyone.core.tags.TemporalTags)(sample_collection)                 | An ordered collection of temporal tags scoped to a sample collection. |

**Functions:**

| [`add_temporal_tags`](#fiftyone.core.tags.add_temporal_tags)(dataset, tags)                     | Adds temporal tags to a dataset.                         |
|-------------------------------------------------------------------------------------------------|----------------------------------------------------------|
| [`count_temporal_tags`](#fiftyone.core.tags.count_temporal_tags)(dataset[, filter, by_sample])  | Counts temporal tags in a dataset, grouped by tag value. |
| [`delete_temporal_tags`](#fiftyone.core.tags.delete_temporal_tags)(dataset, \*[, ids, ...])     | Deletes temporal tags from a dataset.                    |
| [`list_temporal_tags`](#fiftyone.core.tags.list_temporal_tags)(dataset[, filter])               | Lists temporal tags for a dataset.                       |
| [`update_temporal_tag`](#fiftyone.core.tags.update_temporal_tag)(dataset, id, \*[, start, ...]) | Updates a temporal tag in a dataset.                     |

### *class* fiftyone.core.tags.TagKind(\*values)

Bases: `str`, `Enum`

**Attributes:**

| [`TEMPORAL`](#fiftyone.core.tags.TagKind.TEMPORAL)   |    |
|------------------------------------------------------|----|

**Methods:**

| [`encode`](#fiftyone.core.tags.TagKind.encode)([encoding, errors])     | Encode the string using the codec registered for encoding.                                                  |
|------------------------------------------------------------------------|-------------------------------------------------------------------------------------------------------------|
| [`replace`](#fiftyone.core.tags.TagKind.replace)(old, new, /[, count]) | Return a copy with all occurrences of substring old replaced by new.                                        |
| [`split`](#fiftyone.core.tags.TagKind.split)([sep, maxsplit])          | Return a list of the substrings in the string, using sep as the separator string.                           |
| [`rsplit`](#fiftyone.core.tags.TagKind.rsplit)([sep, maxsplit])        | Return a list of the substrings in the string, using sep as the separator string.                           |
| [`join`](#fiftyone.core.tags.TagKind.join)(iterable, /)                | Concatenate any number of strings.                                                                          |
| [`capitalize`](#fiftyone.core.tags.TagKind.capitalize)()               | Return a capitalized version of the string.                                                                 |
| [`casefold`](#fiftyone.core.tags.TagKind.casefold)()                   | Return a version of the string suitable for caseless comparisons.                                           |
| [`title`](#fiftyone.core.tags.TagKind.title)()                         | Return a version of the string where each word is titlecased.                                               |
| [`center`](#fiftyone.core.tags.TagKind.center)(width[, fillchar])      | Return a centered string of length width.                                                                   |
| [`count`](#fiftyone.core.tags.TagKind.count)                           | Return the number of non-overlapping occurrences of substring sub in string S[start:end].                   |
| [`expandtabs`](#fiftyone.core.tags.TagKind.expandtabs)([tabsize])      | Return a copy where all tab characters are expanded using spaces.                                           |
| [`find`](#fiftyone.core.tags.TagKind.find)                             | Return the lowest index in S where substring sub is found, such that sub is contained within S[start:end].  |
| [`partition`](#fiftyone.core.tags.TagKind.partition)(sep, /)           | Partition the string into three parts using the given separator.                                            |
| [`index`](#fiftyone.core.tags.TagKind.index)                           | Return the lowest index in S where substring sub is found, such that sub is contained within S[start:end].  |
| [`ljust`](#fiftyone.core.tags.TagKind.ljust)(width[, fillchar])        | Return a left-justified string of length width.                                                             |
| [`lower`](#fiftyone.core.tags.TagKind.lower)()                         | Return a copy of the string converted to lowercase.                                                         |
| [`lstrip`](#fiftyone.core.tags.TagKind.lstrip)([chars])                | Return a copy of the string with leading whitespace removed.                                                |
| [`rfind`](#fiftyone.core.tags.TagKind.rfind)                           | Return the highest index in S where substring sub is found, such that sub is contained within S[start:end]. |
| [`rindex`](#fiftyone.core.tags.TagKind.rindex)                         | Return the highest index in S where substring sub is found, such that sub is contained within S[start:end]. |
| [`rjust`](#fiftyone.core.tags.TagKind.rjust)(width[, fillchar])        | Return a right-justified string of length width.                                                            |
| [`rstrip`](#fiftyone.core.tags.TagKind.rstrip)([chars])                | Return a copy of the string with trailing whitespace removed.                                               |
| [`rpartition`](#fiftyone.core.tags.TagKind.rpartition)(sep, /)         | Partition the string into three parts using the given separator.                                            |
| [`splitlines`](#fiftyone.core.tags.TagKind.splitlines)([keepends])     | Return a list of the lines in the string, breaking at line boundaries.                                      |
| [`strip`](#fiftyone.core.tags.TagKind.strip)([chars])                  | Return a copy of the string with leading and trailing whitespace removed.                                   |
| [`swapcase`](#fiftyone.core.tags.TagKind.swapcase)()                   | Convert uppercase characters to lowercase and lowercase characters to uppercase.                            |
| [`translate`](#fiftyone.core.tags.TagKind.translate)(table, /)         | Replace each character in the string using the given translation table.                                     |
| [`upper`](#fiftyone.core.tags.TagKind.upper)()                         | Return a copy of the string converted to uppercase.                                                         |
| [`startswith`](#fiftyone.core.tags.TagKind.startswith)                 | Return True if the string starts with the specified prefix, False otherwise.                                |
| [`endswith`](#fiftyone.core.tags.TagKind.endswith)                     | Return True if the string ends with the specified suffix, False otherwise.                                  |
| [`removeprefix`](#fiftyone.core.tags.TagKind.removeprefix)(prefix, /)  | Return a str with the given prefix string removed if present.                                               |
| [`removesuffix`](#fiftyone.core.tags.TagKind.removesuffix)(suffix, /)  | Return a str with the given suffix string removed if present.                                               |
| [`isascii`](#fiftyone.core.tags.TagKind.isascii)()                     | Return True if all characters in the string are ASCII, False otherwise.                                     |
| [`islower`](#fiftyone.core.tags.TagKind.islower)()                     | Return True if the string is a lowercase string, False otherwise.                                           |
| [`isupper`](#fiftyone.core.tags.TagKind.isupper)()                     | Return True if the string is an uppercase string, False otherwise.                                          |
| [`istitle`](#fiftyone.core.tags.TagKind.istitle)()                     | Return True if the string is a title-cased string, False otherwise.                                         |
| [`isspace`](#fiftyone.core.tags.TagKind.isspace)()                     | Return True if the string is a whitespace string, False otherwise.                                          |
| [`isdecimal`](#fiftyone.core.tags.TagKind.isdecimal)()                 | Return True if the string is a decimal string, False otherwise.                                             |
| [`isdigit`](#fiftyone.core.tags.TagKind.isdigit)()                     | Return True if the string is a digit string, False otherwise.                                               |
| [`isnumeric`](#fiftyone.core.tags.TagKind.isnumeric)()                 | Return True if the string is a numeric string, False otherwise.                                             |
| [`isalpha`](#fiftyone.core.tags.TagKind.isalpha)()                     | Return True if the string is an alphabetic string, False otherwise.                                         |
| [`isalnum`](#fiftyone.core.tags.TagKind.isalnum)()                     | Return True if the string is an alpha-numeric string, False otherwise.                                      |
| [`isidentifier`](#fiftyone.core.tags.TagKind.isidentifier)()           | Return True if the string is a valid Python identifier, False otherwise.                                    |
| [`isprintable`](#fiftyone.core.tags.TagKind.isprintable)()             | Return True if all characters in the string are printable, False otherwise.                                 |
| [`zfill`](#fiftyone.core.tags.TagKind.zfill)(width, /)                 | Pad a numeric string with zeros on the left, to fill a field of the given width.                            |
| [`format`](#fiftyone.core.tags.TagKind.format)(\*args, \*\*kwargs)     | Return a formatted version of the string, using substitutions from args and kwargs.                         |
| [`format_map`](#fiftyone.core.tags.TagKind.format_map)(mapping, /)     | Return a formatted version of the string, using substitutions from mapping.                                 |
| [`maketrans`](#fiftyone.core.tags.TagKind.maketrans)                   | Return a translation table usable for str.translate().                                                      |

#### TEMPORAL *= 'temporal'*

#### encode(encoding='utf-8', errors='strict')

Encode the string using the codec registered for encoding.

encoding
: The encoding in which to encode the string.

errors
: The error handling scheme to use for encoding errors.
  The default is ‘strict’ meaning that encoding errors raise a
  UnicodeEncodeError.  Other possible values are ‘ignore’, ‘replace’
  and ‘xmlcharrefreplace’ as well as any other name registered with
  codecs.register_error that can handle UnicodeEncodeErrors.

#### replace(old, new, , count=-1)

Return a copy with all occurrences of substring old replaced by new.

> count
> : Maximum number of occurrences to replace.
>   -1 (the default value) means replace all occurrences.

If the optional argument count is given, only the first count occurrences are
replaced.

#### split(sep=None, maxsplit=-1)

Return a list of the substrings in the string, using sep as the separator string.

> sep
> : The separator used to split the string.
>   <br/>
>   When set to None (the default value), will split on any
>   whitespace character (including n r t f and spaces) and
>   will discard empty strings from the result.

> maxsplit
> : Maximum number of splits.
>   -1 (the default value) means no limit.

Splitting starts at the front of the string and works to the end.

Note, str.split() is mainly useful for data that has been
intentionally delimited.  With natural text that includes
punctuation, consider using the regular expression module.

#### rsplit(sep=None, maxsplit=-1)

Return a list of the substrings in the string, using sep as the separator string.

> sep
> : The separator used to split the string.
>   <br/>
>   When set to None (the default value), will split on any
>   whitespace character (including n r t f and spaces) and
>   will discard empty strings from the result.

> maxsplit
> : Maximum number of splits.
>   -1 (the default value) means no limit.

Splitting starts at the end of the string and works to the front.

#### join(iterable,)

Concatenate any number of strings.

The string whose method is called is inserted in between each given
string.  The result is returned as a new string.

Example: ‘.’.join([‘ab’, ‘pq’, ‘rs’]) -> ‘ab.pq.rs’

#### capitalize()

Return a capitalized version of the string.

More specifically, make the first character have upper case and the
rest lower case.

#### casefold()

Return a version of the string suitable for caseless comparisons.

#### title()

Return a version of the string where each word is titlecased.

More specifically, words start with uppercased characters and all
remaining cased characters have lower case.

#### center(width, fillchar=' ',)

Return a centered string of length width.

Padding is done using the specified fill character (default is
a space).

#### count()

Return the number of non-overlapping occurrences of substring sub in string S[start:end].

Optional arguments start and end are interpreted as in slice
notation.

#### expandtabs(tabsize=8)

Return a copy where all tab characters are expanded using spaces.

If tabsize is not given, a tab size of 8 characters is assumed.

#### find()

Return the lowest index in S where substring sub is found, such that sub is contained within S[start:end].

Optional arguments start and end are interpreted as in slice
notation.  Return -1 on failure.

#### partition(sep,)

Partition the string into three parts using the given separator.

This will search for the separator in the string.  If the separator
is found, returns a 3-tuple containing the part before the
separator, the separator itself, and the part after it.

If the separator is not found, returns a 3-tuple containing
the original string and two empty strings.

#### index()

Return the lowest index in S where substring sub is found, such that sub is contained within S[start:end].

Optional arguments start and end are interpreted as in slice
notation.  Raises ValueError when the substring is not found.

#### ljust(width, fillchar=' ',)

Return a left-justified string of length width.

Padding is done using the specified fill character (default is
a space).

#### lower()

Return a copy of the string converted to lowercase.

#### lstrip(chars=None,)

Return a copy of the string with leading whitespace removed.

If chars is given and not None, remove characters in chars instead.

#### rfind()

Return the highest index in S where substring sub is found, such that sub is contained within S[start:end].

Optional arguments start and end are interpreted as in slice
notation.  Return -1 on failure.

#### rindex()

Return the highest index in S where substring sub is found, such that sub is contained within S[start:end].

Optional arguments start and end are interpreted as in slice
notation.  Raises ValueError when the substring is not found.

#### rjust(width, fillchar=' ',)

Return a right-justified string of length width.

Padding is done using the specified fill character (default is
a space).

#### rstrip(chars=None,)

Return a copy of the string with trailing whitespace removed.

If chars is given and not None, remove characters in chars instead.

#### rpartition(sep,)

Partition the string into three parts using the given separator.

This will search for the separator in the string, starting at the
end.  If the separator is found, returns a 3-tuple containing the
part before the separator, the separator itself, and the part after
it.

If the separator is not found, returns a 3-tuple containing two
empty strings and the original string.

#### splitlines(keepends=False)

Return a list of the lines in the string, breaking at line boundaries.

Line breaks are not included in the resulting list unless keepends
is given and true.

#### strip(chars=None,)

Return a copy of the string with leading and trailing whitespace removed.

If chars is given and not None, remove characters in chars instead.

#### swapcase()

Convert uppercase characters to lowercase and lowercase characters to uppercase.

#### translate(table,)

Replace each character in the string using the given translation table.

> table
> : Translation table, which must be a mapping of Unicode ordinals
>   to Unicode ordinals, strings, or None.

The table must implement lookup/indexing via \_\_getitem_\_, for
instance a dictionary or list.  If this operation raises
LookupError, the character is left untouched.  Characters mapped to
None are deleted.

#### upper()

Return a copy of the string converted to uppercase.

#### startswith()

Return True if the string starts with the specified prefix, False otherwise.

prefix
: A string or a tuple of strings to try.

start
: Optional start position. Default: start of the string.

end
: Optional stop position. Default: end of the string.

#### endswith()

Return True if the string ends with the specified suffix, False otherwise.

suffix
: A string or a tuple of strings to try.

start
: Optional start position. Default: start of the string.

end
: Optional stop position. Default: end of the string.

#### removeprefix(prefix,)

Return a str with the given prefix string removed if present.

If the string starts with the prefix string, return
string[len(prefix):].  Otherwise, return a copy of the original
string.

#### removesuffix(suffix,)

Return a str with the given suffix string removed if present.

If the string ends with the suffix string and that suffix is not
empty, return string[:-len(suffix)].  Otherwise, return a copy of
the original string.

#### isascii()

Return True if all characters in the string are ASCII, False otherwise.

ASCII characters have code points in the range U+0000-U+007F.
Empty string is ASCII too.

#### islower()

Return True if the string is a lowercase string, False otherwise.

A string is lowercase if all cased characters in the string are
lowercase and there is at least one cased character in the string.

#### isupper()

Return True if the string is an uppercase string, False otherwise.

A string is uppercase if all cased characters in the string are
uppercase and there is at least one cased character in the string.

#### istitle()

Return True if the string is a title-cased string, False otherwise.

In a title-cased string, upper- and title-case characters may only
follow uncased characters and lowercase characters only cased ones.

#### isspace()

Return True if the string is a whitespace string, False otherwise.

A string is whitespace if all characters in the string are
whitespace and there is at least one character in the string.

#### isdecimal()

Return True if the string is a decimal string, False otherwise.

A string is a decimal string if all characters in the string are
decimal and there is at least one character in the string.

#### isdigit()

Return True if the string is a digit string, False otherwise.

A string is a digit string if all characters in the string are
digits and there is at least one character in the string.

#### isnumeric()

Return True if the string is a numeric string, False otherwise.

A string is numeric if all characters in the string are numeric and
there is at least one character in the string.

#### isalpha()

Return True if the string is an alphabetic string, False otherwise.

A string is alphabetic if all characters in the string are
alphabetic and there is at least one character in the string.

#### isalnum()

Return True if the string is an alpha-numeric string, False otherwise.

A string is alpha-numeric if all characters in the string are
alpha-numeric and there is at least one character in the string.

#### isidentifier()

Return True if the string is a valid Python identifier, False otherwise.

Call keyword.iskeyword(s) to test whether string s is a reserved
identifier, such as “def” or “class”.

#### isprintable()

Return True if all characters in the string are printable, False otherwise.

A character is printable if repr() may use it in its output.

#### zfill(width,)

Pad a numeric string with zeros on the left, to fill a field of the given width.

The string is never truncated.

#### format(\*args, \*\*kwargs)

Return a formatted version of the string, using substitutions from args and kwargs.
The substitutions are identified by braces (‘{’ and ‘}’).

#### format_map(mapping,)

Return a formatted version of the string, using substitutions from mapping.
The substitutions are identified by braces (‘{’ and ‘}’).

#### *static* maketrans()

Return a translation table usable for str.translate().

If there is only one argument, it must be a dictionary mapping
Unicode ordinals (integers) or characters to Unicode ordinals,
strings or None.  Character keys will be then converted to ordinals.
If there are two arguments, they must be strings of equal length,
and in the resulting dictionary, each character in x will be mapped
to the character at the same position in y.  If there is a third
argument, it must be a string, whose characters will be mapped to
None in the result.

### *class* fiftyone.core.tags.TemporalTag(sample_id, start, end, tag, index_type=None, anchor=None, created_by=None, last_modified_by=None, created_at=None, last_modified_at=None, id=None, kind=TagKind.TEMPORAL)

Bases: `object`

A temporal tag interval on one multimodal sample.

* **Parameters:**
  * **sample_id** – the sample ID this temporal tag applies to
  * **start** – the inclusive start value on the tag’s index type
  * **end** – the exclusive end value on the tag’s index type
  * **tag** – the tag value
  * **index_type** – a `TimeTrackType` value describing the index
    archetype. Defaults to `TIME_TRACK_TYPE_DURATION_NS`
  * **anchor** (*None*) – an optional opaque reference key that qualifies the
    context for `start` and `end`
  * **created_by** (*None*) – an optional actor that created the temporal tag
  * **last_modified_by** (*None*) – an optional actor that last modified the
    temporal tag
  * **created_at** (*None*) – the creation timestamp, when available
  * **last_modified_at** (*None*) – the last-modified timestamp, when available
  * **id** – the persisted temporal tag ID, when available

**Methods:**

| [`copy`](#fiftyone.core.tags.TemporalTag.copy)()       | Returns a copy of this temporal tag.              |
|--------------------------------------------------------|---------------------------------------------------|
| [`to_dict`](#fiftyone.core.tags.TemporalTag.to_dict)() | Serializes the temporal tag to a JSON dictionary. |

#### copy()

Returns a copy of this temporal tag.

#### to_dict()

Serializes the temporal tag to a JSON dictionary.

### *class* fiftyone.core.tags.TemporalTagFilter(sample_ids: str | Iterable[str] | None = None, tags: str | Iterable[str] | None = None, anchors: str | Iterable[str] | None = None, index_type: int | None = None, start: int | None = None, end: int | None = None)

Bases: `object`

Filter for multimodal temporal tag queries.

Range filters use half-open interval overlap semantics. For example,
`start=10, end=20` matches persisted intervals whose `start < 20` and
`end > 10`.

* **Parameters:**
  * **sample_ids** – an optional sample ID or iterable of sample IDs
  * **tags** – an optional tag or iterable of tags
  * **anchors** – an optional anchor or iterable of anchors
  * **index_type** – an optional `TimeTrackType` value
  * **start** – an optional inclusive lower bound for overlap queries
  * **end** – an optional exclusive upper bound for overlap queries

**Attributes:**

| [`sample_ids`](#fiftyone.core.tags.TemporalTagFilter.sample_ids)   |    |
|--------------------------------------------------------------------|----|
| [`tags`](#fiftyone.core.tags.TemporalTagFilter.tags)               |    |
| [`anchors`](#fiftyone.core.tags.TemporalTagFilter.anchors)         |    |
| [`index_type`](#fiftyone.core.tags.TemporalTagFilter.index_type)   |    |
| [`start`](#fiftyone.core.tags.TemporalTagFilter.start)             |    |
| [`end`](#fiftyone.core.tags.TemporalTagFilter.end)                 |    |

#### sample_ids *: str | Iterable[str] | None* *= None*

#### tags *: str | Iterable[str] | None* *= None*

#### anchors *: str | Iterable[str] | None* *= None*

#### index_type *: int | None* *= None*

#### start *: int | None* *= None*

#### end *: int | None* *= None*

### *class* fiftyone.core.tags.TemporalTags(sample_collection)

Bases: `object`

An ordered collection of temporal tags scoped to a sample collection.

Temporal tags are stored in a dedicated collection and linked to samples by
ID. Dataset/view scoping is applied by this facade: reads and deletes are
restricted to the provided sample collection, and adds reject sample IDs
outside the collection.

* **Parameters:**
  **sample_collection** – a `fiftyone.Dataset` or
  [`fiftyone.core.view.DatasetView`](fiftyone.core.view.md#fiftyone.core.view.DatasetView)

**Methods:**

| [`first`](#fiftyone.core.tags.TemporalTags.first)()                                      | Returns the first temporal tag in this collection.                |
|------------------------------------------------------------------------------------------|-------------------------------------------------------------------|
| [`head`](#fiftyone.core.tags.TemporalTags.head)([num_tags])                              | Returns a list of the first few temporal tags in this collection. |
| [`tail`](#fiftyone.core.tags.TemporalTags.tail)([num_tags])                              | Returns a list of the last few temporal tags in this collection.  |
| [`keys`](#fiftyone.core.tags.TemporalTags.keys)()                                        | Returns an iterator over persisted temporal tag IDs.              |
| [`items`](#fiftyone.core.tags.TemporalTags.items)()                                      | Returns an iterator over persisted temporal tag ID/tag pairs.     |
| [`values`](#fiftyone.core.tags.TemporalTags.values)([filter])                            | Returns an iterator over temporal tags in this collection.        |
| [`add`](#fiftyone.core.tags.TemporalTags.add)(tags)                                      | Adds temporal tags to this collection.                            |
| [`update`](#fiftyone.core.tags.TemporalTags.update)(id, \*[, start, end, tag, ...])      | Updates a persisted temporal tag by ID.                           |
| [`delete`](#fiftyone.core.tags.TemporalTags.delete)(\*[, ids, tags, filter, delete_all]) | Deletes temporal tags from this collection.                       |
| [`clear`](#fiftyone.core.tags.TemporalTags.clear)()                                      | Deletes all temporal tags in this collection.                     |
| [`count`](#fiftyone.core.tags.TemporalTags.count)([filter, by_sample])                   | Counts temporal tags in this collection, grouped by tag value.    |

#### first()

Returns the first temporal tag in this collection.

* **Returns:**
  a [`TemporalTag`](#fiftyone.core.tags.TemporalTag)

#### head(num_tags=3)

Returns a list of the first few temporal tags in this collection.

If fewer than `num_tags` temporal tags exist, only the available tags
are returned.

* **Parameters:**
  **num_tags** (*3*) – the number of temporal tags
* **Returns:**
  a list of [`TemporalTag`](#fiftyone.core.tags.TemporalTag) instances

#### tail(num_tags=3)

Returns a list of the last few temporal tags in this collection.

If fewer than `num_tags` temporal tags exist, only the available tags
are returned.

* **Parameters:**
  **num_tags** (*3*) – the number of temporal tags
* **Returns:**
  a list of [`TemporalTag`](#fiftyone.core.tags.TemporalTag) instances

#### keys()

Returns an iterator over persisted temporal tag IDs.

#### items()

Returns an iterator over persisted temporal tag ID/tag pairs.

#### values(filter: [TemporalTagFilter](#fiftyone.core.tags.TemporalTagFilter) | None = None)

Returns an iterator over temporal tags in this collection.

* **Parameters:**
  **filter** (*None*) – an optional [`TemporalTagFilter`](#fiftyone.core.tags.TemporalTagFilter)
* **Returns:**
  an iterator over [`TemporalTag`](#fiftyone.core.tags.TemporalTag) instances

#### add(tags: [TemporalTag](#fiftyone.core.tags.TemporalTag) | Iterable[[TemporalTag](#fiftyone.core.tags.TemporalTag)])

Adds temporal tags to this collection.

The tuple `(dataset, sample_id, index_type, anchor, start, end, tag)`
is unique, so adding the same tag interval multiple times is
idempotent.

* **Parameters:**
  **tags** – a temporal tag or iterable of temporal tags
* **Returns:**
  a list of persisted [`TemporalTag`](#fiftyone.core.tags.TemporalTag) instances

#### update(id, , start=None, end=None, tag=None, last_modified_by=None) → [TemporalTag](#fiftyone.core.tags.TemporalTag)

Updates a persisted temporal tag by ID.

* **Parameters:**
  * **id** – the temporal tag ID
  * **start** (*None*) – an optional updated start value
  * **end** (*None*) – an optional updated end value
  * **tag** (*None*) – an optional updated tag value
  * **last_modified_by** (*None*) – an optional actor that last modified the
    temporal tag
* **Returns:**
  the updated [`TemporalTag`](#fiftyone.core.tags.TemporalTag)

#### delete(, ids: str | Iterable[str] | None = None, tags: str | Iterable[str] | None = None, filter: [TemporalTagFilter](#fiftyone.core.tags.TemporalTagFilter) | None = None, delete_all: [bool](fiftyone.core.stages.md#fiftyone.core.stages.Exists.bool) = False) → int

Deletes temporal tags from this collection.

* **Parameters:**
  * **ids** (*None*) – an optional temporal tag ID or iterable of IDs
  * **tags** (*None*) – an optional tag or iterable of tags
  * **filter** (*None*) – an optional [`TemporalTagFilter`](#fiftyone.core.tags.TemporalTagFilter)
  * **delete_all** (*False*) – whether to allow an empty selector
* **Returns:**
  the number of deleted temporal tags

#### clear()

Deletes all temporal tags in this collection.

* **Returns:**
  the number of deleted temporal tags

#### count(filter: [TemporalTagFilter](#fiftyone.core.tags.TemporalTagFilter) | None = None, , by_sample: [bool](fiftyone.core.stages.md#fiftyone.core.stages.Exists.bool) = False) → dict[str, int]

Counts temporal tags in this collection, grouped by tag value.

* **Parameters:**
  * **filter** (*None*) – an optional [`TemporalTagFilter`](#fiftyone.core.tags.TemporalTagFilter)
  * **by_sample** (*False*) – if `True`, count the number of distinct
    samples carrying each tag (a sample with multiple intervals of
    the same tag counts once); if `False`, count every tag
    instance (interval)
* **Returns:**
  a dict mapping tag values to counts

### fiftyone.core.tags.add_temporal_tags(dataset, tags: [TemporalTag](#fiftyone.core.tags.TemporalTag) | Iterable[[TemporalTag](#fiftyone.core.tags.TemporalTag)])

Adds temporal tags to a dataset.

The tuple `(dataset, sample_id, index_type, anchor, start, end, tag)` is
unique, so adding the same tag interval multiple times is idempotent.
If a view is provided, all tag sample IDs must belong to the view.

* **Parameters:**
  * **dataset** – a `fiftyone.Dataset` or
    [`fiftyone.core.view.DatasetView`](fiftyone.core.view.md#fiftyone.core.view.DatasetView)
  * **tags** – a temporal tag or iterable of temporal tags
* **Returns:**
  a list of persisted [`TemporalTag`](#fiftyone.core.tags.TemporalTag) instances

### fiftyone.core.tags.count_temporal_tags(dataset, filter: [TemporalTagFilter](#fiftyone.core.tags.TemporalTagFilter) | None = None, , by_sample: [bool](fiftyone.core.stages.md#fiftyone.core.stages.Exists.bool) = False) → dict[str, int]

Counts temporal tags in a dataset, grouped by tag value.

If a view is provided, only temporal tags linked to the view’s samples are
counted.

* **Parameters:**
  * **dataset** – a `fiftyone.Dataset` or
    [`fiftyone.core.view.DatasetView`](fiftyone.core.view.md#fiftyone.core.view.DatasetView)
  * **filter** (*None*) – an optional [`TemporalTagFilter`](#fiftyone.core.tags.TemporalTagFilter)
  * **by_sample** (*False*) – if `True`, count the number of distinct samples
    carrying each tag (a sample with multiple intervals of the same tag
    counts once); if `False`, count every tag instance (interval)
* **Returns:**
  a dict mapping tag values to counts

### fiftyone.core.tags.delete_temporal_tags(dataset, , ids: str | Iterable[str] | None = None, tags: str | Iterable[str] | None = None, filter: [TemporalTagFilter](#fiftyone.core.tags.TemporalTagFilter) | None = None, delete_all: [bool](fiftyone.core.stages.md#fiftyone.core.stages.Exists.bool) = False) → int

Deletes temporal tags from a dataset.

If a view is provided, deletes are restricted to temporal tags linked to
the view’s samples. Empty selectors are rejected unless `delete_all=True`
is provided.

* **Parameters:**
  * **dataset** – a `fiftyone.Dataset` or
    [`fiftyone.core.view.DatasetView`](fiftyone.core.view.md#fiftyone.core.view.DatasetView)
  * **ids** (*None*) – an optional temporal tag ID or iterable of IDs
  * **tags** (*None*) – an optional tag or iterable of tags
  * **filter** (*None*) – an optional [`TemporalTagFilter`](#fiftyone.core.tags.TemporalTagFilter)
  * **delete_all** (*False*) – whether to allow an empty selector
* **Returns:**
  the number of deleted temporal tags

### fiftyone.core.tags.list_temporal_tags(dataset, filter: [TemporalTagFilter](#fiftyone.core.tags.TemporalTagFilter) | None = None) → [list](fiftyone.core.session.events.md#fiftyone.core.session.events.Colorscale.list)[[TemporalTag](#fiftyone.core.tags.TemporalTag)]

Lists temporal tags for a dataset.

If a view is provided, only temporal tags linked to the view’s samples are
returned.

* **Parameters:**
  * **dataset** – a `fiftyone.Dataset` or
    [`fiftyone.core.view.DatasetView`](fiftyone.core.view.md#fiftyone.core.view.DatasetView)
  * **filter** (*None*) – an optional [`TemporalTagFilter`](#fiftyone.core.tags.TemporalTagFilter)
* **Returns:**
  a list of matching [`TemporalTag`](#fiftyone.core.tags.TemporalTag) instances

### fiftyone.core.tags.update_temporal_tag(dataset, id, , start=None, end=None, tag=None, last_modified_by=None) → [TemporalTag](#fiftyone.core.tags.TemporalTag)

Updates a temporal tag in a dataset.

If a view is provided, the temporal tag ID must belong to the view.

* **Parameters:**
  * **dataset** – a `fiftyone.Dataset` or
    [`fiftyone.core.view.DatasetView`](fiftyone.core.view.md#fiftyone.core.view.DatasetView)
  * **id** – the temporal tag ID
  * **start** (*None*) – an optional updated start value
  * **end** (*None*) – an optional updated end value
  * **tag** (*None*) – an optional updated tag value
  * **last_modified_by** (*None*) – an optional actor that last modified the
    temporal tag
* **Returns:**
  the updated [`TemporalTag`](#fiftyone.core.tags.TemporalTag)
