Write once, run anywhere. The same GUI code for Jupyter notebooks and terminal applications.
Automatically detects whether you're in Jupyter or terminal and displays the appropriate interface. No code changes needed.
Remembers your input values between sessions. Perfect for iterative workflows and parameter tuning.
Save and load parameter sets as YAML files. Share configurations with your team or across projects.
Run Jupyter notebooks from the terminal with the ezinput command. Perfect for batch processing.
Text input, sliders, dropdowns, file pickers, checkboxes, and more. All with consistent API across environments.
Replace input() calls with EZInput widgets. Minimal code changes for maximum functionality gain.
pip install ezinput
For development version:
pip install git+https://github.com/HenriquesLab/EZInput.git
from ezinput import EZInput
gui = EZInput("my_first_app")
name = gui.add_text("name", "What's your name?")
age = gui.add_int_range("age", "Age:", 0, 120)
gui.show()
print(f"Hello {name.value}, you are {age.value} years old!")
This exact code works in both Jupyter notebooks and terminal! 🎉
📓 Jupyter Note: In notebooks, put the code that accesses .value (like the print statements) in a separate cell below gui.show(). Run it after you've entered your values!
from ezinput import EZInput
from pathlib import Path
# Create GUI with a memorable title (configs saved under this name)
gui = EZInput("image_segmentation_v3")
# File selection (text input with path)
input_file = gui.add_text("input_tif", "Input file path:", placeholder="/path/to/image.tif")
# Processing parameters with bounds
threshold = gui.add_float_range("threshold", "Threshold:", 0.0, 1.0)
min_size = gui.add_bounded_int_text("min_size", "Min object size:", 10, 1000)
# Optional settings
gpu_accel = gui.add_check("use_gpu", "Use GPU acceleration?")
method = gui.add_dropdown("method", ["watershed", "otsu", "adaptive"],
"Segmentation method:")
# Display the GUI
gui.show()
# Access values
print(f"Processing {input_file.value}")
print(f"Threshold: {threshold.value}, Method: {method.value}")
📓 Jupyter Note: In notebooks, create a new cell after gui.show() for the code that accesses widget values. This allows you to interact with the widgets before accessing their values.
Execute your Jupyter notebooks as command-line tools with ezinput:
# Run a notebook from terminal
ezinput my_analysis.ipynb
# Works with EZInput GUIs inside the notebook!
# Prompts appear in terminal, configs are loaded automatically
Perfect for batch processing, automation, and integrating notebooks into pipelines.
The same code works identically in:
No modifications needed! EZInput automatically detects the environment and adapts.
# First run
gui = EZInput("analysis")
threshold = gui.add_float_range("thresh", "Threshold:", 0, 1)
gui.show()
# User enters 0.75
# Second run (tomorrow)
gui = EZInput("analysis")
threshold = gui.add_float_range("thresh", "Threshold:", 0, 1)
gui.show()
# Default is now 0.75! ✨
# Save current parameters
gui.save_parameters("optimal_params.yml")
# Load saved parameters
gui.load_parameters("optimal_params.yml")
# Share with team!
# Config saved to: ~/.ezinput/optimal_params.yml
load_parameters())remember_value=True parameter)