# `Bourse.Safe`
[🔗](https://github.com/ZenHive/bourse/blob/main/lib/bourse/safe.ex#L1)

Safe accessors and coercions used by response normalization.

# `data`

```elixir
@type data() :: map() | list()
```

# `key`

```elixir
@type key() :: atom() | String.t() | non_neg_integer()
```

# `bool`

```elixir
@spec bool(term()) :: boolean() | nil
```

Coerces a value to a boolean when present.

# `integer`

```elixir
@spec integer(term()) :: integer() | nil
```

Coerces a value to an integer when present.

# `number`

```elixir
@spec number(term()) :: number() | nil
```

Coerces a value to a number when present.

# `string`

```elixir
@spec string(term()) :: String.t() | nil
```

Coerces a value to a string when present.

# `string_lower`

```elixir
@spec string_lower(term()) :: String.t() | nil
```

Coerces a value to a lowercase string when present.

# `value`

```elixir
@spec value(term(), key() | nil, term()) :: term()
```

Safely reads a value from a map or list, returning `default` when absent.

# `value_any`

```elixir
@spec value_any(term(), [key()], term()) :: term()
```

Safely reads the first present key from a map or list.

---

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