Read–Eval–Print Loop Interpreter
Project description
🫥 Read–Eval–Print Loop Interpreter (REPLI)
This is a Python package for building Read–Eval–Print Loop (REPL) applications.
Features:
- Breadcrumbs
- Interface panel
- Pagination
────────────────────────────────────────────────────────────────
home
────────────────────────────────────────────────────────────────
╭─ commands ───────────────────────────────────────────────────╮
│ 1 page 1 │
│ 2 page 2 │
╰──────────────────────────────────────────────────────────────╯
╭─ builtins ───────────────────────────────────────────────────╮
│ e exit │
│ q previous page │
╰──────────────────────────────────────────────────────────────╯
> _
Install
Pip:
pip install repli
Poetry:
poetry add repli
Usage
from repli import Interpreter, Page
from repli.callback import NativeFunction, Subprocess
page = Page(name='0', description='home')
@page.command(name='1', description='command 1', type=NativeFunction)
def command_1(*args) -> None:
print('command 1')
@page.command(name='2', description='command 2', type=Subprocess)
def command_2(*args) -> str:
return 'echo command 2'
interpreter = Interpreter(page=page)
interpreter.loop()
See example.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
repli-0.1.3.tar.gz
(7.7 kB
view details)
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
repli-0.1.3-py3-none-any.whl
(9.8 kB
view details)
File details
Details for the file repli-0.1.3.tar.gz.
File metadata
- Download URL: repli-0.1.3.tar.gz
- Upload date:
- Size: 7.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.9.21
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
5e0f8f2adc39b95f16be05f538903ebf96f38b90e2d6f4dc15cbb59006b5f82d
|
|
| MD5 |
e73298a36b221176b695e9118396e82e
|
|
| BLAKE2b-256 |
2f7368191689f88ef1b512d748a95f357092551ef20ea13d252b771d6d9f1c1b
|
File details
Details for the file repli-0.1.3-py3-none-any.whl.
File metadata
- Download URL: repli-0.1.3-py3-none-any.whl
- Upload date:
- Size: 9.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.9.21
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
590b2f461e491fb2077453dc3515e4fc179538144847ec22dedd861442383703
|
|
| MD5 |
7504923f8bb5e840454ae82fb54cc3bb
|
|
| BLAKE2b-256 |
4fccd2c662348e1e3dfc25928ea48d05c3e0ba0e6e6a16a89d009781b75bb9d6
|