-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathinteractive_cli.py
65 lines (49 loc) · 1.69 KB
/
interactive_cli.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Interactive CLI for Skilpad Automatic Data Analysis
Project Name: Skilpad Automatic Data Analysis
Author: Antonio Fin
Email: [email protected]
Date: 2023/08/07
Version: Prototype
Description:
This file handles the interactive Command Line Interface (CLI) for the Skilpad Automatic Data Analysis
project. It provides functions to print the status on the terminal and to read input from the keyboard,
ensuring a smooth user experience.
Functions:
1. print_status: Prints the current status or a given message on the terminal.
2. read_input: Reads input from the keyboard.
Usage:
Import this module into the main project file or any other module that requires user interaction
through the CLI.
Example:
from interactive_cli import print_status, read_input
print_status("Starting the data search...")
user_input = read_input("Enter the dataset name: ")
"""
from bullet import Bullet
def print_status(message: str):
"""Prints the current status or a given message on the terminal."""
print(message)
def read_input(prompt: str) -> str:
"""Reads input from the keyboard."""
return input(prompt)
def select_list(list: [str]) -> str:
cli = Bullet(
prompt="\nSelect a Dataset: ",
choices=list,
indent=0,
align=2,
margin=0,
shift=0,
bullet="",
pad_right=3,
return_index=True
)
return cli.launch()
if __name__ == "__main__":
# For testing or initialization purposes, if required.
print_status("Testing the interactive CLI...")
user_input = read_input("Enter something: ")
print(f"You entered: {user_input}")