class documentation

Base interface for sample parsers.

SampleParser instances are used to parse samples emitted by dataset iterators when ingesting them into fiftyone.core.dataset.Dataset instances.

The general recipe for using SampleParser instances is as follows:

sample_parser = SampleParser(...)

for sample in samples:
    sample_parser.with_sample(sample)
    field = sample_parser.get_<field>()

where field is a subclass specific field to parse from the sample.

Method __init__ Undocumented
Method clear_sample Clears the current sample.
Method with_sample Sets the current sample so that subsequent calls to methods of this parser will return information from the given sample.
Property current_sample The current sample.
Instance Variable _current_sample Undocumented
def with_sample(self, sample): (source)

Sets the current sample so that subsequent calls to methods of this parser will return information from the given sample.

Guaranteed to call clear_sample before setting the current sample.

Parameters
samplea sample
@property
current_sample = (source)

The current sample.

Raises
ValueErrorif there is no current sample
_current_sample = (source)

Undocumented