dialoger


Namedialoger JSON
Version 1.0.0 PyPI version JSON
download
home_pagehttps://github.com/guisaldanha/dialoger
SummaryA package that provides a simple and user-friendly interface for creating interactive windows in Tkinter. Provides functions to create input windows, option list windows, alerts, information, errors and confirmation windows with options. Simplify user interaction with your program quickly and efficiently. One of the main functions is that it is possible to use patterns for certain answers, which allows requiring the user to have a date pattern, or input of numbers.
upload_time2023-05-12 08:17:55
maintainer
docs_urlNone
authorGuilherme Saldanha
requires_python
licenseMIT
keywords tkinter dialog dialoger dialogbox dialogboxer dialoguer dialoguerbox box user interface interactive input choices alert information error confirmation easy-to-use efficiency user-friendly pattern date number date pattern number pattern pattern input pattern input date pattern input number
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # Dialoger

[![PyPI version](https://img.shields.io/pypi/v/dialoger)](https://img.shields.io/pypi/v/logandprint) [![License](https://img.shields.io/github/license/guisaldanha/dialoger)](LICENSE) [![Downloads](https://img.shields.io/pypi/dm/dialoger)](https://img.shields.io/pypi/dm/dialoger)

Dialoger is a Python package that provides a set of functions to create interactive dialog windows in Tkinter with ease.

## Installation

You can install Dialoger using pip:

```shell
pip install dialoger
```

## Usage

Dialoger provides a set of functions to create interactive dialog windows in Tkinter with ease. The functions are: `ask`, `askwithanswers`, `confirm`, `alert`, `info`, `error` and `success`.

### ask

The `ask` function creates a dialog window with a question and a text input. It returns the text inputted by the user.

#### Parameters

- `title`: The title of the dialog window.
- `question`: The question to be asked to the user.
- `answer_type`: The type of the answer. Can be `str`, `int`, `float`, `alphanumeric` or `password`.
- `answer_default` (optional): The default answer. If `None`, the text input will be empty.
- `pattern` (optional): A pattern to validate the answer. # will be replaced by the number. For example, `##/##/####` can be used to ask for a date or `###.###.###-##` to ask for a CPF. If `None`, no pattern will be used.
- `allow_empty` (optional): If `True`, the user can leave the text input empty. If `False`, the user must input something.
- `allow_cancel` (optional): If `True`, the user can cancel the dialog window. If `False`, the user must answer the question.

```python
import dialoger

date = dialoger.ask('Birth date''', 'What is your birth date?', 'str', pattern='##/##/####', allow_empty=False, allow_cancel=False)

print(f"You were born in {date}")
```

### askwithanswers

The `askwithanswers` function creates a dialog window with a question and a list of choices. It returns the choice selected by the user.

#### Parameters

- `title`: The title of the dialog window.
- `question`: The question to be asked to the user.
- `choices`: A list of choices.

```python
import dialoger

answer = dialoger.askwithanswers('Favorite color', 'What is your favorite color?', ['Red', 'Green', 'Blue'])

print(f"Your favorite color is {answer}")
```

### confirm

The `confirm` function creates a dialog window with a message and two buttons. It returns `True` if the user clicks the first button, or `False` if the user clicks the second button. The default buttons are "Yes" and "No", but you can change them by passing a list of strings as the `choices` parameter.

#### Parameters

- `title`: The title of the dialog window.
- `message`: The message to be displayed to the user.
- `choices` (optional): A list of strings to be used as the buttons. The first string will be used as the first button, and the second string will be used as the second button. If `None`, the default buttons will be used.

```python
import dialoger

answer = dialoger.confirm('Confirm', 'Are you sure you want to delete this file?')

if answer:
    print('File deleted')
else:
    print('File not deleted')
```

### alert, info, error and success

The `alert`, `info`, `error` and `success` functions create a dialog window with a message and a button. They don't return anything.

#### Parameters

- `title`: The title of the dialog window.
- `message`: The message to be displayed to the user.

```python
import dialoger

dialoger.alert('Alert', 'This is an alert')
dialoger.info('Info', 'This is an info')
dialoger.error('Error', 'This is an error')
dialoger.success('Success', 'This is a success')
```

## License

Dialoger is licensed under the MIT License. See [LICENSE](LICENSE) for more information.

## Contributing

Contributions are welcome! You can contribute by opening an issue or submitting a pull request.

## Credits

Dialoger was created by [Guilherme Saldanha](https://guisaldanha.com).

            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/guisaldanha/dialoger",
    "name": "dialoger",
    "maintainer": "",
    "docs_url": null,
    "requires_python": "",
    "maintainer_email": "",
    "keywords": "tkinter,dialog,dialoger,dialogbox,dialogboxer,dialoguer,dialoguerbox,box,user interface,interactive,input,choices,alert,information,error,confirmation,easy-to-use,efficiency,user-friendly,pattern,date,number,date pattern,number pattern,pattern input,pattern input date,pattern input number",
    "author": "Guilherme Saldanha",
    "author_email": "guisaldanha@gmail.com",
    "download_url": "https://files.pythonhosted.org/packages/eb/40/d8b44ded6cc97c8db04acdf743a8f52d24e06af4ae8610e0eac0b25454da/dialoger-1.0.0.tar.gz",
    "platform": null,
    "description": "# Dialoger\n\n[![PyPI version](https://img.shields.io/pypi/v/dialoger)](https://img.shields.io/pypi/v/logandprint) [![License](https://img.shields.io/github/license/guisaldanha/dialoger)](LICENSE) [![Downloads](https://img.shields.io/pypi/dm/dialoger)](https://img.shields.io/pypi/dm/dialoger)\n\nDialoger is a Python package that provides a set of functions to create interactive dialog windows in Tkinter with ease.\n\n## Installation\n\nYou can install Dialoger using pip:\n\n```shell\npip install dialoger\n```\n\n## Usage\n\nDialoger provides a set of functions to create interactive dialog windows in Tkinter with ease. The functions are: `ask`, `askwithanswers`, `confirm`, `alert`, `info`, `error` and `success`.\n\n### ask\n\nThe `ask` function creates a dialog window with a question and a text input. It returns the text inputted by the user.\n\n#### Parameters\n\n- `title`: The title of the dialog window.\n- `question`: The question to be asked to the user.\n- `answer_type`: The type of the answer. Can be `str`, `int`, `float`, `alphanumeric` or `password`.\n- `answer_default` (optional): The default answer. If `None`, the text input will be empty.\n- `pattern` (optional): A pattern to validate the answer. # will be replaced by the number. For example, `##/##/####` can be used to ask for a date or `###.###.###-##` to ask for a CPF. If `None`, no pattern will be used.\n- `allow_empty` (optional): If `True`, the user can leave the text input empty. If `False`, the user must input something.\n- `allow_cancel` (optional): If `True`, the user can cancel the dialog window. If `False`, the user must answer the question.\n\n```python\nimport dialoger\n\ndate = dialoger.ask('Birth date''', 'What is your birth date?', 'str', pattern='##/##/####', allow_empty=False, allow_cancel=False)\n\nprint(f\"You were born in {date}\")\n```\n\n### askwithanswers\n\nThe `askwithanswers` function creates a dialog window with a question and a list of choices. It returns the choice selected by the user.\n\n#### Parameters\n\n- `title`: The title of the dialog window.\n- `question`: The question to be asked to the user.\n- `choices`: A list of choices.\n\n```python\nimport dialoger\n\nanswer = dialoger.askwithanswers('Favorite color', 'What is your favorite color?', ['Red', 'Green', 'Blue'])\n\nprint(f\"Your favorite color is {answer}\")\n```\n\n### confirm\n\nThe `confirm` function creates a dialog window with a message and two buttons. It returns `True` if the user clicks the first button, or `False` if the user clicks the second button. The default buttons are \"Yes\" and \"No\", but you can change them by passing a list of strings as the `choices` parameter.\n\n#### Parameters\n\n- `title`: The title of the dialog window.\n- `message`: The message to be displayed to the user.\n- `choices` (optional): A list of strings to be used as the buttons. The first string will be used as the first button, and the second string will be used as the second button. If `None`, the default buttons will be used.\n\n```python\nimport dialoger\n\nanswer = dialoger.confirm('Confirm', 'Are you sure you want to delete this file?')\n\nif answer:\n    print('File deleted')\nelse:\n    print('File not deleted')\n```\n\n### alert, info, error and success\n\nThe `alert`, `info`, `error` and `success` functions create a dialog window with a message and a button. They don't return anything.\n\n#### Parameters\n\n- `title`: The title of the dialog window.\n- `message`: The message to be displayed to the user.\n\n```python\nimport dialoger\n\ndialoger.alert('Alert', 'This is an alert')\ndialoger.info('Info', 'This is an info')\ndialoger.error('Error', 'This is an error')\ndialoger.success('Success', 'This is a success')\n```\n\n## License\n\nDialoger is licensed under the MIT License. See [LICENSE](LICENSE) for more information.\n\n## Contributing\n\nContributions are welcome! You can contribute by opening an issue or submitting a pull request.\n\n## Credits\n\nDialoger was created by [Guilherme Saldanha](https://guisaldanha.com).\n",
    "bugtrack_url": null,
    "license": "MIT",
    "summary": "A package that provides a simple and user-friendly interface for creating interactive windows in Tkinter. Provides functions to create input windows, option list windows, alerts, information, errors and confirmation windows with options. Simplify user interaction with your program quickly and efficiently. One of the main functions is that it is possible to use patterns for certain answers, which allows requiring the user to have a date pattern, or input of numbers.",
    "version": "1.0.0",
    "project_urls": {
        "Homepage": "https://github.com/guisaldanha/dialoger"
    },
    "split_keywords": [
        "tkinter",
        "dialog",
        "dialoger",
        "dialogbox",
        "dialogboxer",
        "dialoguer",
        "dialoguerbox",
        "box",
        "user interface",
        "interactive",
        "input",
        "choices",
        "alert",
        "information",
        "error",
        "confirmation",
        "easy-to-use",
        "efficiency",
        "user-friendly",
        "pattern",
        "date",
        "number",
        "date pattern",
        "number pattern",
        "pattern input",
        "pattern input date",
        "pattern input number"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "b5f612235453d6c4e38e784d9187c69f54c2e0e73a1e4b57ad23887e5678def0",
                "md5": "60f348ece1bbf82fe09bba0dc5971341",
                "sha256": "d22212cfe47d721bfb3f3c07e2a4f32079cfa42ff4c3f3e2bc2a2affe5ae9865"
            },
            "downloads": -1,
            "filename": "dialoger-1.0.0-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "60f348ece1bbf82fe09bba0dc5971341",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": null,
            "size": 22689,
            "upload_time": "2023-05-12T08:17:52",
            "upload_time_iso_8601": "2023-05-12T08:17:52.955032Z",
            "url": "https://files.pythonhosted.org/packages/b5/f6/12235453d6c4e38e784d9187c69f54c2e0e73a1e4b57ad23887e5678def0/dialoger-1.0.0-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "eb40d8b44ded6cc97c8db04acdf743a8f52d24e06af4ae8610e0eac0b25454da",
                "md5": "4ee909c6d12d4378e9d4c90f5cd1da1e",
                "sha256": "4f74dfb6583572e50dc28fc66a1a38a5a20f559fc25bd0c282d5a4b2d23828e3"
            },
            "downloads": -1,
            "filename": "dialoger-1.0.0.tar.gz",
            "has_sig": false,
            "md5_digest": "4ee909c6d12d4378e9d4c90f5cd1da1e",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": null,
            "size": 20306,
            "upload_time": "2023-05-12T08:17:55",
            "upload_time_iso_8601": "2023-05-12T08:17:55.335191Z",
            "url": "https://files.pythonhosted.org/packages/eb/40/d8b44ded6cc97c8db04acdf743a8f52d24e06af4ae8610e0eac0b25454da/dialoger-1.0.0.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2023-05-12 08:17:55",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "guisaldanha",
    "github_project": "dialoger",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "lcname": "dialoger"
}
        
Elapsed time: 0.06352s