semvec/pypi-packages huggingface dataset:
kirami-plugin-beauty-rate 0.1.2
基于 KiramiBot 的颜值评分插件
License: MIT
Requires Python: >=3.10

<div align="center">
  <a href="#"><img src="https://kiramibot.dev/img/logo.svg" width="180" height="180" alt="KiramiBotPluginLogo"></a>
</div>

<div align="center">

# kirami-plugin-beauty-rate

_✨ 让 Bot 为你的颜值打分！ ✨_


<a href="./LICENSE">
    <img src="https://img.shields.io/github/license/KomoriDev/kirami-plugin-beauty-rate.svg" alt="license">
</a>
<a href="https://pypi.python.org/pypi/kirami-plugin-beauty-rate">
    <img src="https://img.shields.io/pypi/v/kirami-plugin-beauty-rate.svg" alt="pypi">
</a>
<img src="https://img.shields.io/badge/python-3.10+-blue.svg" alt="python">

</div>

## 📖 介绍

颜值打分插件。使用 [百度云人脸识别云服务](https://cloud.baidu.com/product/face)

## 💿 安装

在 KiramiBot 项目的插件目录下, 打开命令行, 根据你使用的包管理器, 输入相应的安装命令

<details>
<summary>pip</summary>
  
```bash
pip install kirami-plugin-beauty-rate
```

</details>
<details>
<summary>pdm</summary>

```bash
pdm add kirami-plugin-beauty-rate
```

</details>
<details>
<summary>poetry</summary>

```bash
poetry add kirami-plugin-beauty-rate
```

</details>
<details>
<summary>conda</summary>

```bash
conda install kirami-plugin-beauty-rate
```

</details>

打开 KiramiBot 项目根目录下的配置文件文件, 以 `kirami.toml` 为例，在 `[plugin]` 部分追加写入

```toml
plugins = ["kirami_plugin_beauty_rate"]
```

## ⚙️ 配置

打开 KiramiBot 项目的配置文件，在 `[beauty_rate]` 部分添加下表中的必填配置

> `api_key` 和 `secret_key` 可以从 [这里](https://cloud.baidu.com/product/face) 获取

| 配置项 | 必填 | 默认值 | 说明 |
|:-----:|:----:|:----:|:----:|
| api_key | 是 | 无 | 无 |
| secret_key | 是 | 无 | 无 |

## 🎉 使用

### 指令表

| 指令 | 权限 | 需要@ | 范围 | 说明 |
|:-----:|:----:|:----:|:----:|:----:|
| 颜值评分 | 无 | 否 | 私聊/群聊 | 别名：颜值打分 |

### 效果图

~~理论上，这里应该有些图片~~

## ❤️ 鸣谢

感谢以下 开发者 和 Github项目 对 本项目 作出的贡献：（排名不分先后）

* [`zhulinyv/NJS`](https://github.com/zhulinyv/NJS)：基于 NoneBot 的 QQ 机器人（本项目直接参考）
convertpngs 0.0.4
a module about converting pngs to gif or video in simplified ways.
License: MIT
Keywords: convertpngs,png,gif,video,mp4,opencv,pillow,animation,convert,pngs,png2gif,png2video,png2mp4,png2avi,png2mp4,png2video

### INTRODUCTION

convertpngs is a module to help you to do some image processing work. It is based on the opencv-python module and Pillow module, convert the multiple png files to form of gif or mp4. It is a module that CYC wrote for his own use, but I think it is useful for others, so I published it.

### IMPORTANT

If you encounter the ModuleNotFoundError when using this module, you need to manually install the module in the lastest version:
`pip install opencv-python`
`pip install Pillow`

Also, some modules do not support the previous version of python, make sure you are using the version 3.7 or above.

There still exist some bugs in this module, if you find any, please contact me by email: vichouro@gmail.com . Thank you. Some function reported bugs have added the caution hint when called.

### INSTALLATION
- Install guide: (run on your powershell or cmd)

    `pip install convertpngs`

- Update guide: (run on your powershell or cmd)

    `pip install --upgrade convertpngs`
    
    or directly run the python script below:
    ```python
    from convertpngs import upgrade
    ```

---



### USAGE

#### Convert pngs to gif
If you want to convert the png files to gif, you can use the function `to_gif` in the module `convert_pngs`. The function has three parameters, the first one is the input folder path, the second one is the output file name, and the third one is the duration of each frame. The default value of the third parameter is 100, which means 100 milliseconds. The function will return the path of the output file.

```python
# 導入套件
from convertpngs import convert_pngs as cp

# 指定輸入資料夾和輸出GIF文件的名稱
input_folder = 'hotspot_TPP'  # 替換PNG檔案所在的資料夾路徑
output_file = 'output.gif'  # 替換為輸出的GIF檔案名稱
cp.to_gif(input_folder, output_file, duration=100, loop=0) # 每一張的顯示時間，100就是100毫秒
```

#### Convert pngs to mp4
If you want to convert the png files to mp4, you can use the function `to_mp4` in the module `convert_pngs`. The function has three parameters, the first one is the input folder path, the second one is the output file name, and the third one is the fps of the video. The default value of the third parameter is 10, which means 10 frames per second. The function will return the path of the output file.

```python
# 導入套件
from convertpngs import convert_pngs as cp

# 指定輸入資料夾和輸出MP4文件的名稱
input_folder = 'hotspot'  # 替換為PNG檔案所在的資料夾路徑
output_file = 'output.mp4'  # 替換為輸出的MP4文件名稱
cp.to_mp4(input_folder, output_file, fps=30)  # 這裡的fps是幀率，可以根據需要調整
```

Let's all, enjoy the beauty of simplification of this module.

---

### CHANGE LOG

#### 0.0.1 (29/09/2023)
- First Release

#### 0.0.3 (29/09/2023)
- Minor bug fixes

#### 0.04 (30/09/2023)
- Fixing the bugs for displacement of the first frame of the gif
coworker 2.0.1
Generic worker that performs concurrent tasks using coroutine.
License: MIT
Keywords: coroutine concurrent worker

coworker
==============

Generic worker that performs concurrent tasks using coroutine.

Quick Start Tutorial
====================

Define how a task is performed -- `do_task` takes a single input and optionally returns a result:

.. code-block:: python

    from coworker import Coworker

    class SquareWorker(Coworker):
        async def do_task(self, task):  # Task can be anything, such as a tuple with a callable and args.
            return task * task

Now let's do some work:

.. code-block:: python

    import asyncio

    async def background_worker_example():
        worker = SquareWorker(max_concurrency=5)    # Only 5 tasks will run concurrently. Defalts to 10

        # Single task
        result = await worker.do(2)
        print(result)   # result = 4

        # Mulitiple tasks -- get all results after everything is done
        tasks = list(range(100))
        results = await worker.do(tasks)
        print(results)  # results = [0, 1, 4, 9, ...]

        # Mulitiple tasks -- get first completed
        tasks = list(range(10))
        for result in worker.do(tasks, as_iterator=True):
            print(await result)  # results = 0, 1, 4, 9, ...

    # Run async usage example
    asyncio.run(background_worker_example())

Besides `max_concurrency`, you can also pass the following params to Coworker:

* `sliding_window` to use sliding window or tumbling window when processing the tasks concurrently. Defaults to True.
* `do_task` for a callable to do the task instead of having to sub-class. E.g. Coworker(do_task=lamdba x: x * x)

Links & Contact Info
====================

| PyPI Package: https://pypi.python.org/pypi/coworker
| GitHub Source: https://github.com/maxzheng/coworker
| Report Issues/Bugs: https://github.com/maxzheng/coworker/issues
|
| Connect: https://www.linkedin.com/in/maxzheng
| Contact: maxzheng.os @t gmail.com