semvec/pypi-packages huggingface dataset:
pypinyin-g2pw 0.4.0
基于 g2pW 提升 pypinyin 的准确性。
Requires Python: >=3.6, <4

# pypinyin-g2pW

基于 [g2pW](https://github.com/GitYCC/g2pW/) 提升 [pypinyin](https://github.com/mozillazg/python-pinyin) 的准确性。

特点：

* 可以通过训练模型的方式提升拼音准确性。
* 功能和使用习惯与 pypinyin 基本保持一致，支持多种拼音风格。


## 使用

### 安装依赖

1. 安装 [PyTorch](https://pytorch.org/get-started/locally/)。
2. 下载并解压 G2PWModel:

    ```
    wget https://storage.googleapis.com/esun-ai/g2pW/G2PWModel-v2-onnx.zip
    unzip G2PWModel-v2-onnx.zip
    ```
3. 安装 [git-lfs](https://git-lfs.github.com/)。
4. 下载 [bert-base-chinese](https://huggingface.co/bert-base-chinese):

   ```
   git lfs install
   git clone https://huggingface.co/bert-base-chinese
   ```
5. 安装本项目:

   ```
   pip install pypinyin-g2pw
   ```

### 使用示例

   ```python
   >>> from pypinyin import Style
   >>> from pypinyin_g2pw import G2PWPinyin

   # 需要将 model_dir 和 model_source 的值指向下载的模型数据目录
   >>> g2pw = G2PWPinyin(model_dir='G2PWModel/',
                         model_source='bert-base-chinese/',
                         v_to_u=False, neutral_tone_with_five=True)
   >>> han = '然而，他红了20年以后，他竟退出了大家的视线。'

   # def lazy_pinyin(self, hans, style=Style.NORMAL, errors='default', strict=True, **kwargs)
   # 通过 lazy_pinyin 方法获取拼音数据，各个参数的含义和作用跟 pypinyin 中是一样的，
   # v_to_u 和 neutral_tone_with_five 参数只能在初始化 G2PWPinyin 时指定。

   >>> g2pw.lazy_pinyin(han)
   ['ran', 'er', '，', 'ta', 'hong', 'le', '20', 'nian', 'yi', 'hou', '，', 'ta', 'jing', 'tui', 'chu', 'le', 'da', 'jia', 'de', 'shi', 'xian', '。']

   >>> g2pw.lazy_pinyin(han, style=Style.TONE)
   ['rán', 'ér', '，', 'tā', 'hóng', 'le', '20', 'nián', 'yǐ', 'hòu', '，', 'tā', 'jìng', 'tuì', 'chū', 'le', 'dà', 'jiā', 'de', 'shì', 'xiàn', '。']

   >>> g2pw.lazy_pinyin(han, style=Style.TONE3)
   ['ran2', 'er2', '，', 'ta1', 'hong2', 'le5', '20', 'nian2', 'yi3', 'hou4', '，', 'ta1', 'jing4', 'tui4', 'chu1', 'le5', 'da4', 'jia1', 'de5', 'shi4', 'xian4', '。']
   ```

## 离线使用

默认情况下，即便使用了离线的模型数据，程序使用的 transformers 模块仍旧会从 huggingface.co 下载部分模型元数据。
可以通过设置环境变量 `TRANSFORMERS_OFFLINE=1` 以及环境变量 `HF_DATASETS_OFFLINE=1` 禁用获取元数据的操作，实现完全离线使用的需求。
详见 [transformers 官方文档](https://huggingface.co/docs/transformers/v4.21.2/en/installation#offline-mode)。


## 模型训练

详见 [g2pW](https://github.com/GitYCC/g2pW/#train-model) 官方文档中的说明。
boombing 0.2
boombing a Library Python
Requires Python: ~=3.6
Keywords: bot,sms,boombers,boomber

# Boombers

> Boombers Library Python

=> Install and Update:

```python
pip install -U boombing
```

=> START

> doc: github.com/onlyrad/boombers

# Social Media:
Telegram: @OnlyRad <br>
github: github.com/OnlyRad <br>
rubika: rubika.ir/OnlyMamad
nuclearcraft-designer 0.4.0
Generates multiblock designs for NuclearCraft.
Requires Python: >=3.10

# NuclearCraft Designer
Generates multiblock designs for NuclearCraft.

## Installation
NuclearCraft Designer can be installed via pip using the following command:
```shell
pip install nuclearcraft-designer
```

## Usage
Design the best rotor blade sequence of length 10 optimized for 400% expansion using a maximum of 1 SiC-SiC-CMC blade.
```python
from nuclearcraft_designer.overhauled import turbine_rotor_blade

if __name__ == "__main__":
    gen = turbine_rotor_blade.designer.RotorBladeSequenceDesigner().design_generator(
        10,
        4.0,
        {
            "sic_sic_cmc": 1
        }
    )
    seq = []
    for seq in gen:
        pass
    
    # Print the best sequence.
    for blade in seq:
        print(blade.name, end=" ")
    print()
```
Design the best dynamo coil configuration with a side length of 3 and a shaft width of 1:
```python
from nuclearcraft_designer.overhauled import turbine_dynamo_coil

if __name__ == "__main__":
    gen = turbine_dynamo_coil.designer.DynamoCoilConfigurationDesigner().design_generator(
        3,
        1,
        {
            "connector": 0  # Enabling connectors can lead to invalid designs.
        }
    )
    seq = []
    for seq in gen:
        pass

    for y in range(seq.dims[0]):
        for x in range(seq.dims[1]):
            print(seq[y, x].name, end=" ")
        print()
```

### OR-Tools Powered Designers
Certain NuclearCraft Designer designers have OR-Tools powered alternatives. They are generally faster than the normal designers, but are less reliable and may have fewer features.

OR-Tools is not a required dependency. Use the following command to install it:
```shell
pip install ortools
```
The above usage examples can be done as follows (with missing features omitted):
```python
from nuclearcraft_designer.overhauled import turbine_rotor_blade

if __name__ == "__main__":
    status, sequence = turbine_rotor_blade.beta_designer.RotorBladeSequenceDesigner().design(
        10,
        4.0,
        {
            "sic_sic_cmc": 1
        }
    )
    print(status)
    for blade in sequence:
        print(blade.name, end=" ")
    print()
```
Note that the OR-Tools powered designer can design 7x7 turbines in a reasonable amount of time, while the normal designer can't do so for 5x5 turbines.
```python
from nuclearcraft_designer.overhauled import turbine_dynamo_coil

if __name__ == "__main__":
    status, configuration = turbine_dynamo_coil.beta_designer.DynamoCoilConfigurationDesigner().design(
        7,
        1,
        {
            "connector": 0  # Enabling connectors can lead to invalid designs.
        }
    )
    print(status)
    for y in range(configuration.dims[0]):
        for x in range(configuration.dims[1]):
            print(configuration[y, x].name, end=" ")
        print()
```
hydrus-video-deduplicator 0.1.0
Video deduplicator utility for Hydrus Network
Requires Python: >=3.10

<div align="center">
  
 # Hydrus Video Deduplicator
  <img src="https://github.com/appleappleapplenanner/hydrus-video-deduplicator/assets/104981058/968603d3-5a11-4a05-bbb4-7b91b71fb61d">

  
Hydrus Video Deduplicator detects similar video files and marks them as potential duplicates through the Hydrus API

</div>

---

## How It Works:
The deduplicator works by comparing videos by computing a perceptual hash.

A perceptual hash is a way to characterize videos in small chunks.

The perceptual hashes are stored in a database file in the running directory to avoid computing them every time.

Once all perceptual hashes for all the videos in your database are computed, they are compared against each other to detect if they're similar. If they are similar, they will be marked as potential duplicates in Hydrus.

The accuracy is extremely good because of [vpdq](https://github.com/facebook/ThreatExchange/tree/main/vpdq). You can adjust the threshold of similarity using `--threshold`. The default is 75%.

---

## Installation:

[Install with pip](https://github.com/appleappleapplenanner/hydrus-video-deduplicator/wiki/Installation)

---

## Usage:

0. Backup your database and files unless you trust a stranger on an anonymous Github alternate account to not ruin your hard work. 

1. [Enable the Hydrus Client API](https://hydrusnetwork.github.io/hydrus/client_api.html#enabling_the_api) and create an access key with all permissions.

2. Run and enter your access key as a parameter

```sh
python3 -m hydrus_video_deduplicator --api-key="<your key>"
```

##### See full list of options with `--help`

<br>

Similar video files should now be marked as duplicates in Hydrus.

You can run the program again when you add more files to find more duplicates.

---

## TODO:
- [ ] Option to rollback and remove potential duplicates
- [x] Option to enter custom Hydrus tag search parameters
- [ ] Parallelize hashing and duplicate search
- [ ] Automatically generate access key with Hydrus API
- [ ] Upload to PyPI
- [ ] Windows compatibility without WSL
- [ ] Docker container (?)

Please create an issue on Github if you have any problems or questions! Pull requests also welcome on this or my VideoHash fork. 

There is a lot to improve and cleanup and I'm more experienced in C than Python, so fix stuff please.

---

## Credits:
[Hydrus Network](https://github.com/hydrusnetwork/hydrus) by dev

[Hydrus API Library](https://gitlab.com/cryzed/hydrus-api) by Cryzed

[vpdq](https://github.com/facebook/ThreatExchange/tree/main/vpdq) by Meta

various other files from threatexchange by Meta
maida 0.2.1
No description.
Requires Python: >=3.7

# maida 

**目前：**
1. 用于发送邮件  
2. 小说图片转文字

---
## 安装
可以直接 `pip` 安装
> pip install maida

##  mail
###  EmailSender
基于 `smtplib` 的发送邮件脚本  
```text
1. 可以发送文本
2. 可以发送图片
3. 可以发送附件（图片、文件等），附件文件名可以包含中文
4. 可以群发邮件
5. 可以设置邮件优先级（如标红）
```

### demo
```text
from maida import EmailSender

email_sender = EmailSender(email_host='smtp.qq.com', email_port=465, from_addr='xxx@qq.com', email_pass='xxx')
content = '这是 maida 发送过来的邮件。请注意查收！'
email_sender.attach_text(text=content)
email_sender.attach_file(r'C:\xxx\xx.jpg')
email_sender.attach_file(r'C:\xxx\xx.txt')
email_sender.send(to_addrs=['xxx@qq.com'], subject='测-试')
```

## ocr【可选】

**安装方式**

> pip install maida[ocr]

win 平台安装时若报 `python-levenshtein` 安装失败请根据提示安装相应环境  

或在 https://www.lfd.uci.edu/~gohlke/pythonlibs/#python-levenshtein 使用 whl 安装


### img_2_cn
基于 [cnocr](https://github.com/breezedeus/cnocr) 的小说图片转中文文字脚本  

这里提供了一个[来源于网上的小说图片样例](https://github.com/LZC6244/maida/blob/master/test_files/test_img_2_cn.gif)  

可以看出识别效果还是不错的

### demo
```text
from maida.ocr import img_2_cn

print(img_2_cn('xxx.gif'))
```

## 版本历程
详见 [history.md](https://github.com/LZC6244/maida/blob/master/docs/history.md)