Skip to content

Overview

PICLE - Python Interactive Command Line Shells

PICLE is a module to construct interactive command line shell applications.

PICLE build on top of Python standard library CMD module and uses Pydantic models to construct shell environments.

If the readline module is loaded (pyreadline3), input will automatically inherit bash-like history-list editing (e.g. Control-P scrolls back to the last command, Control-N forward to the next one, Control-F moves the cursor to the right non-destructively, Control-B moves the cursor to the left non-destructively, etc.).

Installation

Install PICLE from PyPI using pip

pip install picle

Comparison With Other Projects

python-nubia by Facebook - unfortunately this project no longer maintained, it also provides no integration with Pydantic.

python-fire, click or argparse - all these libraries are great for building command line tools, but they provide no support for interactive shell or input validation supported by Pydantic.

prompt-toolkit or textual - those are extremely good libraries for building Terminal User Interface (TUI) applications but they provide no support for interactive shell and Pydantic validation of input.

Back to top