Metadata-Version: 2.4
Name: ASCII-Menus
Version: 0.1.0
Summary: A simple library for creating different interactive menus
Author-email: Noxatra <noxatr4@gmail.com>
License: MIT License
        
        Copyright (c) 2025 Noxatr4
        
        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/Noxatr4/ASCII-Menus
Keywords: Termial,Interactive_Menus,Menus
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python
Classifier: Programming Language :: Python :: 3
Requires-Python: >=3.13
Description-Content-Type: text/markdown
License-File: LICENSE
Dynamic: license-file

# ASCII-Menus

ASCII_Menus is a simple library for creating different interactive menus


## 🚀 Features
* **Simple and legible menus**: Menus with options in cell format, title and displayed through the terminal.
* **Custom size menu**: Customizable size based on the number of options required, both in rows and columns.
* **Custom size options**: Customize the number of characters per option.
* **Support for multiple pages of options**
* **Simple Scroll-Bar system**
* **Two interaction modes**: *Dynamic* <--> *Static*.
* **With Cursor**


## 🛠 Installation

```bash
 $ pip install ASCII-Menus
```


## 📖 Quick Start

### Generate basic menu and show it

```python
from ASCII_Menus import Menu

test_menu = Menu("test_menu", 3, 4, 5,
                 [
                     "test", ":", "menu",
                     "test", ":", "menu",
                     "test", ":", "menu",
                     "test", ":", "menu",
                 ])
test_menu.menu_crafter()
```
```
+-------------------------+
|        test_menu        |
|-------------------------|
|                         |
| > test    :       menu  |
|                         |
|   test    :       menu  |
|                         |
|   test    :       menu  |
|                         |
|   test    :       menu  |
+-------------------------+
```


### Move cursor

```python
...
test_menu.change_coordinate_cursor("s")
test_menu.menu_crafter()
```
```
+-------------------------+
|        test_menu        |
|-------------------------|
|                         |
|   test    :       menu  |
|                         |
| > test    :       menu  |
|                         |
|   test    :       menu  |
|                         |
|   test    :       menu  |
+-------------------------+
```

### Select option

```python
...
input_user = input()

if input_user.lower() == "q":
    test_menu.select_option()
```
Returns a tuple containing the cursor coordinates and the name option string.

```
([0, 1, 0], "test")
```


## 🌎 Real-World Examples

A short application example
```python
from ASCII_Menus import Menu
import readchar

# Create your menu
TEST_MENU = Menu("test_menu", 3, 4, 5,
                 [
                     "test", ":", "menu",
                     "test", ":", "menu",
                     "test", ":", "menu",
                     "test", ":", "menu",
                 ])

SELECT_KEY = "q"
TEST_OPTION = "test"

def options_test():
    pass

def main():
    while True:
        input_user = readchar.readchar()
        select_option = ""
        # If you select the option
        if input_user.lower() == SELECT_KEY:
            select_option = TEST_MENU.select_option()[1]
        
        # Ejecute function associated with the menu
        if select_option == TEST_OPTION:
            options_test()
        
        # Show menu and update cursor coordinates.
        TEST_MENU.menu_crafter()
        TEST_MENU.change_coordinate_cursor(input_user)
        

if __name__ == "__main__":
    main()
```

## 📄 License
This project is licensed under the [MIT License](./LICENSE).

## 📬 Contact
For any inquiries, reach out to me via:

* **GitHub**: [Noxatr4](https://github.com/Noxatr4)
