Registry / data / pypyp
library1.3.0pypypi✓ verified 27d ago

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 pypyp
INSTALL
IMPORT
SIG · PYPYP
P
pypyp
datapythonv1.3.0
Install
1.6s avg
Import
Disk
16MB
Pass rate
10/ 10
Env Coverage10 / 10
glibc
3.93.13
musl
3.93.13
Install & Compatibility
Where this runs
tested against v1.3.0 · pip install
no network on importno background threads
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
py 3.103.95 runs
installs and imports cleanly · install 0.0s · import 0.000s · 17.8MB
glibc
py 3.103.95 runs
installs and imports cleanly · install 1.6s · import 0.000s · 18MB
16MB installed
● package 16MB
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

cli_entrypoint
from pyp import cli_entrypoint
from pyp import cli_entrypoint

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'.

echo "hello world" | pypyp 'x.upper()'
pypyp --version
Debug
Known issues
gotchaUnderstanding the input variables (`x`, `_`, `_i`) is crucial. `x` always refers to the raw input (a line when iterating, or the full input if not iterating). `_` refers to the currently iterated item (e.g., after `x.split()`). `_i` is the iteration index.
fix
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.
affects: All versions
gotchaShell quoting can be tricky for Python expressions. Depending on the shell and the complexity of your Python code (e.g., involving dollar signs, backticks, or other shell special characters), you might need to experiment with single vs. double quotes, or escaping.
fix
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')"`).
affects: All versions
gotchapypyp is designed for concise, single-expression or short-script execution. While it uses the full Python interpreter, it's not optimized for running large, multi-file Python applications. Performance and best practices for complex scripts should use standard `python` execution.
fix
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`.
affects: All versions
Upgrade
Version history
1.3.0latest on PyPI · released Dec 27, 2024
Audit
Dependencies

No dependency data recorded yet.

Agent activity
33 hits · last 30 days
node
28
OpenAI (training)
1
Resources
pypyp — pip install pypyp · libregistry