# `Smee.Filter`
[🔗](https://github.com/Digital-Identity-Labs/smee/blob/main/lib/smee/filter.ex#L1)

Process a stream of entities to include or exclude entity structs matching the specified criteria.

These functions are intended to be used with streams but should also work with simple lists too - but using lists to
process larger metadata files is **strongly discouraged**.

By default these functions include matching entities and exclude those that do not match, but this an be reversed.
By default `Smee.Filter.idp/2` will exclude entities that are no IdPs. But by specifying `false` as the third
parameter the filter will be inverted and exclude entities that have an IdP role.

# `assurance`
[🔗](https://github.com/Digital-Identity-Labs/smee/blob/main/lib/smee/filter.ex#L130)

```elixir
@spec assurance(enum :: Enumerable.t(), certification :: binary(), bool :: boolean()) ::
  Enumerable.t()
```

Filters a stream of entities to include or exclude those that have the specified assurance profile certification URI.

The filter is positive by default but can be inverted by specifying `false`

# `days`
[🔗](https://github.com/Digital-Identity-Labs/smee/blob/main/lib/smee/filter.ex#L212)

```elixir
@spec days(enum :: Enumerable.t(), days :: integer(), bool :: boolean()) ::
  Enumerable.t()
```

Filters a stream of entities to include or exclude those that were registered within the specified number of days.

Entities without a date will be included in the inverted results.

The filter is positive by default but can be inverted by specifying `false`

# `entity_category`
[🔗](https://github.com/Digital-Identity-Labs/smee/blob/main/lib/smee/filter.ex#L102)

```elixir
@spec entity_category(enum :: Enumerable.t(), category :: binary(), bool :: boolean()) ::
  Enumerable.t()
```

Filters a stream of entities to include or exclude those that have the specified entity category URI.

The filter is positive by default but can be inverted by specifying `false`

# `entity_category_support`
[🔗](https://github.com/Digital-Identity-Labs/smee/blob/main/lib/smee/filter.ex#L116)

```elixir
@spec entity_category_support(
  enum :: Enumerable.t(),
  category :: binary(),
  bool :: boolean()
) ::
  Enumerable.t()
```

Filters a stream of entities to include or exclude those that have the specified entity category support URI.

The filter is positive by default but can be inverted by specifying `false`

# `fresh`
[🔗](https://github.com/Digital-Identity-Labs/smee/blob/main/lib/smee/filter.ex#L196)

```elixir
@spec fresh(enum :: Enumerable.t(), bool :: boolean()) :: Enumerable.t()
```

Filters a stream of entities to include or exclude those that were registered within the last 7 days.

Entities without a date will be included in the inverted results.

The filter is positive by default but can be inverted by specifying `false`

# `idp`
[🔗](https://github.com/Digital-Identity-Labs/smee/blob/main/lib/smee/filter.ex#L46)

```elixir
@spec idp(enum :: Enumerable.t(), bool :: boolean()) :: Enumerable.t()
```

Filters a stream of entities to include or exclude those that have an IdP role.

The filter is positive by default but can be inverted by specifying `false`

# `registered_after`
[🔗](https://github.com/Digital-Identity-Labs/smee/blob/main/lib/smee/filter.ex#L180)

```elixir
@spec registered_after(
  enum :: Enumerable.t(),
  date :: Date.t() | binary(),
  bool :: boolean()
) ::
  Enumerable.t()
```

Filters a stream of entities to include or exclude those that were registered after the specified date.

Dates can be Date structs or binary strings in the format "YYYY-MM-DD"

Entities without a date will be included in the inverted results.

The filter is positive by default but can be inverted by specifying `false`

# `registered_before`
[🔗](https://github.com/Digital-Identity-Labs/smee/blob/main/lib/smee/filter.ex#L161)

```elixir
@spec registered_before(
  enum :: Enumerable.t(),
  date :: Date.t() | binary(),
  bool :: boolean()
) ::
  Enumerable.t()
```

Filters a stream of entities to include or exclude those that were registered before the specified date.

Dates can be Date structs or binary strings in the format "YYYY-MM-DD"

Entities without a date will be included in the inverted results.

The filter is positive by default but can be inverted by specifying `false`

# `registered_by`
[🔗](https://github.com/Digital-Identity-Labs/smee/blob/main/lib/smee/filter.ex#L145)

```elixir
@spec registered_by(enum :: Enumerable.t(), registrar :: binary(), bool :: boolean()) ::
  Enumerable.t()
```

Filters a stream of entities to include or exclude those that were registered at a particular federation, using the
  specified URI.

The filter is positive by default but can be inverted by specifying `false`

# `sp`
[🔗](https://github.com/Digital-Identity-Labs/smee/blob/main/lib/smee/filter.ex#L57)

```elixir
@spec sp(enum :: Enumerable.t(), bool :: boolean()) :: Enumerable.t()
```

Filters a stream of entities to include or exclude those that have an SP role.

The filter is positive by default but can be inverted by specifying `false`

# `tag`
[🔗](https://github.com/Digital-Identity-Labs/smee/blob/main/lib/smee/filter.ex#L84)

```elixir
@spec tag(enum :: Enumerable.t(), tag :: binary() | atom(), bool :: boolean()) ::
  Enumerable.t()
```

Filters a stream of entities to include or exclude those that have the specified tag.

It's best to provide the tag as a string.

The filter is positive by default but can be inverted by specifying `false`

# `trustiness`
[🔗](https://github.com/Digital-Identity-Labs/smee/blob/main/lib/smee/filter.ex#L71)

```elixir
@spec trustiness(enum :: Enumerable.t(), trustiness :: float(), bool :: boolean()) ::
  Enumerable.t()
```

Filters a stream of entities to include or exclude those that have a trustiness equal or less than the specified number.

Trustiness values are between 0.0 and 0.9.

The filter is positive by default but can be inverted by specifying `false`

# `uri`
[🔗](https://github.com/Digital-Identity-Labs/smee/blob/main/lib/smee/filter.ex#L28)

```elixir
@spec uri(enum :: Enumerable.t(), uris :: list() | binary(), bool :: boolean()) ::
  Enumerable.t()
```

Filters a stream of entities to include or exclude those that have one of the specified IDs.

The filter is positive by default but can be inverted by specifying `false`

---

*Consult [api-reference.md](api-reference.md) for complete listing*
