A CLI framework library to build responsive console interfaces
Project description
ReactiveCLI
ReactiveCLI is a CLI framework library to build responsive console interfaces.
- Description: ReactiveCLI makes it painless to create interactive interfaces on console. Change values, and states of components and they will simple update in your console menu.
- Components-Based: Using prefab components or build your own component make things easier to recicle code and avoid repetition code process.
Sumary:
Installation
Install ReactiveCLI with pip:
pip install reactivecli
Quick Start
After install ReactiveCLI with pip.
In your project create a app.py
file and write a simple menu on it:
#import component Title
from reactivecli import Title
#Create the menu callback
def menu():
#Instantiate the Title component as menu_title
menu_title = Title("Hello ReactiveCLI!")
#Return a list with the components in desired order
return [
menu_title
]
In the main file of the project create a root, pass the app menu and True[remove on final build] as arguments.
Example in main.py
:
from reactivecli import create_root
import app
#Create root with the app menu and set dev mode to true
create_root(app.menu, True)
Now open the console and run your code with python main.py
command.
This will be the expected output:
TO BE WRITTEN
Documentation
ReactiveCLI have a simple use methodology based on components.
Core
ReactiveCLI core methods and builders
create_root :
-Create a menu flow root from a menu callback-
Usage:
from reactivecli import create_root
import app
create_root(app.menu, True)
arg | type | description |
---|---|---|
menu_callback | callable | Callback that returns a list with menu components. |
dev | bool | If true the files changed will be recompiled in execution time. |
Components
ReactiveCLI are based on components. So to build up an application you need to know what components to use.
Input
Text container that can be editable in execution time and saved to use the value as you wish.
Usage:
from reactivecli import Input, Text
def menu():
name_input = Input()
age_input = Input("value")
return [
Text("Insert your name:"),
name_input,
Text("Insert your age:"),
age_input
]
TO BE WRITTEN
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 Distributions
Built Distribution
Hashes for reactivecli-1.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 9689021459832b82f9c389820ba503ee53d4ff862173d7761de5abc075a827b6 |
|
MD5 | 45154d5e25a21af09fdf7dc7b0ea7028 |
|
BLAKE2b-256 | 27fd0307a0c57939d49be8c345e02653d3edd42ec776e724a1359e41412e679f |