# epy

[[[Source]]](https://github.com/google/etils/tree/main/etils/epy/__init__.py)

```{code-block}
from etils import epy
```

```{eval-rst}
.. automodule:: etils.epy
  :no-members:
```

## All symbols


### Module

|  |  |
--- | ---
[epy](index) | Python utils public API.
[epy._internal](_internal/index) | `etils` internal utils.
[epy.typing](typing/index) | Typing utils.

### Class

|  |  |
--- | ---
[epy.ContextManager](ContextManager) | ContextManager allows to define contextmanager class using yield-syntax.
[epy.ExitStack](ExitStack) | Like `contextlib.ExitStack` but allows to set contextmanagers at init time.
[epy.Lines](Lines) | Util to build multi-line text.
[epy.StrEnum](StrEnum) | Like `Enum`, but `enum.auto()` assigns `str` rather than `int`.
[epy.classproperty](classproperty) | Decorator combining `property` and `classmethod`.

### Function

|  |  |
--- | ---
[epy._internal.check_missing_deps](_internal/check_missing_deps) | Raise a better error message in case of `ImportError`.
[epy._internal.unwrap_on_reload](_internal/unwrap_on_reload) | Unwrap the function to support colab module reload.
[epy._internal.wraps_with_reload](_internal/wraps_with_reload) | Wrap the function to support colab module reload.
[epy.binary_adhoc](binary_adhoc) | 
[epy.dedent](dedent) | Wrapper around `textwrap.dedent` which also `strip()` the content.
[epy.diff_str](diff_str) | Pretty diff between 2 objects.
[epy.frozen](frozen) | Class decorator which prevent mutating attributes after `__init__`.
[epy.getuser](getuser) | Returns the user running the code.
[epy.groupby](groupby) | Similar to `itertools.groupby` but return result as a `dict()`.
[epy.is_namedtuple](is_namedtuple) | Returns `True` if the value is instance of `NamedTuple`.
[epy.is_notebook](is_notebook) | Returns True if running in a notebook (Colab, Jupyter) environment.
[epy.is_test](is_test) | Returns True if running in a test environment.
[epy.issubclass](issubclass) | Like `issubclass`, but do not raise error if value is not `type`.
[epy.lazy_api_imports](lazy_api_imports) | Lazy-import an API (`__init__.py`).
[epy.lazy_imports](lazy_imports) | Context Manager which lazy loads packages.
[epy.maybe_reraise](maybe_reraise) | Context manager which reraise exceptions with an additional message.
[epy.pprint](pprint) | Pretty print `obj`.
[epy.pretty_repr](pretty_repr) | Pretty `repr(obj)` for nested list, dict, dataclasses,...
[epy.pretty_repr_top_level](pretty_repr_top_level) | Pretty `repr(obj)` for nested list, dict, dataclasses,...
[epy.reraise](reraise) | Reraise an exception with an additional message.
[epy.reverse_fstring](reverse_fstring) | Reverse f-string.
[epy.splitby](splitby) | Split the iterable into 2 lists (false, true), based on the predicate.
[epy.wraps_cls](wraps_cls) | Equivalent of `functools.wraps` but for classes.
[epy.zip_dict](zip_dict) | Iterate over items of dictionaries grouped by their keys.

### Typing

|  |  |
--- | ---
[epy.typing.Json](typing/Json) | 
[epy.typing.JsonDict](typing/JsonDict) | 


```{toctree}
:hidden:

ContextManager
ExitStack
Lines
StrEnum
_internal/index
binary_adhoc
classproperty
dedent
diff_str
frozen
getuser
groupby
is_namedtuple
is_notebook
is_test
issubclass
lazy_api_imports
lazy_imports
maybe_reraise
pprint
pretty_repr
pretty_repr_top_level
reraise
reverse_fstring
splitby
typing/index
wraps_cls
zip_dict
```