pypyp (Python at Your Prompt) is a command-line utility that allows users to easily execute Python code directly from their shell, often leveraging shell piping for data manipulation. It's designed to be a magical yet never mysterious tool for quick data processing and scripting, similar to `awk` or `sed` but with Python's full power. The current version is 1.3.0, and releases are generally made as features or fixes are needed.
pip install pypypVerified import paths — ran on the pinned version, not inferred.
This quickstart demonstrates pypyp's core functionality: taking piped input and applying a Python expression to each line. The `x` variable holds the current line of input. The output will be 'HELLO WORLD'.
Always be mindful of which variable you are accessing. For line-by-line processing, `x` is the raw line. If you've split `x` (e.g., `x.split()`), then `_` will iterate over the parts. Refer to the official documentation for detailed examples.
For simple expressions, double quotes are often sufficient. For more complex Python code, single quotes (`'...'`) are generally safer as they prevent shell expansion of variables within the Python string. If your Python code itself needs quotes, ensure they are distinct from the shell's outer quotes (e.g., `pypyp "x.replace('old', 'new')"`).Use pypyp for quick transformations, data filtering, and one-liners. For anything that requires significant logic, multiple functions, or larger codebases, write a standard Python script and execute it with `python your_script.py`.
No dependency data recorded yet.