NewYour coding agent can read the release notes before it upgrades.Set up the MCP server →
PyPI · #1512 most downloaded on PyPI
Collection of common python utils
Last release 7 months ago
04 Mar 2026
Release timing varies
gaps range from 2 weeks to 8 months
Most releases are documented
notes for 35 of 39 stable releases
Nothing withdrawn
no release was ever pulled
5 years old
39 releases · first in 2021
One column per quarter.
Add a epy.getuser , colab-friendly alias of getpass.getuser
epy:
epy.classpropertyepy.getuser, colab-friendly alias of getpass.getuserepy.pretty_repr_top_level is miss-used.dict subclasses to epy.pretty_repr.epy.Lines.Repr to escape quotes '' when displayecolab:
ecolab.inspect (or ;i) now display proto extensions.adhoc:
inspect.getfile cache is correctly reset__getattr__.ecolab.iter_tab(): Each element will be displayed in a new tab.epath:
path.absolute()path.listdir(), a convenience alias for list(path.iterdir())adhoc : Better error message for adhoc invalidate with epy.reraise
ecolab:
adhoc: Better error message for adhoc invalidate with epy.reraisepatch_graphviz();l and ;hadhoc.inspect: Cleaner display for protosepath:
path.is_file() when the file do not exists.edc:
edc.ContextStack() util for a thread-safe / contextvars-awareepy:
epy.pretty_repr supports collections.UserDict, pydantic,immutabledict objects.epy.pretty_repr dict keys are pretty-printed.__setattr__ and __delattr__ on LazyModules.epy.ContextVar descriptor that were sharing their state.etree:
etree.copy to copy a tree structure without modifying its leavesenp : Fix orbax ArraySpec issue.
enp:
Add enp.flatten / enp.unflatten to flatten batch shape using an einops-like syntax.
enp:
enp.flatten / enp.unflatten to flatten batch shape using anAdd experimental util for ml_python + multi-process compatibility for adhoc-imports (when using PyGrain).
epy:
epy.lazy_api_imports: Make lazy importing thread safe.epy.StrEnum: Fix != operator.epath:
hf:// urls.ecolab:
Make enp.testing.parametrize_xnp() import only requested xnp modules.
enp:
enp.testing.parametrize_xnp() import only requested xnp modules.ecolab:
ecolab.inspect: Proto are better displayed (hide attributesDESCRIPTOR, Extensions in sub-section)epy:
epy.lazy_api_imports: Fix infinite recursion when importing sub-moduleexm:
Add frozen dataclass support for epy.ContextManager
epy:
epy.ContextManagerepy.StrEnum truly case-insensitivefiddle supports to epy.pretty_reprenp: Add ArraySpec support for grain.python.SharedMemoryArrays.Return Python 3.10 support.
Allow extra kwargs in eapp.make_flags_parser()
eapp:
eapp.make_flags_parser()epath:
epy:
epy.is_test to check whether we're running in a test environment.epy.typing.Json.epy.ExitStack which allows setting the contextmanagers during init.epy.binary_adhocexm:
exm.url_to_python_only_logs() and exm.curr_job_name() to addexm.current_experiment crashSupport pydantic serialization of epath.Path
epath:
Fix an infinite recursion on is_relative_to for Python>=3.12.
epath:
is_relative_to for Python>=3.12.Add epy.lazy_api_imports to lazy-import __init__.py symbols.
epy:
epy.lazy_api_imports to lazy-import __init__.py symbols.epy.cached_propertyepy.lazy_imports: Error callback accept a str to auto-re-raise
with additional info.epy.lazy_imports() with epy.binary_adhoc().ecolab:
reload_workspace=True to adhoc to auto-reload from workspaceecolab.get_permalink()ecolab.inspect not finding static files when the kernel contain
partial etils deps.epath:
importlib.resources.files return MultiplexedPathgs:// URI for 3.12.walk 3.12 error (topdown -> top_down rename)epy.pretty_repr: Add support for namedtuple
epy:
epy.pretty_repr: Add support for namedtupleecolab:
ecolab.disp(obj);h for syntax highlighting with auto-displayAdd mode to epath.Path.stat output. Does not work for Windows nor when tf.io.gfile is used.
epath:
mode to epath.Path.stat output. Does not work for Windows nor
when tf.io.gfile is used..walk to epath.Path. Similar usage than pathlib.Path.walkepy:
epy.reverse_fstring: Reverse fstring parsingreload= for epy.binary_adhoc(), fixed behavior for
consistency with ecolab.adhocepy.pprint: Pretty print an object (including dataclass).epy.pretty_repr_top_levelepy.wraps_cls equivalent of functools.wraps but for classes.epy.lazy_imports(error_callback=) has now signature
(Exception) -> None (instead of (str) -> None)epy.pretty_repr missing trailing , for tuple with single
element.ecolab:
ecolab.auto_display: Better representation when line is
displayedadhoc that delete sub-module when invalidate=Falseadhoc with reload_mode=UPDATE_INPLACE now supports enums, so old
versions compare equal to new versions. Enums compared as a is FOO
might still fail.adhoc with reload_mode=UPDATE_INPLACE is now much faster.cell_autoreload=True the default reload_mode is
now UPDATE_INPLACE.exm:
exm.set_citc_source() to specify which workspace to use when
using XManager on Colabetree:
is_leaf kwarg to .map and .parallel_mapenp:
ArraySpec support for flax.linen.summary.Added protobuf repeated fields support to ecolab.inspect
ecolab:
ecolab.inspectecolab.auto_display:
;s, ;a, ;i,
;p,...)ecolab.highlight_html to escape HTML string.epy:
epy.lazy_imports() support adhoc imports (will re-create the original
ecolab.adhoc context when resolved)epy.binary_adhoc() to add adhoc imports when using Python
interpreter.epy.lazy_imports() supports error and success callbacks
(error_callback/success_callback).epy.pretty_repr support attr dataclass-like objects.exm:
with xm.create_experiment()ecolab:
ecolab.inspectecolab.auto_display:
;s, ;a, ;i,
;p,...)ecolab.highlight_html to escape HTML string.epath:
path.mkdir now supports mode= (for os.path and gfile backend).epy:
epy.lazy_imports() support adhoc imports (will re-create the original
ecolab.adhoc context when resolved)epy.binary_adhoc() to add adhoc imports when using Python
interpreter.epy.lazy_imports() supports error and success callbacks
(error_callback/success_callback).epy.pretty_repr support attr dataclass-like objects.exm:
with xm.create_experiment()Fix import error in IPython when 7.0 <= version < 8
ecolab:
epath:
Fix glob issue when used with ffspec.
epath:
glob issue when used with ffspec.Auto display statements ending with ; (assignments, return statements, expressions,...).
ecolab:
; (assignments, return
statements, expressions,...).epath:
missing_ok=False kwargs to path.rmtree.fsspec_backend relying on fsspec to handle GCS/S3 without needing
TensorFlow. This means that gcsfs and s3fs become required
dependencies to read respectively GCS and S3. TensorFlow is no more
required. Note: If TensorFlow is installed, we still default to
the tf_backend for backward compatibility.path.glob raise an error if insufficient permission.enp:
ArraySpec.from_array:
orbax metadata supportepy:
epy.pretty_repr for pretty print an object (including dataclass).epy.diff_str for pretty diff print of 2 objects.epy.is_namedtupleetree:
etree.map for namedtuple (Python backend)lazy_imports: More lazy imports
lazy_imports: More lazy importsepath: Remove circular depsAdd @epy.lazy_imports to lazyly import modules.
epy:
@epy.lazy_imports to lazyly import modules.@epy.frozen when class has custom __getattr__ecolab:
ecolab.collapse()
widget=True argument to (widget always enabled).
expanded: bool kwargs to control whether the widget is
expanded or collapsed by default.keep_proto kwargs from clear_cached_modules and
import_proto kwargs from adhoc (proto always supported)expanded argument to ecolab.json() and change default behavior
to False.enp:
etree.spec_like()) hashable.enp.lazy.is_tf returns True for tf.TensorSpecarray_types.dtypes and array_types.typing (should use
enp.dtypes and enp.typing instead).epath:
owner and group to epath.Path.stat output. Does not work for
Windows nor when tf.io.gfile is used.etree:
etree.map for collections.defaultdictinternal:
unwrap_on_reload to save/restore original function after a
module is reloaded (e.g. on colab)Add widget=True argument to ecolab.collapse() for better interactivity.
ecolab:
widget=True argument to ecolab.collapse() for better
interactivity.ecolab.highlight_html(code) to add syntax highlighting to cell
outputs of specific objects.edc:
contextvars option: Fields annotated as edc.ContextVars[T] are
wrapped in contextvars.ContextVars._: dataclasses.KW_ONLY__repr__ now also pretty-print nested dataclasses, list, dict,...enp:
ArraySpec support grain.ArraySpec (allow support
etree.spec_like(ds.element_spec) on grain datasets)epy:
epy.Lines.make_block for custom pretty print classes, list,...etree.spec_like support f32,... annotations (when fully defined).
enp:
etree.spec_like support f32,... annotations (when fully defined).etree:
optree backend.ecolab:
ecolab.auto_inspect() to allow inspecting all colab outputs.ecolab.inspect issues (e.g. when used on metaclasses,...).ecolab.inspect support for Jupyter notebook (non-Colab).Fix warning during pip install (missing epath-no-tf)
enp:
torch==2.0 compatibility.pip install (missing epath-no-tf)Add enp.lazy.LazyArray to lazily check isinstance(array, enp.lazy.LazyArray) without triggering TF, jax,... imports
enp:
torch support!enp.lazy.LazyArray to lazily check
isinstance(array, enp.lazy.LazyArray) without triggering TF,
jax,... importsskip=['jnp', ...] kwarg to enp.testing.parametrize_xnp to
exclude a specific xnp module from tests.enp.compat function to fix compatibility issues between Jax, TF,
torch, numpy (e.g. x.astype() missing from torch, but working in
jax, tf, np).enp.linalg to enp.compat.enp.lazy. methods for conversions from/to dtypeecolab:
ecolab.inspect for interactively inspect any Python objects.ecolab.json for interactive expandable JSON display.ecolab.auto_plot_array
torchecolab.auto_plot_array(height=None)mediapy default options with show_images_kwargs
and show_videos_kwargsecolab.interruptible for graceful interruption of loops.lazy_imports: unlock auto-complete,
docstring tooltip, do not trigger linter errors anymore
("xxx" is not definedPylancereportUndefinedVariable).etree:
from etils import etree now expose the Python backend (
etree.map,...). Other backend are still available as previously
(etree.jax.map,...)epy:
epy.splitby to split an iterator in 2, based on a predicate.
(e.g. small, big = epy.splitby([20, 1, 30, 1, 2], lambda x: x > 10))Added: etree.stack to stack/batch multiple trees of arrays together.
etree:
etree.stack to stack/batch multiple trees of arrays together.etils.etree.py backend (pure Python implementation to avoid
installing extra deps).etree.map (as convenience to access the corresponding
map_structure).enp:
enp.batch_dot: Always dot product on the last axis with
broadcasting support (while np.dot is inconsistent 1-D vs 2-D).enp.angle_between to compute angle between 2 n-dimensions
vectors.enp.project_onto_vector, enp.project_onto_plane supports
broadcasting.TF accidentally imported when using enp.linalg functions.ecolab:
ecolab.patch_graphviz to fix Colab display with graphviz.ecolab.set_verbose to activate stderr logging on Colab.ecolab.clear_cached_modules accept single strecolab.clear_cached_modules has a invalidate=False to not
invalidate previous instances of the modules.edc:
edc.repr, for functional use or directly assign class
members (e.g. __repr__ = edc.repr)eapp:
eapp.better_logging() do not raise is_borg AttributeError
anymore.epath:
local_path.copy('gs://') uses the correct backend.Added: .make_flags_parser to define CLI flags through dataclasses.
eapp (Added):
.make_flags_parser to define CLI flags through dataclasses..better_logging to display logs by default, tqdm
compatibility,...epy:
@epy.frozen class decorator to make class immutableedc:
@edc.dataclass can be annotated with x: edc.AutoCast[T] (for auto-normalization).ecolab:
ecolab.clear_cached_modules to reload modules (useful for
interactive development)etils.lazy_imports supports multi-import (e.g. using
concurrent also trigger concurrent.futures import).Fix performance issues for path.mkdir.
epath:
path.stat()path.mkdir.ecolab:
from etils.lazy_imports import * alias of from etils.ecolab.lazy_imports import *.builtins module for example.edc:
.replace only added once (not in subclasses).ecolab: Added dataclass_array to lazy_imports.
ecolab: Added dataclass_array to lazy_imports.Added: More array types: complex64,...
array_types:
complex64,...array_types.dtypes.DType to support more
flexible dtype expression (AnyFloat, type union,...)FloatArray, IntArray do supports any float, int without
casting.f32.dtype) are now
array_types.dtypes.DType.ecolab:
lazy_imports.print_current_imports to display the active lazy
imports (e.g. to add imports before publishing a colab).epy:
epy.ContextManager to create yield-based contextmanager class
(see
discussion)epy.issubclass (like issubclass but does not raises error for
non-types)epy.groupby, like itertools.groupby but returns a dict.epy.Lines.make_block helper to create code blocks (function
calls,...)epy.StrEnum raises better error message if invalid input.epath
epath.DEFINE_path for absl.flags supportrglob, glob('**/')) now raise an
error rather than being silently ignored.path.as_uri() returns gs:// and s3:// (rather than
file:///gs/)__eq__ and __hash__ for resource path.edc
__repr__ is correctly added in Python 3.10 (#143)dc.frozen() compatibility with autograd.dc.unfrozen()now supports jax.tree_map.dc.unfrozen() repr which display overwritten fields.enp:
enp.check_and_normalize_arrays util to dynamically validate
array dtype/shape from typing annotations.enp.linalg.normalize util.enp.project_onto_vector and enp.project_onto_plane geometry
utils.Remove TensorFlow dependency from epath.Path by default. (For now accessing gs:// still require TF to be installed).
epath:
epath.Path by default. (For now
accessing gs:// still require TF to be installed).epath.testing.mock_epath to mock GCS calls.epy.testing:
epy.testing.subtest for better subtests support.epy.testing.non_hermetic to mark non-hermetic tests.oss-kit:
pypi-auto-publish GitHub action for automated PyPI and GitHub releasesNow has a __all__ to allow from etils.array_types import *
array_utils:
__all__ to allow from etils.array_types import *FloatArray and IntArray have dtype to np.float32 and np.int32ecolab:
with ecolab.adhoc():contextmanager for dynamic code import.ecolab.lazy_importsenp:
enp.linalg alias of enp.compatenp.testing.parametrize_xnp now has a restrict kwargepy:
StrEnum is now case-insensitiveExpose enp.lazy to the public API to help design code compatible with jax, np, tf
enp:
enp.lazy to the public API to help design code compatible with
jax, np, tfenp.compat for ops compatibles with both TF, Jax, Npenp.tau constantenp.testing.parametrize_xnp fixture to test a function with both
jax, tf, npenp.testing.set_tnp fixture to activate tf numpy mode.ecolab:
from etils.ecolab.lazy_imports import * to lazy-import common
Python modulesecolab.display_array_as_img -> ecolab.auto_plot_arrayecolab.auto_plot_array now supports multi-images & video.etree: Add assert_same_structure on the backendepy: Add epy.zip_dictetree.spec_like: Inspect a nested structure
edc: Dataclasses utilsetree:
etree.spec_like: Inspect a nested structureenp:
enp.interp: Scale arraysenp.normalize_bytes2str: Normalize str arraysecolab:
ecolab.collapse_xyz() by unified ecolab.collapse()* Add text utils: * epy.Lines * epy.dedent
epy.Linesepy.dedent<!-- mdlint off(LINK_UNUSED_ID) -->
<!-- mdlint off(LINK_UNUSED_ID) -->
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Your coding agent can read these notes before it upgrades. Set up the MCP server →