Display-tty

Latest version: v1.1.7

Safety actively analyzes 682416 Python packages for vulnerabilities to keep your Python projects secure.

Scan your dependencies

Page 1 of 2

1.1.7

[FIX] shared logger instance issues
Display tty

![PyPI - Python Version](https://img.shields.io/pypi/pyversions/display_tty)
![PyPI - Implementation](https://img.shields.io/pypi/implementation/display_tty)
![PyPI - Wheel](https://img.shields.io/pypi/wheel/display_tty)
![PyPI - Version](https://img.shields.io/pypi/v/display_tty?label=pypi%20package:%20display_tty)
![PyPI - Downloads](https://img.shields.io/pypi/dm/display_tty)
![PyPI - License](https://img.shields.io/pypi/l/display_tty)
![Execution status](https://github.com/Hanra-s-work/display_tty/actions/workflows/python-package.yml/badge.svg)
![GitHub Workflow Status (with event)](https://img.shields.io/github/actions/workflow/status/Hanra-s-work/display_tty/python-package.yml)
![GitHub repo size](https://img.shields.io/github/repo-size/Hanra-s-work/display_tty)
![GitHub Repo stars](https://img.shields.io/github/stars/Hanra-s-work/display_tty)
![GitHub commit activity (branch)](https://img.shields.io/github/commit-activity/m/Hanra-s-work/display_tty)
![GitHub last commit (branch)](https://img.shields.io/github/last-commit/Hanra-s-work/display_tty/main)

[![Static Badge](https://img.shields.io/badge/Buy_me_a_tea-Hanra-%235F7FFF?style=flat-square&logo=buymeacoffee&label=Buy%20me%20a%20coffee&labelColor=%235F7FFF&color=%23FFDD00&link=https%3A%2F%2Fwww.buymeacoffee.com%2Fhanra)](https://www.buymeacoffee.com/hanra)

Description

This is a python package I created in order to simplify the boiling process for displaying text in a geometrical shape drawn using characters.

Disclaimer

The package was originally named `disp` but had to be changed to `display_tty` because the names `disp` and `display` were already taken by other packages.

The class will still remain `Disp` but bindings named `Display`, `DispTTY` and `DisplayTTY` are available.

The Preloaded version exists under: `IDISP`, `IDISPLAY`, `IDTTY` and `IDISPTTY`

Table of Content

1. [Display tty](display-tty)
2. [Description](description)
3. [Disclaimer](disclaimer)
4. [Table of Content](table-of-content)
5. [Installation](installation)
1. [Using pip](using-pip)
2. [Using python](using-python)
6. [Usage](usage)
1. [Importing](importing)
2. [Initialising](initialising)
3. [Calling the tree function](calling-the-tree-function)
4. [Displaying a beautified Hello World](displaying-a-beautified-hello-world)
1. [Hello World as a title](hello-world-as-a-title)
2. [Hello World as a sub title](hello-world-as-a-sub-title)
3. [Hello World as a sub sub title](hello-world-as-a-sub-sub-title)
4. [Hello World as a message with adjustable delay per call](hello-world-as-a-message-with-adjustable-delay-per-call)
5. [Hello World as a message](hello-world-as-a-message)
6. [Hello World as a question message](hello-world-as-a-question-message)
7. [Hello World as an error message](hello-world-as-an-error-message)
8. [Hello World as a success message](hello-world-as-a-success-message)
9. [Hello World as a warning message](hello-world-as-a-warning-message)
10. [Hello World as an inform message](hello-world-as-an-inform-message)
7. [Change the initialisation content](change-the-initialisation-content)
1. [TOML configuration breakdown](toml-configuration-breakdown)
1. [line 1](line-1)
2. [line 2](line-2)
3. [line 3](line-3)
4. [line 4](line-4)
5. [line 5](line-5)
6. [line 6](line-6)
7. [line 7](line-7)
8. [line 8](line-8)
9. [line 9](line-9)
10. [line 10](line-10)
11. [line 11](line-11)
12. [line 12](line-12)
13. [line 13](line-13)
14. [line 14](line-14)
15. [line 15](line-15)
16. [line 16](line-16)
17. [line 17](line-17)
2. [Update the configuration of an initialised class](update-the-configuration-of-an-initialised-class)
8. [Author](author)
9. [Version](version)

Installation

Using pip

sh
pip install -U disp


Using python

Under Windows:

bat
py -m pip install -U display_tty


Under Linux/Mac OS:

sh
python3 -m pip install -U display_tty


Usage

Importing

py
from display_tty import IDTTY


Initialising

The generic class is: `Disp(toml_content: dict, save_to_file: bool = False, file_name: str = "text_output_run.txt", file_descriptor: any = None)`

For your convenience, you can use the `IDTTY` variable which is an initialised version of the class.

py
IDTTY.title("Hello World")


Otherwise, if you wish to initialise the class with your own parameters, you can do so like this:

py
from display_tty import DisplayTTY
TOML_CONF = {
'PRETTIFY_OUTPUT': True,
'PRETTY_OUTPUT_IN_BLOCS': True,
'MESSAGE_CHARACTER': '',
'MESSAGE_ERROR_CHARACTER': '',
'MESSAGE_INFORM_CHARACTER': 'i',
'MESSAGE_QUESTION_CHARACTER': '?',
'MESSAGE_SUCCESS_CHARACTER': '/',
'MESSAGE_WARNING_CHARACTER': '!',
'SUB_SUB_TITLE_WALL_CHARACTER': '*',
'SUB_TITLE_WALL_CHARACTER': '',
'TITLE_WALL_CHARACTER': '',
'TREE_COLUMN_SEPERATOR_CHAR': '│',
'TREE_LINE_SEPERATOR_CHAR': '─',
'TREE_NODE_CHAR': '├',
'TREE_NODE_END_CHAR': '└',
'MESSAGE_ANIMATION_DELAY_BLOCKY': 0.01,
'MESSAGE_ANIMATION_DELAY': 0.01
}

SAVE_TO_FILE = False
FILE_NAME = "run_results.txt"
FILE_DESCRIPTOR = None


IDTTY = DisplayTTY(
TOML_CONF,
SAVE_TO_FILE,
FILE_NAME,
)


Calling the tree function

The generic function is:

py
tree(self, title: str, data: list[str], offset: int = 0)


The output is: None

py
TEST_DATA = {
"test_data1": "test_data1.1",
"test_data2": "test_data2.1",
"test_data3": [
"test_data_list3.1",
"test_data_list3.2",
"test_data_list3.3",
"test_data_list3.4",
"test_data_list3.5"
],
"test_data4": "test_data4.1",
"test_data5": {
"test_data5.1": "test_data5.1.1",
"test_data5.2": "test_data5.2.1",
"test_data5.3": "test_data5.3.1",
"test_data5.4": "test_data5.4.1"
},
"test_data6": [
{
"test_data6.1": "test_data6.1.1",
"test_data6.2": "test_data6.2.1"
},
[
"test_data_list6.3.1",
"test_data_list6.3.1",
"test_data_list6.3.1",
"test_data_list6.3.1"
]
],
"test_data7": {
"test_data7.1": {
"test_data7.1.1": "test_data7.1.1.1",
"test_data7.1.2": "test_data7.1.2.1"
},
"test_data7.2": [
"test_data7.2.1",
"test_data7.2.2",
"test_data7.2.3",
"test_data7.2.4",
"test_data7.2.5"
]
}
}

IDTTY.tree("This is a test tree", TEST_DATA, 0)


Displaying a beautified Hello World

Hello World as a title

The generic function to display `Hello World!` as a title is:

py
title(self, title)


The outputs is: None

py
IDTTY.title("Hello World !")


Hello World as a sub title

The generic function to display `Hello World!` as a sub title is:

py
sub_title(self, sub_title)


The outputs is: None

py
IDTTY.sub_title("Hello World !")


Hello World as a sub sub title

The generic function to display `Hello World!` as a sub sub title is:

py
sub_sub_title(self, sub_sub_title)


The outputs is: None

py
IDTTY.sub_sub_title("Hello World !")


Hello World as a message with adjustable delay per call

The generic function to display `Hello World!` as a message is:

py
animate_message(self, message: str = "Hello World!", delay: float = 0.02)


The outputs is: None

py

1.1.6

[ADD] rebinds for the disp_print_* logging functions.
Display tty

![PyPI - Python Version](https://img.shields.io/pypi/pyversions/display_tty)
![PyPI - Implementation](https://img.shields.io/pypi/implementation/display_tty)
![PyPI - Wheel](https://img.shields.io/pypi/wheel/display_tty)
![PyPI - Version](https://img.shields.io/pypi/v/display_tty?label=pypi%20package:%20display_tty)
![PyPI - Downloads](https://img.shields.io/pypi/dm/display_tty)
![PyPI - License](https://img.shields.io/pypi/l/display_tty)
![Execution status](https://github.com/Hanra-s-work/display_tty/actions/workflows/python-package.yml/badge.svg)
![GitHub Workflow Status (with event)](https://img.shields.io/github/actions/workflow/status/Hanra-s-work/display_tty/python-package.yml)
![GitHub repo size](https://img.shields.io/github/repo-size/Hanra-s-work/display_tty)
![GitHub Repo stars](https://img.shields.io/github/stars/Hanra-s-work/display_tty)
![GitHub commit activity (branch)](https://img.shields.io/github/commit-activity/m/Hanra-s-work/display_tty)
![GitHub last commit (branch)](https://img.shields.io/github/last-commit/Hanra-s-work/display_tty/main)

[![Static Badge](https://img.shields.io/badge/Buy_me_a_tea-Hanra-%235F7FFF?style=flat-square&logo=buymeacoffee&label=Buy%20me%20a%20coffee&labelColor=%235F7FFF&color=%23FFDD00&link=https%3A%2F%2Fwww.buymeacoffee.com%2Fhanra)](https://www.buymeacoffee.com/hanra)

Description

This is a python package I created in order to simplify the boiling process for displaying text in a geometrical shape drawn using characters.

Disclaimer

The package was originally named `disp` but had to be changed to `display_tty` because the names `disp` and `display` were already taken by other packages.

The class will still remain `Disp` but bindings named `Display`, `DispTTY` and `DisplayTTY` are available.

The Preloaded version exists under: `IDISP`, `IDISPLAY`, `IDTTY` and `IDISPTTY`

Table of Content

1. [Display tty](display-tty)
2. [Description](description)
3. [Disclaimer](disclaimer)
4. [Table of Content](table-of-content)
5. [Installation](installation)
1. [Using pip](using-pip)
2. [Using python](using-python)
6. [Usage](usage)
1. [Importing](importing)
2. [Initialising](initialising)
3. [Calling the tree function](calling-the-tree-function)
4. [Displaying a beautified Hello World](displaying-a-beautified-hello-world)
1. [Hello World as a title](hello-world-as-a-title)
2. [Hello World as a sub title](hello-world-as-a-sub-title)
3. [Hello World as a sub sub title](hello-world-as-a-sub-sub-title)
4. [Hello World as a message with adjustable delay per call](hello-world-as-a-message-with-adjustable-delay-per-call)
5. [Hello World as a message](hello-world-as-a-message)
6. [Hello World as a question message](hello-world-as-a-question-message)
7. [Hello World as an error message](hello-world-as-an-error-message)
8. [Hello World as a success message](hello-world-as-a-success-message)
9. [Hello World as a warning message](hello-world-as-a-warning-message)
10. [Hello World as an inform message](hello-world-as-an-inform-message)
7. [Change the initialisation content](change-the-initialisation-content)
1. [TOML configuration breakdown](toml-configuration-breakdown)
1. [line 1](line-1)
2. [line 2](line-2)
3. [line 3](line-3)
4. [line 4](line-4)
5. [line 5](line-5)
6. [line 6](line-6)
7. [line 7](line-7)
8. [line 8](line-8)
9. [line 9](line-9)
10. [line 10](line-10)
11. [line 11](line-11)
12. [line 12](line-12)
13. [line 13](line-13)
14. [line 14](line-14)
15. [line 15](line-15)
16. [line 16](line-16)
17. [line 17](line-17)
2. [Update the configuration of an initialised class](update-the-configuration-of-an-initialised-class)
8. [Author](author)
9. [Version](version)

Installation

Using pip

sh
pip install -U disp


Using python

Under Windows:

bat
py -m pip install -U display_tty


Under Linux/Mac OS:

sh
python3 -m pip install -U display_tty


Usage

Importing

py
from display_tty import IDTTY


Initialising

The generic class is: `Disp(toml_content: dict, save_to_file: bool = False, file_name: str = "text_output_run.txt", file_descriptor: any = None)`

For your convenience, you can use the `IDTTY` variable which is an initialised version of the class.

py
IDTTY.title("Hello World")


Otherwise, if you wish to initialise the class with your own parameters, you can do so like this:

py
from display_tty import DisplayTTY
TOML_CONF = {
'PRETTIFY_OUTPUT': True,
'PRETTY_OUTPUT_IN_BLOCS': True,
'MESSAGE_CHARACTER': '',
'MESSAGE_ERROR_CHARACTER': '',
'MESSAGE_INFORM_CHARACTER': 'i',
'MESSAGE_QUESTION_CHARACTER': '?',
'MESSAGE_SUCCESS_CHARACTER': '/',
'MESSAGE_WARNING_CHARACTER': '!',
'SUB_SUB_TITLE_WALL_CHARACTER': '*',
'SUB_TITLE_WALL_CHARACTER': '',
'TITLE_WALL_CHARACTER': '',
'TREE_COLUMN_SEPERATOR_CHAR': '│',
'TREE_LINE_SEPERATOR_CHAR': '─',
'TREE_NODE_CHAR': '├',
'TREE_NODE_END_CHAR': '└',
'MESSAGE_ANIMATION_DELAY_BLOCKY': 0.01,
'MESSAGE_ANIMATION_DELAY': 0.01
}

SAVE_TO_FILE = False
FILE_NAME = "run_results.txt"
FILE_DESCRIPTOR = None


IDTTY = DisplayTTY(
TOML_CONF,
SAVE_TO_FILE,
FILE_NAME,
)


Calling the tree function

The generic function is:

py
tree(self, title: str, data: list[str], offset: int = 0)


The output is: None

py
TEST_DATA = {
"test_data1": "test_data1.1",
"test_data2": "test_data2.1",
"test_data3": [
"test_data_list3.1",
"test_data_list3.2",
"test_data_list3.3",
"test_data_list3.4",
"test_data_list3.5"
],
"test_data4": "test_data4.1",
"test_data5": {
"test_data5.1": "test_data5.1.1",
"test_data5.2": "test_data5.2.1",
"test_data5.3": "test_data5.3.1",
"test_data5.4": "test_data5.4.1"
},
"test_data6": [
{
"test_data6.1": "test_data6.1.1",
"test_data6.2": "test_data6.2.1"
},
[
"test_data_list6.3.1",
"test_data_list6.3.1",
"test_data_list6.3.1",
"test_data_list6.3.1"
]
],
"test_data7": {
"test_data7.1": {
"test_data7.1.1": "test_data7.1.1.1",
"test_data7.1.2": "test_data7.1.2.1"
},
"test_data7.2": [
"test_data7.2.1",
"test_data7.2.2",
"test_data7.2.3",
"test_data7.2.4",
"test_data7.2.5"
]
}
}

IDTTY.tree("This is a test tree", TEST_DATA, 0)


Displaying a beautified Hello World

Hello World as a title

The generic function to display `Hello World!` as a title is:

py
title(self, title)


The outputs is: None

py
IDTTY.title("Hello World !")


Hello World as a sub title

The generic function to display `Hello World!` as a sub title is:

py
sub_title(self, sub_title)


The outputs is: None

py
IDTTY.sub_title("Hello World !")


Hello World as a sub sub title

The generic function to display `Hello World!` as a sub sub title is:

py
sub_sub_title(self, sub_sub_title)


The outputs is: None

py
IDTTY.sub_sub_title("Hello World !")


Hello World as a message with adjustable delay per call

The generic function to display `Hello World!` as a message is:

py
animate_message(self, message: str = "Hello World!", delay: float = 0.02)


The outputs is: None

py

1.1.5

[[ADD] boilerplates for logging functions](https://github.com/Hanra-s-work/display_tty/commit/ff8c5c3808511bacee5add1fafb289697f9750ac)
Display tty

![PyPI - Python Version](https://img.shields.io/pypi/pyversions/display_tty)
![PyPI - Implementation](https://img.shields.io/pypi/implementation/display_tty)
![PyPI - Wheel](https://img.shields.io/pypi/wheel/display_tty)
![PyPI - Version](https://img.shields.io/pypi/v/display_tty?label=pypi%20package:%20display_tty)
![PyPI - Downloads](https://img.shields.io/pypi/dm/display_tty)
![PyPI - License](https://img.shields.io/pypi/l/display_tty)
![Execution status](https://github.com/Hanra-s-work/display_tty/actions/workflows/python-package.yml/badge.svg)
![GitHub Workflow Status (with event)](https://img.shields.io/github/actions/workflow/status/Hanra-s-work/display_tty/python-package.yml)
![GitHub repo size](https://img.shields.io/github/repo-size/Hanra-s-work/display_tty)
![GitHub Repo stars](https://img.shields.io/github/stars/Hanra-s-work/display_tty)
![GitHub commit activity (branch)](https://img.shields.io/github/commit-activity/m/Hanra-s-work/display_tty)
![GitHub last commit (branch)](https://img.shields.io/github/last-commit/Hanra-s-work/display_tty/main)

[![Static Badge](https://img.shields.io/badge/Buy_me_a_tea-Hanra-%235F7FFF?style=flat-square&logo=buymeacoffee&label=Buy%20me%20a%20coffee&labelColor=%235F7FFF&color=%23FFDD00&link=https%3A%2F%2Fwww.buymeacoffee.com%2Fhanra)](https://www.buymeacoffee.com/hanra)

Description

This is a python package I created in order to simplify the boiling process for displaying text in a geometrical shape drawn using characters.

Disclaimer

The package was originally named `disp` but had to be changed to `display_tty` because the names `disp` and `display` were already taken by other packages.

The class will still remain `Disp` but bindings named `Display`, `DispTTY` and `DisplayTTY` are available.

The Preloaded version exists under: `IDISP`, `IDISPLAY`, `IDTTY` and `IDISPTTY`

Table of Content

1. [Display tty](display-tty)
2. [Description](description)
3. [Disclaimer](disclaimer)
4. [Table of Content](table-of-content)
5. [Installation](installation)
1. [Using pip](using-pip)
2. [Using python](using-python)
6. [Usage](usage)
1. [Importing](importing)
2. [Initialising](initialising)
3. [Calling the tree function](calling-the-tree-function)
4. [Displaying a beautified Hello World](displaying-a-beautified-hello-world)
1. [Hello World as a title](hello-world-as-a-title)
2. [Hello World as a sub title](hello-world-as-a-sub-title)
3. [Hello World as a sub sub title](hello-world-as-a-sub-sub-title)
4. [Hello World as a message with adjustable delay per call](hello-world-as-a-message-with-adjustable-delay-per-call)
5. [Hello World as a message](hello-world-as-a-message)
6. [Hello World as a question message](hello-world-as-a-question-message)
7. [Hello World as an error message](hello-world-as-an-error-message)
8. [Hello World as a success message](hello-world-as-a-success-message)
9. [Hello World as a warning message](hello-world-as-a-warning-message)
10. [Hello World as an inform message](hello-world-as-an-inform-message)
7. [Change the initialisation content](change-the-initialisation-content)
1. [TOML configuration breakdown](toml-configuration-breakdown)
1. [line 1](line-1)
2. [line 2](line-2)
3. [line 3](line-3)
4. [line 4](line-4)
5. [line 5](line-5)
6. [line 6](line-6)
7. [line 7](line-7)
8. [line 8](line-8)
9. [line 9](line-9)
10. [line 10](line-10)
11. [line 11](line-11)
12. [line 12](line-12)
13. [line 13](line-13)
14. [line 14](line-14)
15. [line 15](line-15)
16. [line 16](line-16)
17. [line 17](line-17)
2. [Update the configuration of an initialised class](update-the-configuration-of-an-initialised-class)
8. [Author](author)
9. [Version](version)

Installation

Using pip

sh
pip install -U disp


Using python

Under Windows:

bat
py -m pip install -U display_tty


Under Linux/Mac OS:

sh
python3 -m pip install -U display_tty


Usage

Importing

py
from display_tty import IDTTY


Initialising

The generic class is: `Disp(toml_content: dict, save_to_file: bool = False, file_name: str = "text_output_run.txt", file_descriptor: any = None)`

For your convenience, you can use the `IDTTY` variable which is an initialised version of the class.

py
IDTTY.title("Hello World")


Otherwise, if you wish to initialise the class with your own parameters, you can do so like this:

py
from display_tty import DisplayTTY
TOML_CONF = {
'PRETTIFY_OUTPUT': True,
'PRETTY_OUTPUT_IN_BLOCS': True,
'MESSAGE_CHARACTER': '',
'MESSAGE_ERROR_CHARACTER': '',
'MESSAGE_INFORM_CHARACTER': 'i',
'MESSAGE_QUESTION_CHARACTER': '?',
'MESSAGE_SUCCESS_CHARACTER': '/',
'MESSAGE_WARNING_CHARACTER': '!',
'SUB_SUB_TITLE_WALL_CHARACTER': '*',
'SUB_TITLE_WALL_CHARACTER': '',
'TITLE_WALL_CHARACTER': '',
'TREE_COLUMN_SEPERATOR_CHAR': '│',
'TREE_LINE_SEPERATOR_CHAR': '─',
'TREE_NODE_CHAR': '├',
'TREE_NODE_END_CHAR': '└',
'MESSAGE_ANIMATION_DELAY_BLOCKY': 0.01,
'MESSAGE_ANIMATION_DELAY': 0.01
}

SAVE_TO_FILE = False
FILE_NAME = "run_results.txt"
FILE_DESCRIPTOR = None


IDTTY = DisplayTTY(
TOML_CONF,
SAVE_TO_FILE,
FILE_NAME,
)


Calling the tree function

The generic function is:

py
tree(self, title: str, data: list[str], offset: int = 0)


The output is: None

py
TEST_DATA = {
"test_data1": "test_data1.1",
"test_data2": "test_data2.1",
"test_data3": [
"test_data_list3.1",
"test_data_list3.2",
"test_data_list3.3",
"test_data_list3.4",
"test_data_list3.5"
],
"test_data4": "test_data4.1",
"test_data5": {
"test_data5.1": "test_data5.1.1",
"test_data5.2": "test_data5.2.1",
"test_data5.3": "test_data5.3.1",
"test_data5.4": "test_data5.4.1"
},
"test_data6": [
{
"test_data6.1": "test_data6.1.1",
"test_data6.2": "test_data6.2.1"
},
[
"test_data_list6.3.1",
"test_data_list6.3.1",
"test_data_list6.3.1",
"test_data_list6.3.1"
]
],
"test_data7": {
"test_data7.1": {
"test_data7.1.1": "test_data7.1.1.1",
"test_data7.1.2": "test_data7.1.2.1"
},
"test_data7.2": [
"test_data7.2.1",
"test_data7.2.2",
"test_data7.2.3",
"test_data7.2.4",
"test_data7.2.5"
]
}
}

IDTTY.tree("This is a test tree", TEST_DATA, 0)


Displaying a beautified Hello World

Hello World as a title

The generic function to display `Hello World!` as a title is:

py
title(self, title)


The outputs is: None

py
IDTTY.title("Hello World !")


Hello World as a sub title

The generic function to display `Hello World!` as a sub title is:

py
sub_title(self, sub_title)


The outputs is: None

py
IDTTY.sub_title("Hello World !")


Hello World as a sub sub title

The generic function to display `Hello World!` as a sub sub title is:

py
sub_sub_title(self, sub_sub_title)


The outputs is: None

py
IDTTY.sub_sub_title("Hello World !")


Hello World as a message with adjustable delay per call

The generic function to display `Hello World!` as a message is:

py
animate_message(self, message: str = "Hello World!", delay: float = 0.02)


The outputs is: None

py

1.1.4

[FIX] forgotten characters in the standard message box
Display tty

![PyPI - Python Version](https://img.shields.io/pypi/pyversions/display_tty)
![PyPI - Implementation](https://img.shields.io/pypi/implementation/display_tty)
![PyPI - Wheel](https://img.shields.io/pypi/wheel/display_tty)
![PyPI - Version](https://img.shields.io/pypi/v/display_tty?label=pypi%20package:%20display_tty)
![PyPI - Downloads](https://img.shields.io/pypi/dm/display_tty)
![PyPI - License](https://img.shields.io/pypi/l/display_tty)
![Execution status](https://github.com/Hanra-s-work/display_tty/actions/workflows/python-package.yml/badge.svg)
![GitHub Workflow Status (with event)](https://img.shields.io/github/actions/workflow/status/Hanra-s-work/display_tty/python-package.yml)
![GitHub repo size](https://img.shields.io/github/repo-size/Hanra-s-work/display_tty)
![GitHub Repo stars](https://img.shields.io/github/stars/Hanra-s-work/display_tty)
![GitHub commit activity (branch)](https://img.shields.io/github/commit-activity/m/Hanra-s-work/display_tty)
![GitHub last commit (branch)](https://img.shields.io/github/last-commit/Hanra-s-work/display_tty/main)

[![Static Badge](https://img.shields.io/badge/Buy_me_a_tea-Hanra-%235F7FFF?style=flat-square&logo=buymeacoffee&label=Buy%20me%20a%20coffee&labelColor=%235F7FFF&color=%23FFDD00&link=https%3A%2F%2Fwww.buymeacoffee.com%2Fhanra)](https://www.buymeacoffee.com/hanra)

Description

This is a python package I created in order to simplify the boiling process for displaying text in a geometrical shape drawn using characters.

Disclaimer

The package was originally named `disp` but had to be changed to `display_tty` because the names `disp` and `display` were already taken by other packages.

The class will still remain `Disp` but bindings named `Display`, `DispTTY` and `DisplayTTY` are available.

The Preloaded version exists under: `IDISP`, `IDISPLAY`, `IDTTY` and `IDISPTTY`

Table of Content

1. [Display tty](display-tty)
2. [Description](description)
3. [Disclaimer](disclaimer)
4. [Table of Content](table-of-content)
5. [Installation](installation)
1. [Using pip](using-pip)
2. [Using python](using-python)
6. [Usage](usage)
1. [Importing](importing)
2. [Initialising](initialising)
3. [Calling the tree function](calling-the-tree-function)
4. [Displaying a beautified Hello World](displaying-a-beautified-hello-world)
1. [Hello World as a title](hello-world-as-a-title)
2. [Hello World as a sub title](hello-world-as-a-sub-title)
3. [Hello World as a sub sub title](hello-world-as-a-sub-sub-title)
4. [Hello World as a message with adjustable delay per call](hello-world-as-a-message-with-adjustable-delay-per-call)
5. [Hello World as a message](hello-world-as-a-message)
6. [Hello World as a question message](hello-world-as-a-question-message)
7. [Hello World as an error message](hello-world-as-an-error-message)
8. [Hello World as a success message](hello-world-as-a-success-message)
9. [Hello World as a warning message](hello-world-as-a-warning-message)
10. [Hello World as an inform message](hello-world-as-an-inform-message)
7. [Change the initialisation content](change-the-initialisation-content)
1. [TOML configuration breakdown](toml-configuration-breakdown)
1. [line 1](line-1)
2. [line 2](line-2)
3. [line 3](line-3)
4. [line 4](line-4)
5. [line 5](line-5)
6. [line 6](line-6)
7. [line 7](line-7)
8. [line 8](line-8)
9. [line 9](line-9)
10. [line 10](line-10)
11. [line 11](line-11)
12. [line 12](line-12)
13. [line 13](line-13)
14. [line 14](line-14)
15. [line 15](line-15)
16. [line 16](line-16)
17. [line 17](line-17)
2. [Update the configuration of an initialised class](update-the-configuration-of-an-initialised-class)
8. [Author](author)
9. [Version](version)

Installation

Using pip

sh
pip install -U disp


Using python

Under Windows:

bat
py -m pip install -U display_tty


Under Linux/Mac OS:

sh
python3 -m pip install -U display_tty


Usage

Importing

py
from display_tty import IDTTY


Initialising

The generic class is: `Disp(toml_content: dict, save_to_file: bool = False, file_name: str = "text_output_run.txt", file_descriptor: any = None)`

For your convenience, you can use the `IDTTY` variable which is an initialised version of the class.

py
IDTTY.title("Hello World")


Otherwise, if you wish to initialise the class with your own parameters, you can do so like this:

py
from display_tty import DisplayTTY
TOML_CONF = {
'PRETTIFY_OUTPUT': True,
'PRETTY_OUTPUT_IN_BLOCS': True,
'MESSAGE_CHARACTER': '',
'MESSAGE_ERROR_CHARACTER': '',
'MESSAGE_INFORM_CHARACTER': 'i',
'MESSAGE_QUESTION_CHARACTER': '?',
'MESSAGE_SUCCESS_CHARACTER': '/',
'MESSAGE_WARNING_CHARACTER': '!',
'SUB_SUB_TITLE_WALL_CHARACTER': '*',
'SUB_TITLE_WALL_CHARACTER': '',
'TITLE_WALL_CHARACTER': '',
'TREE_COLUMN_SEPERATOR_CHAR': '│',
'TREE_LINE_SEPERATOR_CHAR': '─',
'TREE_NODE_CHAR': '├',
'TREE_NODE_END_CHAR': '└',
'MESSAGE_ANIMATION_DELAY_BLOCKY': 0.01,
'MESSAGE_ANIMATION_DELAY': 0.01
}

SAVE_TO_FILE = False
FILE_NAME = "run_results.txt"
FILE_DESCRIPTOR = None


IDTTY = DisplayTTY(
TOML_CONF,
SAVE_TO_FILE,
FILE_NAME,
)


Calling the tree function

The generic function is:

py
tree(self, title: str, data: list[str], offset: int = 0)


The output is: None

py
TEST_DATA = {
"test_data1": "test_data1.1",
"test_data2": "test_data2.1",
"test_data3": [
"test_data_list3.1",
"test_data_list3.2",
"test_data_list3.3",
"test_data_list3.4",
"test_data_list3.5"
],
"test_data4": "test_data4.1",
"test_data5": {
"test_data5.1": "test_data5.1.1",
"test_data5.2": "test_data5.2.1",
"test_data5.3": "test_data5.3.1",
"test_data5.4": "test_data5.4.1"
},
"test_data6": [
{
"test_data6.1": "test_data6.1.1",
"test_data6.2": "test_data6.2.1"
},
[
"test_data_list6.3.1",
"test_data_list6.3.1",
"test_data_list6.3.1",
"test_data_list6.3.1"
]
],
"test_data7": {
"test_data7.1": {
"test_data7.1.1": "test_data7.1.1.1",
"test_data7.1.2": "test_data7.1.2.1"
},
"test_data7.2": [
"test_data7.2.1",
"test_data7.2.2",
"test_data7.2.3",
"test_data7.2.4",
"test_data7.2.5"
]
}
}

IDTTY.tree("This is a test tree", TEST_DATA, 0)


Displaying a beautified Hello World

Hello World as a title

The generic function to display `Hello World!` as a title is:

py
title(self, title)


The outputs is: None

py
IDTTY.title("Hello World !")


Hello World as a sub title

The generic function to display `Hello World!` as a sub title is:

py
sub_title(self, sub_title)


The outputs is: None

py
IDTTY.sub_title("Hello World !")


Hello World as a sub sub title

The generic function to display `Hello World!` as a sub sub title is:

py
sub_sub_title(self, sub_sub_title)


The outputs is: None

py
IDTTY.sub_sub_title("Hello World !")


Hello World as a message with adjustable delay per call

The generic function to display `Hello World!` as a message is:

py
animate_message(self, message: str = "Hello World!", delay: float = 0.02)


The outputs is: None

py

1.1.3

[ADD] more customisation in the toml
Display tty

![PyPI - Python Version](https://img.shields.io/pypi/pyversions/display_tty)
![PyPI - Implementation](https://img.shields.io/pypi/implementation/display_tty)
![PyPI - Wheel](https://img.shields.io/pypi/wheel/display_tty)
![PyPI - Version](https://img.shields.io/pypi/v/display_tty?label=pypi%20package:%20display_tty)
![PyPI - Downloads](https://img.shields.io/pypi/dm/display_tty)
![PyPI - License](https://img.shields.io/pypi/l/display_tty)
![Execution status](https://github.com/Hanra-s-work/display_tty/actions/workflows/python-package.yml/badge.svg)
![GitHub Workflow Status (with event)](https://img.shields.io/github/actions/workflow/status/Hanra-s-work/display_tty/python-package.yml)
![GitHub repo size](https://img.shields.io/github/repo-size/Hanra-s-work/display_tty)
![GitHub Repo stars](https://img.shields.io/github/stars/Hanra-s-work/display_tty)
![GitHub commit activity (branch)](https://img.shields.io/github/commit-activity/m/Hanra-s-work/display_tty)
![GitHub last commit (branch)](https://img.shields.io/github/last-commit/Hanra-s-work/display_tty/main)

[![Static Badge](https://img.shields.io/badge/Buy_me_a_tea-Hanra-%235F7FFF?style=flat-square&logo=buymeacoffee&label=Buy%20me%20a%20coffee&labelColor=%235F7FFF&color=%23FFDD00&link=https%3A%2F%2Fwww.buymeacoffee.com%2Fhanra)](https://www.buymeacoffee.com/hanra)

Description

This is a python package I created in order to simplify the boiling process for displaying text in a geometrical shape drawn using characters.

Disclaimer

The package was originally named `disp` but had to be changed to `display_tty` because the names `disp` and `display` were already taken by other packages.

The class will still remain `Disp` but bindings named `Display`, `DispTTY` and `DisplayTTY` are available.

The Preloaded version exists under: `IDISP`, `IDISPLAY`, `IDTTY` and `IDISPTTY`

Table of Content

1. [Display tty](display-tty)
2. [Description](description)
3. [Disclaimer](disclaimer)
4. [Table of Content](table-of-content)
5. [Installation](installation)
1. [Using pip](using-pip)
2. [Using python](using-python)
6. [Usage](usage)
1. [Importing](importing)
2. [Initialising](initialising)
3. [Calling the tree function](calling-the-tree-function)
4. [Displaying a beautified Hello World](displaying-a-beautified-hello-world)
1. [Hello World as a title](hello-world-as-a-title)
2. [Hello World as a sub title](hello-world-as-a-sub-title)
3. [Hello World as a sub sub title](hello-world-as-a-sub-sub-title)
4. [Hello World as a message with adjustable delay per call](hello-world-as-a-message-with-adjustable-delay-per-call)
5. [Hello World as a message](hello-world-as-a-message)
6. [Hello World as a question message](hello-world-as-a-question-message)
7. [Hello World as an error message](hello-world-as-an-error-message)
8. [Hello World as a success message](hello-world-as-a-success-message)
9. [Hello World as a warning message](hello-world-as-a-warning-message)
10. [Hello World as an inform message](hello-world-as-an-inform-message)
7. [Change the initialisation content](change-the-initialisation-content)
1. [TOML configuration breakdown](toml-configuration-breakdown)
1. [line 1](line-1)
2. [line 2](line-2)
3. [line 3](line-3)
4. [line 4](line-4)
5. [line 5](line-5)
6. [line 6](line-6)
7. [line 7](line-7)
8. [line 8](line-8)
9. [line 9](line-9)
10. [line 10](line-10)
11. [line 11](line-11)
12. [line 12](line-12)
13. [line 13](line-13)
14. [line 14](line-14)
15. [line 15](line-15)
16. [line 16](line-16)
17. [line 17](line-17)
2. [Update the configuration of an initialised class](update-the-configuration-of-an-initialised-class)
8. [Author](author)
9. [Version](version)

Installation

Using pip

sh
pip install -U disp


Using python

Under Windows:

bat
py -m pip install -U display_tty


Under Linux/Mac OS:

sh
python3 -m pip install -U display_tty


Usage

Importing

py
from display_tty import IDTTY


Initialising

The generic class is: `Disp(toml_content: dict, save_to_file: bool = False, file_name: str = "text_output_run.txt", file_descriptor: any = None)`

For your convenience, you can use the `IDTTY` variable which is an initialised version of the class.

py
IDTTY.title("Hello World")


Otherwise, if you wish to initialise the class with your own parameters, you can do so like this:

py
from display_tty import DisplayTTY
TOML_CONF = {
'PRETTIFY_OUTPUT': True,
'PRETTY_OUTPUT_IN_BLOCS': True,
'MESSAGE_CHARACTER': '',
'MESSAGE_ERROR_CHARACTER': '',
'MESSAGE_INFORM_CHARACTER': 'i',
'MESSAGE_QUESTION_CHARACTER': '?',
'MESSAGE_SUCCESS_CHARACTER': '/',
'MESSAGE_WARNING_CHARACTER': '!',
'SUB_SUB_TITLE_WALL_CHARACTER': '*',
'SUB_TITLE_WALL_CHARACTER': '',
'TITLE_WALL_CHARACTER': '',
'TREE_COLUMN_SEPERATOR_CHAR': '│',
'TREE_LINE_SEPERATOR_CHAR': '─',
'TREE_NODE_CHAR': '├',
'TREE_NODE_END_CHAR': '└',
'MESSAGE_ANIMATION_DELAY_BLOCKY': 0.01,
'MESSAGE_ANIMATION_DELAY': 0.01
}

SAVE_TO_FILE = False
FILE_NAME = "run_results.txt"
FILE_DESCRIPTOR = None


IDTTY = DisplayTTY(
TOML_CONF,
SAVE_TO_FILE,
FILE_NAME,
)


Calling the tree function

The generic function is:

py
tree(self, title: str, data: list[str], offset: int = 0)


The output is: None

py
TEST_DATA = {
"test_data1": "test_data1.1",
"test_data2": "test_data2.1",
"test_data3": [
"test_data_list3.1",
"test_data_list3.2",
"test_data_list3.3",
"test_data_list3.4",
"test_data_list3.5"
],
"test_data4": "test_data4.1",
"test_data5": {
"test_data5.1": "test_data5.1.1",
"test_data5.2": "test_data5.2.1",
"test_data5.3": "test_data5.3.1",
"test_data5.4": "test_data5.4.1"
},
"test_data6": [
{
"test_data6.1": "test_data6.1.1",
"test_data6.2": "test_data6.2.1"
},
[
"test_data_list6.3.1",
"test_data_list6.3.1",
"test_data_list6.3.1",
"test_data_list6.3.1"
]
],
"test_data7": {
"test_data7.1": {
"test_data7.1.1": "test_data7.1.1.1",
"test_data7.1.2": "test_data7.1.2.1"
},
"test_data7.2": [
"test_data7.2.1",
"test_data7.2.2",
"test_data7.2.3",
"test_data7.2.4",
"test_data7.2.5"
]
}
}

IDTTY.tree("This is a test tree", TEST_DATA, 0)


Displaying a beautified Hello World

Hello World as a title

The generic function to display `Hello World!` as a title is:

py
title(self, title)


The outputs is: None

py
IDTTY.title("Hello World !")


Hello World as a sub title

The generic function to display `Hello World!` as a sub title is:

py
sub_title(self, sub_title)


The outputs is: None

py
IDTTY.sub_title("Hello World !")


Hello World as a sub sub title

The generic function to display `Hello World!` as a sub sub title is:

py
sub_sub_title(self, sub_sub_title)


The outputs is: None

py
IDTTY.sub_sub_title("Hello World !")


Hello World as a message with adjustable delay per call

The generic function to display `Hello World!` as a message is:

py
animate_message(self, message: str = "Hello World!", delay: float = 0.02)


The outputs is: None

py

1.1.2

[ADD] new box desing options
Display tty

![PyPI - Python Version](https://img.shields.io/pypi/pyversions/display_tty)
![PyPI - Implementation](https://img.shields.io/pypi/implementation/display_tty)
![PyPI - Wheel](https://img.shields.io/pypi/wheel/display_tty)
![PyPI - Version](https://img.shields.io/pypi/v/display_tty?label=pypi%20package:%20display_tty)
![PyPI - Downloads](https://img.shields.io/pypi/dm/display_tty)
![PyPI - License](https://img.shields.io/pypi/l/display_tty)
![Execution status](https://github.com/Hanra-s-work/display_tty/actions/workflows/python-package.yml/badge.svg)
![GitHub Workflow Status (with event)](https://img.shields.io/github/actions/workflow/status/Hanra-s-work/display_tty/python-package.yml)
![GitHub repo size](https://img.shields.io/github/repo-size/Hanra-s-work/display_tty)
![GitHub Repo stars](https://img.shields.io/github/stars/Hanra-s-work/display_tty)
![GitHub commit activity (branch)](https://img.shields.io/github/commit-activity/m/Hanra-s-work/display_tty)
![GitHub last commit (branch)](https://img.shields.io/github/last-commit/Hanra-s-work/display_tty/main)

[![Static Badge](https://img.shields.io/badge/Buy_me_a_tea-Hanra-%235F7FFF?style=flat-square&logo=buymeacoffee&label=Buy%20me%20a%20coffee&labelColor=%235F7FFF&color=%23FFDD00&link=https%3A%2F%2Fwww.buymeacoffee.com%2Fhanra)](https://www.buymeacoffee.com/hanra)

Description

This is a python package I created in order to simplify the boiling process for displaying text in a geometrical shape drawn using characters.

Disclaimer

The package was originally named `disp` but had to be changed to `display_tty` because the names `disp` and `display` were already taken by other packages.

The class will still remain `Disp` but bindings named `Display`, `DispTTY` and `DisplayTTY` are available.

The Preloaded version exists under: `IDISP`, `IDISPLAY`, `IDTTY` and `IDISPTTY`

Table of Content

1. [Display tty](display-tty)
2. [Description](description)
3. [Disclaimer](disclaimer)
4. [Table of Content](table-of-content)
5. [Installation](installation)
1. [Using pip](using-pip)
2. [Using python](using-python)
6. [Usage](usage)
1. [Importing](importing)
2. [Initialising](initialising)
3. [Calling the tree function](calling-the-tree-function)
4. [Displaying a beautified Hello World](displaying-a-beautified-hello-world)
1. [Hello World as a title](hello-world-as-a-title)
2. [Hello World as a sub title](hello-world-as-a-sub-title)
3. [Hello World as a sub sub title](hello-world-as-a-sub-sub-title)
4. [Hello World as a message with adjustable delay per call](hello-world-as-a-message-with-adjustable-delay-per-call)
5. [Hello World as a message](hello-world-as-a-message)
6. [Hello World as a question message](hello-world-as-a-question-message)
7. [Hello World as an error message](hello-world-as-an-error-message)
8. [Hello World as a success message](hello-world-as-a-success-message)
9. [Hello World as a warning message](hello-world-as-a-warning-message)
10. [Hello World as an inform message](hello-world-as-an-inform-message)
7. [Change the initialisation content](change-the-initialisation-content)
1. [TOML configuration breakdown](toml-configuration-breakdown)
1. [line 1](line-1)
2. [line 2](line-2)
3. [line 3](line-3)
4. [line 4](line-4)
5. [line 5](line-5)
6. [line 6](line-6)
7. [line 7](line-7)
8. [line 8](line-8)
9. [line 9](line-9)
10. [line 10](line-10)
11. [line 11](line-11)
12. [line 12](line-12)
13. [line 13](line-13)
14. [line 14](line-14)
15. [line 15](line-15)
16. [line 16](line-16)
17. [line 17](line-17)
2. [Update the configuration of an initialised class](update-the-configuration-of-an-initialised-class)
8. [Author](author)
9. [Version](version)

Installation

Using pip

sh
pip install -U disp


Using python

Under Windows:

bat
py -m pip install -U display_tty


Under Linux/Mac OS:

sh
python3 -m pip install -U display_tty


Usage

Importing

py
from display_tty import IDTTY


Initialising

The generic class is: `Disp(toml_content: dict, save_to_file: bool = False, file_name: str = "text_output_run.txt", file_descriptor: any = None)`

For your convenience, you can use the `IDTTY` variable which is an initialised version of the class.

py
IDTTY.title("Hello World")


Otherwise, if you wish to initialise the class with your own parameters, you can do so like this:

py
from display_tty import DisplayTTY
TOML_CONF = {
'PRETTIFY_OUTPUT': True,
'PRETTY_OUTPUT_IN_BLOCS': True,
'MESSAGE_CHARACTER': '',
'MESSAGE_ERROR_CHARACTER': '',
'MESSAGE_INFORM_CHARACTER': 'i',
'MESSAGE_QUESTION_CHARACTER': '?',
'MESSAGE_SUCCESS_CHARACTER': '/',
'MESSAGE_WARNING_CHARACTER': '!',
'SUB_SUB_TITLE_WALL_CHARACTER': '*',
'SUB_TITLE_WALL_CHARACTER': '',
'TITLE_WALL_CHARACTER': '',
'TREE_COLUMN_SEPERATOR_CHAR': '│',
'TREE_LINE_SEPERATOR_CHAR': '─',
'TREE_NODE_CHAR': '├',
'TREE_NODE_END_CHAR': '└',
'MESSAGE_ANIMATION_DELAY_BLOCKY': 0.01,
'MESSAGE_ANIMATION_DELAY': 0.01
}

SAVE_TO_FILE = False
FILE_NAME = "run_results.txt"
FILE_DESCRIPTOR = None


IDTTY = DisplayTTY(
TOML_CONF,
SAVE_TO_FILE,
FILE_NAME,
)


Calling the tree function

The generic function is:

py
tree(self, title: str, data: list[str], offset: int = 0)


The output is: None

py
TEST_DATA = {
"test_data1": "test_data1.1",
"test_data2": "test_data2.1",
"test_data3": [
"test_data_list3.1",
"test_data_list3.2",
"test_data_list3.3",
"test_data_list3.4",
"test_data_list3.5"
],
"test_data4": "test_data4.1",
"test_data5": {
"test_data5.1": "test_data5.1.1",
"test_data5.2": "test_data5.2.1",
"test_data5.3": "test_data5.3.1",
"test_data5.4": "test_data5.4.1"
},
"test_data6": [
{
"test_data6.1": "test_data6.1.1",
"test_data6.2": "test_data6.2.1"
},
[
"test_data_list6.3.1",
"test_data_list6.3.1",
"test_data_list6.3.1",
"test_data_list6.3.1"
]
],
"test_data7": {
"test_data7.1": {
"test_data7.1.1": "test_data7.1.1.1",
"test_data7.1.2": "test_data7.1.2.1"
},
"test_data7.2": [
"test_data7.2.1",
"test_data7.2.2",
"test_data7.2.3",
"test_data7.2.4",
"test_data7.2.5"
]
}
}

IDTTY.tree("This is a test tree", TEST_DATA, 0)


Displaying a beautified Hello World

Hello World as a title

The generic function to display `Hello World!` as a title is:

py
title(self, title)


The outputs is: None

py
IDTTY.title("Hello World !")


Hello World as a sub title

The generic function to display `Hello World!` as a sub title is:

py
sub_title(self, sub_title)


The outputs is: None

py
IDTTY.sub_title("Hello World !")


Hello World as a sub sub title

The generic function to display `Hello World!` as a sub sub title is:

py
sub_sub_title(self, sub_sub_title)


The outputs is: None

py
IDTTY.sub_sub_title("Hello World !")


Hello World as a message with adjustable delay per call

The generic function to display `Hello World!` as a message is:

py
animate_message(self, message: str = "Hello World!", delay: float = 0.02)


The outputs is: None

py

Page 1 of 2

© 2024 Safety CLI Cybersecurity Inc. All Rights Reserved.