etils - Eclectic Python Utilities

1.14.0 · active · verified Thu Apr 09

etils (eclectic utils) is an open-source collection of Python utilities designed for machine learning and scientific computing workflows. Each top-level submodule is self-contained and independent, prefixed by 'e' (e.g., `epath`, `epy`) to avoid name collisions. This modular design allows users to import only the necessary components, minimizing dependencies. The library is actively maintained, with frequent updates.

Warnings

Install

Imports

Quickstart

This example demonstrates the usage of `epath` for basic file operations. `epath.Path` extends `pathlib.Path` to seamlessly handle both local and cloud-based file paths (e.g., `gs://`, `s3://`) by integrating with respective cloud storage libraries.

from etils import epath

# epath provides a pathlib-like API with cloud storage support (gs://, s3://)
# For local paths, it behaves like pathlib.Path
local_path = epath.Path("/tmp/etils_example.txt")
local_path.write_text("Hello from etils epath!")
print(f"File created at: {local_path}")
print(f"Content: {local_path.read_text()}")

# Clean up (optional)
local_path.unlink()

view raw JSON →