Skip to content

v3.0.0 🎉

Choose a tag to compare

@geyang geyang released this 12 Jan 21:43
· 24 commits to main since this release
6c05613

params-proto v3.0.0 - Official Stable Release 🎉

params-proto v3 is now stable! This is a complete redesign with a modern, decorator-based API.

Installation

pip install params-proto==3.0.0

Key Features

Decorator-Based Syntax

from params_proto import proto

@proto.cli
def train(
    lr: float = 0.001,  # Learning rate
    epochs: int = 100,  # Number of epochs
):
    """Train a model."""
    print(f"Training with lr={lr}, epochs={epochs}")

Environment Variables with OR Operation

api_key: str = EnvVar @ "API_KEY" @ "SECRET_KEY" | "default"

Hyperparameter Sweeps

from params_proto.hyper import piter

configs = piter @ {"lr": [0.001, 0.01]} * {"batch_size": [32, 64]}

Full Type Support

  • Enum, Literal, Path, Tuple types
  • Union types for subcommand-like behavior
  • Automatic type inference for untyped attributes

Documentation

What's New Since v2

  • ✅ Cleaner decorator syntax (no inheritance needed)
  • ✅ Full IDE support with type hints
  • ✅ Inline documentation becomes automatic help text
  • ✅ Support for functions, not just classes
  • ✅ Better Union types and Enum support
  • ✅ Simplified singleton pattern with @proto.prefix
  • ✅ EnvVar OR operation and lazy loading