Metadata-Version: 2.1
Name: ers-terminal-utils
Version: 0.0.2
Summary: A python package for UNIX terminal utilities
Author-email: Eliaquim Souza <eliaquim.rsv@gmail.com>
Maintainer-email: Eliaquim Souza <eliaquim.rsv@gmail.com>
License: MIT License
        
        Copyright (c) 2024 eliaquimrs
        
        Permission is hereby granted, free of charge, to any person obtaining a copy
        of this software and associated documentation files (the "Software"), to deal
        in the Software without restriction, including without limitation the rights
        to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
        copies of the Software, and to permit persons to whom the Software is
        furnished to do so, subject to the following conditions:
        
        The above copyright notice and this permission notice shall be included in all
        copies or substantial portions of the Software.
        
        THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
        IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
        FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
        AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
        LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
        OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
        SOFTWARE.
        
Project-URL: Homepage, https://github.com/eliaquimrs/terminal-utils
Project-URL: Documentation, https://github.com/eliaquimrs/terminal-utils?tab=readme-ov-file#readme
Project-URL: Repository, https://github.com/eliaquimrs/terminal-utils.git
Project-URL: Bug Tracker, https://github.com/eliaquimrs/terminal-utils/issues
Keywords: terminal,shell,python,bash,choices,terminal choices
Classifier: Development Status :: 4 - Beta
Classifier: Natural Language :: English
Classifier: Programming Language :: Python
Classifier: Operating System :: Unix
Classifier: Topic :: Utilities
Requires-Python: >=2.7
Description-Content-Type: text/markdown
License-File: LICENSE

# terminal-utils

<p align="center">A python package for UNIX terminal utilities</p>

# Menu
- [Getting started](#getting-started)
    - [Instalation](#installationuninstallation)
        - [With public pip repository](#with-public-pip-repository)
        - [Local installation](#local-installation)
    - [Uninstallation](#uninstallation)
    - [Usage](#usage)
        - [Dynamic choices](#dynamic-choices-via-terminal)
            - [Mode: One choice](#mode-one-choice-source-code)
            - [Mode: Multiple choices](#mode-multiple-choices-source-code)
- [LICENSE](#license)


# Getting started
## Installation

### With public pip repository
```shell
pip install ers-terminal-utils
```

## Uninstallation
```shell
pip uninstall ers-terminal-utils
```

## Usage
### Dynamic choices via terminal

#### Mode: one choice [(Source Code)](./examples/one_choice_example_1.py)
```python
from terminal_utils.choices_via_terminal import ChoicesViaTerminal

LIST_OF_CHOICES = [
    'Option 1',
    'Option 2',
    'Option 3',
    'Option 4',
    'Option 5'
]
TITTLE = 'Choose an option'
response = ChoicesViaTerminal(TITTLE, LIST_OF_CHOICES).main()
chosen_option_index, chosen_option_text = response[0]

print()
print('Chosen option index: {}\n'
      'Chosen option text: {}'.format(chosen_option_index, chosen_option_text))
```
<p align="center"><img width="800" src="md_files/example_1.gif" /></p>

#### Mode: Multiple choices [(Source Code)](./examples/multiple_choice_example_1.py)
```python
from terminal_utils.choices_via_terminal import ChoicesViaTerminal

LIST_OF_CHOICES = [
    'Option 1',
    'Option 2',
    'Option 3',
    'Option 4',
    'Option 5'
]
TITTLE = 'Choose one or more options'
response = ChoicesViaTerminal(TITTLE, LIST_OF_CHOICES,
                              mode='multiple_choices').main()

print('')
for chosen_option_index, chosen_option_text in response:
    print(
        '- Chosen option index: {}|Chosen option text: {}'.format(chosen_option_index,
                                                                  chosen_option_text)
    )
```
<p align="center"><img width="800" src="md_files/example_2.gif" /></p>

# LICENSE
<p align=center>This project is licensed under the MIT License - see the <a href="https://opensource.org/licenses/MIT">LICENSE</a> page for details.</p>
<p align="center">
  <a href="https://opensource.org/licenses/MIT">
    <img src="https://img.shields.io/badge/License-MIT-blue.svg" alt="License MIT">
  </a>
</p>
