# Source code for matchtable.filter

    from typing import Self

    Filter = dict[str, list[str | float]]

    class FilterBuilder:
        """Create a filter."""

        def __init__(self) -> None:
            self.filter: Filter = {}

        def add_selective_filter(
            self, prop: str, values: list[str | float]
        ) -> Self:
            """Add a property to be filtered.

            Args:
                prop:
                    Name of property to be filtered.
                values:
                    Values of property.
                    Only rows with these property values will shown.
            """
            self.filter[prop] = values
            return self

        def build(self) -> Filter:
            """Obtain the data."""
            return self.filter