Skip to main content

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

Metadata

Release files for reactivecli 1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Built distribution (wheel)

Table of built distributions (wheels) for reactivecli 1.0
File Interpreter ABI Platform
reactivecli-1.0-py3-none-any.whl Python 3 none any Details

Release files / reactivecli-1.0-py3-none-any.whl

Download URL reactivecli-1.0-py3-none-any.whl
Size 10.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
9689021459832b82f9c389820ba503ee53d4ff862173d7761de5abc075a827b6
BLAKE2b-256 checksum
How to use checksums
27fd0307a0c57939d49be8c345e02653d3edd42ec776e724a1359e41412e679f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.10.8

Release history Release notifications | RSS feed

This release

1.0 This release

1 release file

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page