Skip to main content

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:

  1. Installation
  2. Quick Start
  3. Documentation
    1. Core
    2. Components

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

This version

1.0

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distribution

reactivecli-1.0-py3-none-any.whl (10.7 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page