A stable, self-contained Python environment and utility library. RP combines a richer standard library with PTerm (a hybrid REPL/shell) and a powerful CLI.
Matlab and Mathematica enjoy large standard libraries - why not python?
RP is both:
- A standard-library++ of 1,600+ optimized, well documented functions covering images, audio, video, files, web, math, ML, system utils, and many other tools that will make your code both faster, shorter and easier to read.
- Pure Python (~2 MB), imports in ~20ms
- Minimal, stable dependencies (only long-mature packages like
six
,pygments
) - Stable API โ code written with RP in 2016 still runs unchanged today
- Functions are easy enough to read they're basically self-documenting, and most come with examples in their docstrings
-
PTerm (Pseudo Terminal): a hybrid REPL, shell, and lightweight IDE you launch with
python -m rp
.- Python evaluation with completions, editing, and history
- Shell-like commands built in (no need to leave the prompt)
- IDE-like features: inline profiling, debugging, namespace undo/redo, inline image/video display
- TLDR: It is powerful enough that nowadays, most of RP's development is done in RP
Together, RP is a single install that gives you a richer standard library and an interactive environment tuned for productivity.
pip install rp
Run:
python -m rp
Youโll enter an environment that feels familiar if youโve used IPython, but goes further:
- Write Python as usual
- Run shell-style commands without leaving the prompt
- Preview images, video frames, and syntax-highlighted text inline
- Undo namespace changes, scroll error stacks, and profile code interactively
Itโs a REPL, shell, and lightweight IDE simultaneously.
The editor is quite powerful. For example, it has multi-language syntax highlighting

It has many UI themes

RP also works directly from the shell. Useful utilities are exposed via:
# Print GPU usage and VRAM stats
rp call print_gpu_summary
# Blazing-fast fuzzy file search across millions of files
rp call r._fdt_for_command_line
# Grab a BibTeX entry from arXiv
rp call get_arxiv_bibtex --- https://arxiv.org/abs/2112.10752
#Display a file tree
rp call display_file_tree
#Add rounded corners to your copied image - which is how I'm making this README
rp exec "copy_image_to_clipboard(with_corner_radius(load_image_from_clipboard(), 60))"


Most CLI-to-Python bridges require awkward escaping or env vars. RPโs --
vs ---
system avoids this:
-
---
โ string literal (stays a string) -
--
โ evaluated as Python (typed: int, float, list, dict, etc.)
Example: invert an image in one line:
rp exec 'save_image(inverted_image(load_image(x)), y)' \
---x "image.png" \
---y "inverted.png"
Example: extract 4 frames from a video, join horizontally, save preview:
rp exec 'save_image(horizontally_concatenated_images(resize_list(load_video(x), num_frames)), y)' \
---x "video.mp4" \
--num_frames 4 \
---y "output.png"
No bash -c
, no environment variable hacks, no quoting headaches โ just direct Python expressions with typed args.
RP gives you hundreds of stable, consistently-named helpers. Functions accept common types interchangeably (NumPy, PIL, Torch, lists) and return sensible defaults. Batch variants follow natural pluralization (load_image
โ load_images
).
Examples:
img = load_image("[https://example.com/photo.jpg](https://example.com/photo.jpg)")
img = resize_image(img, (800, 600))
img = gauss_blur(img, 2.0)
save_image(img, "output.png")
- Stability first: no breaking changes since 2016
- Type-flexible APIs: NumPy โ PIL โ Torch accepted automatically
- Sane defaults: common cases need no configuration
-
Pluralization: batch operations always mirror single-item names (
load_image(path)
vsload_images(paths)
) - Performance-conscious: lazy imports, parallel helpers, caching
Nearly every function in rp comes with documentation, many of which include full self-contained examples.
Getting started with an AI coding assistant is easy - just tell it to read the "autodocs" folder, and it will quickly understand this library.
MIT โ use it freely.
Because it saves you time. Instead of stitching together many small libraries and juggling shells, REPLs, and editors, you can:
- Import once and use a consistent API for most everyday tasks
- Drop into PTerm for a unified Python + shell + IDE environment
- Run utilities directly from the command line (
rp call โฆ
/rp exec โฆ
) - Trust that your code will still run years from now
For example, the rp.explore_torch_module(...)
function lets you interactively explore pytorch modules and pipelines.
RP also contains many tools for dealing with images and graphics. For example, this paint application is bundled as a demo
( Video: https://www.youtube.com/watch?v=RqmV44Kckr8 )
There are several useful tools that I will be adding to documentation in the coming months.