# `Otera.Unicode`
[🔗](https://github.com/georgeguimaraes/otera/blob/v0.1.0/lib/otera/unicode.ex#L1)

The character properties of Python `str` methods, such as `isprintable()`, `isdigit()` and the cased letters of `title()`.

The properties come from `priv/unicode_properties.json`, which `scripts/generate_unicode_properties.py` writes from the predicates of the pinned Python, so Otera uses the Unicode version of the Python reference and not the one of Erlang/OTP. Each property is a sorted tuple of code point ranges, and a lookup is a binary search.

# `alpha?`

```elixir
@spec alpha?(char()) :: boolean()
```

Returns true for a letter, like `str.isalpha()`.

# `cased?`

```elixir
@spec cased?(char()) :: boolean()
```

Returns true for a cased character: a lowercase, uppercase or titlecase letter.

# `decimal?`

```elixir
@spec decimal?(char()) :: boolean()
```

Returns true for a decimal digit, like `str.isdecimal()`.

# `digit?`

```elixir
@spec digit?(char()) :: boolean()
```

Returns true for a digit, like `str.isdigit()`.

# `lowercase?`

```elixir
@spec lowercase?(char()) :: boolean()
```

Returns true for a character with the Lowercase property, like `str.islower()` of one character.

# `numeric?`

```elixir
@spec numeric?(char()) :: boolean()
```

Returns true for a numeric character, like `str.isnumeric()`.

# `printable?`

```elixir
@spec printable?(char()) :: boolean()
```

Returns true if Python `repr()` prints `char` as it is, like `str.isprintable()`.

# `space?`

```elixir
@spec space?(char()) :: boolean()
```

Returns true for whitespace, like `str.isspace()`.

# `uppercase?`

```elixir
@spec uppercase?(char()) :: boolean()
```

Returns true for a character with the Uppercase property, like `str.isupper()` of one character.

---

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