Read–Eval–Print Loop Interpreter
Project description
🐟 Read–Eval–Print Loop Interpreter (REPLI)
It's a Python package for building command-line terminal applications.
Features:
- Breadcrumbs
- Interface panel
- Pagination
┌──────────────────────────────────────────────────────────────┐
│ home │
├──────────────────────────────────────────────────────────────┤
│ │
│ 1 print hello world │
│ 2 do something │
│ │
├──────────────────────────────────────────────────────────────┤
│ e exit application | q quit current page │
└──────────────────────────────────────────────────────────────┘
>
Install
pip install repli
Usage
page_factory = PageFactory()
@page_factory.command(type=NativeFunction, name="1", description="print hello world")
def command_print_hello_world():
print("hello world")
@page_factory.command(type=Subprocess, name="2", description="do something")
def command_do_something():
return "echo something else"
nested_page_factory = PageFactory()
page_factory.add_page(page=nested_page_factory.get(name="3", description="nested page"))
page = page_factory.get(name="example", description="example page")
interpreter = Interpreter(page=page)
interpreter.loop()
See the example source.
Development
Requirements:
Setup environment:
poetry shell
poetry install
Run example application:
poetry run example
Format:
poetry run black ./example ./repli ./tests
Lint:
poetry run flake8
Test:
poetry run pytest
Coverage:
poetry run coverage run -m pytest
poetry run coverage report -m
Export requirements.txt:
poetry export --without-hashes --format=requirements.txt > requirements.txt
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.2.0.tar.gz
(8.1 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.2.0-py3-none-any.whl
(9.9 kB
view details)
File details
Details for the file repli-0.2.0.tar.gz.
File metadata
- Download URL: repli-0.2.0.tar.gz
- Upload date:
- Size: 8.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.9.21
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
5b49a10c3a979cb292669cc2a5fcb8d713bc79028006818af6892da07b71d875
|
|
| MD5 |
8989322e716233f5587d8f6bf0bdf838
|
|
| BLAKE2b-256 |
43f7195b4333dc88a04b1e21aa65ccbdcbf3d9c38e1b00619c02974c37ba139d
|
File details
Details for the file repli-0.2.0-py3-none-any.whl.
File metadata
- Download URL: repli-0.2.0-py3-none-any.whl
- Upload date:
- Size: 9.9 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 |
8e45867021fe30f30f3554ebca1bf4b7f93000d1d21908304efbcbbf83779384
|
|
| MD5 |
ecfce924b34f6603036c47adff47d2fb
|
|
| BLAKE2b-256 |
29242b0ba75f1643c6c4947e665f5cd46760a789da87ac8fa73b7244508696f8
|