# ๐ป Bot UI Kitty
[![Development Status](https://img.shields.io/pypi/status/bot-ui-kitty?color=orange)](https://pypi.org/project/bot-ui-kitty/)
[![Latest Version on PyPI](https://img.shields.io/pypi/v/bot-ui-kitty)](https://pypi.org/project/bot-ui-kitty/)
[![Supported Python Versions](https://img.shields.io/pypi/pyversions/bot-ui-kitty)](https://pypi.org/project/bot-ui-kitty/)
[![Build Status](https://img.shields.io/github/actions/workflow/status/nuztalgia/bot-ui-kitty/build.yml?branch=main)](https://github.com/nuztalgia/bot-ui-kitty/actions/workflows/build.yml)
[![CodeQL Status](https://img.shields.io/github/actions/workflow/status/nuztalgia/bot-ui-kitty/codeql.yml?branch=main&label=codeQL)](https://github.com/nuztalgia/bot-ui-kitty/actions/workflows/codeql.yml)
[![CodeFactor Grade](https://img.shields.io/codefactor/grade/github/nuztalgia/bot-ui-kitty/main?label=codefactor)](https://www.codefactor.io/repository/github/nuztalgia/bot-ui-kitty)
A collection of reusable, dynamic, and intuitive Discord UI views, built on top
of Pycord's [**Bot UI Kit**](https://docs.pycord.dev/en/master/api/ui_kit.html).
This project was originally created for personal use in my (way too many)
Discord bots, but I decided to make it more easily accessible just in case other
bot developers find it helpful. ๐
Currently, the only supported Discord library is **[Pycord]**, because that's
the one that most of my bots happen to use. I'd love to extend support to other
libraries too, but I'm not sure when I'll be able to make the time to do so. In
the meantime, if you're using a different library, check out my other utility
kit for Discord bots โ **[Botstrap]**!
[pycord]: https://github.com/Pycord-Development/pycord
[botstrap]: https://github.com/nuztalgia/botstrap
[**Contributions**][1] to this project are very welcome, as long as they
[pass](https://results.pre-commit.ci/latest/github/nuztalgia/bot-ui-kitty/main)
[all](https://github.com/nuztalgia/bot-ui-kitty/actions/workflows/build.yml)
[the](https://github.com/nuztalgia/bot-ui-kitty/actions/workflows/codeql.yml)
[checks](https://www.codefactor.io/repository/github/nuztalgia/bot-ui-kitty) to
keep it green and healthy. โ
[1]: https://github.com/nuztalgia/bot-ui-kitty/blob/main/.github/contributing.md
## Installation
```
pip install -U bot-ui-kitty
```
Python **3.10** or higher is required. It's also generally a good idea to
upgrade pip (`python -m pip install -U pip`).
### For Development
```
git clone https://github.com/nuztalgia/bot-ui-kitty.git
cd bot-ui-kitty
pip install -e .
```
This will create an [editable installation] of `bot-ui-kitty` in your current
environment. Any changes you make to the code will immediately take effect, so
using a [virtual env] is highly recommended!
[editable installation]:
https://pip.pypa.io/en/stable/topics/local-project-installs/#editable-installs
[virtual env]: https://docs.python.org/3/tutorial/venv.html
## Available Views
### [Dynamic Select](https://github.com/nuztalgia/bot-ui-kitty#dynamic-select)
This view is designed to handle any use case that calls for selecting a single
item from a sequence of possible options. It'll automatically choose to display
either a row of buttons, a dropdown menu, or a combination of both (to emulate
pagination) depending on the **number of options** you throw at it! ๐คน
- **Example 1:** Choose your starter Pokemon! (**3** options)
![image](https://user-images.githubusercontent.com/95021853/202794482-60a5ca50-7593-4f66-a160-3ba1509d4d84.png)
```py
number = await uikitty.dynamic_select(
ctx,
content="Choose your starter Pokemon!",
**{"๐ฑ Bulbasaur": 1, "๐ฅ Charmander": 4, "๐ง Squirtle": 7},
)
await ctx.edit(content=f"Your Pokemon's number is **#00{number}**!", view=None)
```
***
- **Example 2:** What time is it, Mr. Wolf? (**24** options)
![image](https://user-images.githubusercontent.com/95021853/202796751-5f541611-4806-4918-ad34-aa347f92b807.png)
```py
time = await uikitty.dynamic_select(
ctx,
*[f"{str(i).zfill(2)}:00" for i in range(24)],
select_placeholder="What time is it, Mr. Wolf?",
)
await ctx.edit(content=f"It's ~~{time}~~ **DINNER TIME!!!**", view=None)
```
***
- **Example 3:** I heard you like chemistry... (**119** options)
![image](https://user-images.githubusercontent.com/95021853/202812334-ac9ee8a9-3083-4276-b0b2-edbcf8cef30e.png)
```py
element = await uikitty.dynamic_select(
ctx,
embed=Embed(title="Select an element to learn more about it!", color=color),
**elements_data,
)
embed = Embed(
title=element["name"], description=element["summary"], url=element["source"],
)
await ctx.edit(embed=embed, view=None)
```
**Note:** `elements_data` in the above snippet is sourced from
[Bowserinator/Periodic-Table-JSON][periodic-table-json].
[periodic-table-json]: https://github.com/Bowserinator/Periodic-Table-JSON
***
More types of views will be coming soon. Watch this space! ๐
## License
Copyright ยฉ 2022 [Nuztalgia](https://github.com/nuztalgia). Released under the
[Apache License, Version 2.0][license].
[license]: https://github.com/nuztalgia/bot-ui-kitty/blob/main/LICENSE
Raw data
{
"_id": null,
"home_page": "https://github.com/nuztalgia/bot-ui-kitty",
"name": "bot-ui-kitty",
"maintainer": "",
"docs_url": null,
"requires_python": ">=3.10",
"maintainer_email": "",
"keywords": "bot,components,discord,kitty,ui,ui kit,utilities,views",
"author": "Nuztalgia",
"author_email": "nuztalgia@gmail.com",
"download_url": "https://files.pythonhosted.org/packages/87/7c/2bbe474b182980cd3e9c274790fc68a90563586d98534fc79e68b9e53f9b/bot-ui-kitty-0.1.5.tar.gz",
"platform": null,
"description": "# \ud83d\ude3b Bot UI Kitty\n\n[![Development Status](https://img.shields.io/pypi/status/bot-ui-kitty?color=orange)](https://pypi.org/project/bot-ui-kitty/)\n[![Latest Version on PyPI](https://img.shields.io/pypi/v/bot-ui-kitty)](https://pypi.org/project/bot-ui-kitty/)\n[![Supported Python Versions](https://img.shields.io/pypi/pyversions/bot-ui-kitty)](https://pypi.org/project/bot-ui-kitty/)\n[![Build Status](https://img.shields.io/github/actions/workflow/status/nuztalgia/bot-ui-kitty/build.yml?branch=main)](https://github.com/nuztalgia/bot-ui-kitty/actions/workflows/build.yml)\n[![CodeQL Status](https://img.shields.io/github/actions/workflow/status/nuztalgia/bot-ui-kitty/codeql.yml?branch=main&label=codeQL)](https://github.com/nuztalgia/bot-ui-kitty/actions/workflows/codeql.yml)\n[![CodeFactor Grade](https://img.shields.io/codefactor/grade/github/nuztalgia/bot-ui-kitty/main?label=codefactor)](https://www.codefactor.io/repository/github/nuztalgia/bot-ui-kitty)\n\nA collection of reusable, dynamic, and intuitive Discord UI views, built on top\nof Pycord's [**Bot UI Kit**](https://docs.pycord.dev/en/master/api/ui_kit.html).\n\nThis project was originally created for personal use in my (way too many)\nDiscord bots, but I decided to make it more easily accessible just in case other\nbot developers find it helpful. \ud83d\udc9c\n\nCurrently, the only supported Discord library is **[Pycord]**, because that's\nthe one that most of my bots happen to use. I'd love to extend support to other\nlibraries too, but I'm not sure when I'll be able to make the time to do so. In\nthe meantime, if you're using a different library, check out my other utility\nkit for Discord bots \u2013 **[Botstrap]**!\n\n[pycord]: https://github.com/Pycord-Development/pycord\n[botstrap]: https://github.com/nuztalgia/botstrap\n\n[**Contributions**][1] to this project are very welcome, as long as they\n[pass](https://results.pre-commit.ci/latest/github/nuztalgia/bot-ui-kitty/main)\n[all](https://github.com/nuztalgia/bot-ui-kitty/actions/workflows/build.yml)\n[the](https://github.com/nuztalgia/bot-ui-kitty/actions/workflows/codeql.yml)\n[checks](https://www.codefactor.io/repository/github/nuztalgia/bot-ui-kitty) to\nkeep it green and healthy. \u2705\n\n[1]: https://github.com/nuztalgia/bot-ui-kitty/blob/main/.github/contributing.md\n\n## Installation\n\n```\npip install -U bot-ui-kitty\n```\n\nPython **3.10** or higher is required. It's also generally a good idea to\nupgrade pip (`python -m pip install -U pip`).\n\n### For Development\n\n```\ngit clone https://github.com/nuztalgia/bot-ui-kitty.git\ncd bot-ui-kitty\npip install -e .\n```\n\nThis will create an [editable installation] of `bot-ui-kitty` in your current\nenvironment. Any changes you make to the code will immediately take effect, so\nusing a [virtual env] is highly recommended!\n\n[editable installation]:\n https://pip.pypa.io/en/stable/topics/local-project-installs/#editable-installs\n[virtual env]: https://docs.python.org/3/tutorial/venv.html\n\n## Available Views\n\n### [Dynamic Select](https://github.com/nuztalgia/bot-ui-kitty#dynamic-select)\n\nThis view is designed to handle any use case that calls for selecting a single\nitem from a sequence of possible options. It'll automatically choose to display\neither a row of buttons, a dropdown menu, or a combination of both (to emulate\npagination) depending on the **number of options** you throw at it! \ud83e\udd39\n\n- **Example 1:** Choose your starter Pokemon! (**3** options)\n\n ![image](https://user-images.githubusercontent.com/95021853/202794482-60a5ca50-7593-4f66-a160-3ba1509d4d84.png)\n\n ```py\n number = await uikitty.dynamic_select(\n ctx,\n content=\"Choose your starter Pokemon!\",\n **{\"\ud83c\udf31 Bulbasaur\": 1, \"\ud83d\udd25 Charmander\": 4, \"\ud83d\udca7 Squirtle\": 7},\n )\n await ctx.edit(content=f\"Your Pokemon's number is **#00{number}**!\", view=None)\n ```\n\n ***\n\n- **Example 2:** What time is it, Mr. Wolf? (**24** options)\n\n ![image](https://user-images.githubusercontent.com/95021853/202796751-5f541611-4806-4918-ad34-aa347f92b807.png)\n\n ```py\n time = await uikitty.dynamic_select(\n ctx,\n *[f\"{str(i).zfill(2)}:00\" for i in range(24)],\n select_placeholder=\"What time is it, Mr. Wolf?\",\n )\n await ctx.edit(content=f\"It's ~~{time}~~ **DINNER TIME!!!**\", view=None)\n ```\n\n ***\n\n- **Example 3:** I heard you like chemistry... (**119** options)\n\n ![image](https://user-images.githubusercontent.com/95021853/202812334-ac9ee8a9-3083-4276-b0b2-edbcf8cef30e.png)\n\n ```py\n element = await uikitty.dynamic_select(\n ctx,\n embed=Embed(title=\"Select an element to learn more about it!\", color=color),\n **elements_data,\n )\n embed = Embed(\n title=element[\"name\"], description=element[\"summary\"], url=element[\"source\"],\n )\n await ctx.edit(embed=embed, view=None)\n ```\n\n **Note:** `elements_data` in the above snippet is sourced from\n [Bowserinator/Periodic-Table-JSON][periodic-table-json].\n\n [periodic-table-json]: https://github.com/Bowserinator/Periodic-Table-JSON\n\n ***\n\nMore types of views will be coming soon. Watch this space! \ud83d\udc40\n\n## License\n\nCopyright \u00a9 2022 [Nuztalgia](https://github.com/nuztalgia). Released under the\n[Apache License, Version 2.0][license].\n\n[license]: https://github.com/nuztalgia/bot-ui-kitty/blob/main/LICENSE\n",
"bugtrack_url": null,
"license": "Apache-2.0",
"summary": "A UI kit containing reusable, dynamic, and intuitive views for Discord bots.",
"version": "0.1.5",
"split_keywords": [
"bot",
"components",
"discord",
"kitty",
"ui",
"ui kit",
"utilities",
"views"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "edb9b04a1a7f17e31835ab1f0aec537e8292a782a289a5b46eab527b1436a72b",
"md5": "cec3100143896bfcd540344747563e1d",
"sha256": "bd97e1473a10231c8f1182a41805a037f0f15a42183099217bbb42a75fa1a747"
},
"downloads": -1,
"filename": "bot_ui_kitty-0.1.5-py3-none-any.whl",
"has_sig": false,
"md5_digest": "cec3100143896bfcd540344747563e1d",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.10",
"size": 14151,
"upload_time": "2023-02-01T02:01:19",
"upload_time_iso_8601": "2023-02-01T02:01:19.132190Z",
"url": "https://files.pythonhosted.org/packages/ed/b9/b04a1a7f17e31835ab1f0aec537e8292a782a289a5b46eab527b1436a72b/bot_ui_kitty-0.1.5-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "877c2bbe474b182980cd3e9c274790fc68a90563586d98534fc79e68b9e53f9b",
"md5": "6fca22f1d3c45db564a413eec493b082",
"sha256": "cfdf6992800f25804b0b3a9fd970cc01e94104bdacf944d5d80c5cdfab325a48"
},
"downloads": -1,
"filename": "bot-ui-kitty-0.1.5.tar.gz",
"has_sig": false,
"md5_digest": "6fca22f1d3c45db564a413eec493b082",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.10",
"size": 18179,
"upload_time": "2023-02-01T02:01:20",
"upload_time_iso_8601": "2023-02-01T02:01:20.669105Z",
"url": "https://files.pythonhosted.org/packages/87/7c/2bbe474b182980cd3e9c274790fc68a90563586d98534fc79e68b9e53f9b/bot-ui-kitty-0.1.5.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2023-02-01 02:01:20",
"github": true,
"gitlab": false,
"bitbucket": false,
"github_user": "nuztalgia",
"github_project": "bot-ui-kitty",
"travis_ci": false,
"coveralls": false,
"github_actions": true,
"lcname": "bot-ui-kitty"
}