semvec/pypi-packages huggingface dataset:
ai-tools-zxw 2.8.25
薛伟的AI工具集

# 人工智能操作的常用函数包

### 更新记录:
- 2.8.12 : llm api 新增: 清除上一条对话
- 2.8.13 : 去除单条对话的print语句
- 2.8.14 : 去除另单条对话的print语句

### 集合了常用的文件处理模块

#### 具体如下:

- 数据预处理
  - 图形图像
      - 视频提取图像
      - 自动分割
      - 图形自动标注
  - 文本
      - 中文文本清洗

- 数据可视化

1. 拟合，分类 示例
2. 直方图，散点图，线图，饼图，热力图，箱线图 示例


- 数据标注

1. 图象：指定类别，自动标注

![img.png](img.png)

![img_1.png](img_1.png)


# 更新说明
1. version="2.8.15" ,  新增通义千问接口
2. version="2.8.16" ,  优化LLM : 通义千问,  采用OpenAI兼容接口,  对话中增加temperature控制, 可以不传入值.
3. version="2.8.17" ,  通义千问,对话增加timeout参数
4. version="2.8.18" ,  通义千问, 增加系统角色设置
5. version="2.8.19" ,  通义千问, 增加模型选择: qwen-plus, qwen-turbo
6. version="2.8.20" ,  通义千问, bug fix
7. version="2.8.21" ,  通义千问, 增加同步流式输出
8. version="2.8.22" ,  通义千问, 增加异步流式输出
9. version="2.8.23" ,  通义千问, 增加流式输出yield, 删除2.8.22新增的异步流式输出（BUG）
10. version="2.8.23.1" ,  通义千问, 输出优化
11. version="2.8.24",  通义千问, 输出优化; OPENAI LLM通用类库(copy from LLM_通义千问)
12. version="2.8.25", 优化LLM父类: 增加 "清除所有上下文","删除上条对话"
datadiode-RobustSoliton 1.0.0
Reliable one-way file transfer using Robust Soliton fountain codes
Requires Python: >=3.6

# Robust Soliton Data Diode 

A data diode implementation using robust soliton fountain codes for reliable one-way data transmission.
Specialized network capture cards allow for lossless packet capture (see receiver --napatech). 

When using specialized capture cards (see --napatech) tapped into a media-converter, 
there is perfect UDP reception (no packet loss). For example NAPATECH NT4E-4T 4-Port 
PCIe x8 Gbit Capture Network Adapter 801-0075-09-02 connected to TP-Link MC200CM 
(850 nm light) or MC210CS (1310 nm light). If using beam splitters for TX->RX link, 
the 1310 nm fiber-optic is easy and cheaper to find.

## Installation

### From PyPI (recommended)

```
pip install datadiode-RobustSoliton
```

### From Source

1. Clone the repository:
   ```
   git clone https://github.com/BANPUMP-team/datadiode-RobustSoliton.git
   cd datadiode-RobustSoliton 
   ```

2. Install in development mode:
   ```
   pip install -e .
   ```

## Usage

### Basic operation:

Run the sender:
```
datadiode-RobustSoliton send [options] file_to_send
```

Run the receiver:
```
datadiode-RobustSoliton receive [options] output_file
```

For more details on options, run:
```
datadiode-RobustSoliton --help
datadiode-RobustSoliton send --help
datadiode-RobustSoliton receive --help
```
katapult-api 1.2.1a0
Async Python client for interacting with the KatapultPro API.
Requires Python: >=3.12

# KatapultAPI

katapultAPI is a Python module designed to handle requests made to the Katapult API.


## Installation & Setup

```bash
pip install katapult-api
```

## Usage

### Getting a Job list and Job Details

```python
import logging.config
import asyncio

# Not required but the client itself has logging functionality to help track requests.
logger = logging.getLogger(__name__)
logging.basicConfig(
        level=logging.DEBUG,
        format='[%(levelname)s] %(asctime)s - %(name)s - %(message)s'
    )

from katapult_api.katapult import Katapult
from katapult_api.utils import task_handler

async def main():

    # Sets up the aiohttp session and closes it after finishing.
    async with Katapult(api_key="YOURAPIKEY") as katapult:

        # Returns a Response object that contains attributes such as return status, content, and even a json() method.
        job_lists = await katapult.job_lists()

        # Here we build 20 payloads that will be sent out at the same time.
        job_ids = [{"job_id":key} for key in list(job_lists.json().keys())[:20]]

        # Not required but makes setting up async tasks easy, pass in a job name and a list of dicts that contain
        # expected params.
        results = await task_handler(katapult.job,job_ids)
    return results

if __name__ == '__main__':
    logger.info(f"Getting jobs...")
    jobs = asyncio.run(main())
    logger.info(f"Finished, got {len(jobs)} jobs.")
```

### Creating a Node
```python
import asyncio

# ...possible logging

from katapult_api.katapult import Katapult

async def main():

    async with Katapult(api_key="YOURAPIKEY") as katapult:

        # get job id from job_lists endpoint...
        job_id = "-ABC123"

        # create a node by passing job id, lat/long, and a flat dict of attributes to write to the node
        results = await katapult.create_node(job_id,30.0817,-97.843,{"OID":123,"my_custom_attr":"howdy partner"})

    return results

if __name__ == '__main__':
    results = asyncio.run(main())
```

### KatapultNice Usage
```python
import logging.config
import asyncio

logging.basicConfig(
    level=logging.DEBUG,
    format="%(asctime)s - %(name)s - %(levelname)s - %(message)s",
)

logger = logging.getLogger(__name__)

from katapult_api.katapult import Katapult
from katapult_api.katapult_nice import KatapultNice
from katapult_api.utils import task_handler

async def main(api_key: str):
    async with KatapultNice(api_key=api_key) as nice:
        job_lists = await nice.job_lists()
        job_ids = [{"job_id": key} for key in list(job_lists.json().keys())[:20]]
        results = await task_handler(nice.job_nodes, job_ids)
    return results


if __name__ == '__main__':
    api_key = "api_key"
    logger.info(f"Getting jobs...")
    jobs = asyncio.run(main(api_key))
    logger.info(f"Finished, got {len(jobs)} jobs.")

```

## Resources
- https://documenter.getpostman.com/view/9081167/SVtVV93W: Katapultpro API V1
- https://github.com/KatapultDevelopment/katapult-pro-api-documentation?tab=readme-ov-file: Katapultpro Github
betacode-parser 1.0.1
A fully implemented Beta Code parser.
Requires Python: >=3.8

# betacode-parser
### Introduction
betacode-parser is a Python package that allows one to convert to and from Beta Code for Greek, Coptic, and Hebrew. It is implemented according to the standard of *Thesaurus Linguae Graecae* (TLG) as seen in [this manual](https://stephanus.tlg.uci.edu/encoding/BCM.pdf). In addition, the Hebrew conversion also supports the older CCAT (Center for Computer Analysis of Text, University of Pennsylvania) standard as seen on [this webpage](https://ccat.sas.upenn.edu/beta/key.html). This project is inspired by the PyPI package [`betacode`](https://pypi.org/project/betacode/), which only implemented conversion for Greek.
### Installation
To install, run `pip install betacode-parser`. Import in projects like this:
```python
from betacode_parser import *
```
Alternatively, you can import the following functions separately: `beta_to_coptic`, `coptic_to_beta`, `beta_to_greek`, `greek_to_beta`, `beta_to_hebrew`, and `hebrew_to_beta`.
### Usage
```python
# Greek
print(beta_to_greek("*A)RIS1TOTE/LHS")) # Ἀριστοτέλης
print(greek_to_beta("Ἀριστοτέλης")) # *A)RIS1TOTE/LHS2

# Coptic
print(beta_to_coptic("*PTOLEMAIOS")) # Ⲡⲧⲟⲗⲉⲙⲁⲓⲟⲥ
print(coptic_to_beta("Ⲡⲧⲟⲗⲉⲙⲁⲓⲟⲥ")) # *PTOLEMAIOS

# Hebrew
# Modern (TLG) Standard
print(beta_to_hebrew("ysrAl")) # ישראל
print(hebrew_to_beta("ישראל")) # ysrAl
# Old (CCAT) Standard
print(beta_to_hebrew("Y&R)L", True)) # ישׂראל
print(hebrew_to_beta("ישראל", True)) # Y#R)L
```
You can see how to transcribe to and from Beta Code manually in the TLG manual and CCAT webpage.
### Development
Contributions are welcome.
translatedoc 1.6.0
PDFなどのドキュメントを翻訳するツール。
Requires Python: <4.0,>=3.10

# translatedoc

[![Code style: black](https://img.shields.io/badge/code%20style-black-000000.svg)](https://github.com/psf/black)
[![Lint&Test](https://github.com/ak110/translatedoc/actions/workflows/python-app.yml/badge.svg)](https://github.com/ak110/translatedoc/actions/workflows/python-app.yml)
[![PyPI version](https://badge.fury.io/py/translatedoc.svg)](https://badge.fury.io/py/translatedoc)

PDFなどのドキュメントを翻訳するツール。

[Unstructured](https://unstructured.io/)で読み込み、OpenAI APIに渡しているだけ。

## インストール

### 1. Unstructured

インストール例:

```bash
sudo apt install poppler-utils poppler-data tesseract-ocr tesseract-ocr-jpn
pip install unstructured[all-docs] --extra-index-url https://download.pytorch.org/whl/cu118
python -m nltk.downloader --exit-on-error punkt_tab averaged_perceptron_tagger_eng
```

`cu118`のところは環境に合わせて変更する。

詳細は[Unstructuredのドキュメント](https://unstructured-io.github.io/unstructured/installing.html)を参照。

### 2. translatedoc

```bash
pip install translatedoc
```

## 使い方

### 基本

```bash
export OPENAI_API_KEY=<your_api_key>
translatedoc --language=Japanese <input_files_and_or_urls>
```

カレントディレクトリに`ファイル名.Source.txt`と`ファイル名.Japanese.txt`が生成される。

詳細は `translatedoc --help` を参照。

### 応用その1

テキストの抽出と翻訳を別々に行うこともできる。

```bash
translatedoc-step1 <input_files_and_or_urls>
translatedoc-step2 --language=Japanese <input_text_files>
```

### 応用その2

Pythonライブラリとしても使用可能。

```python
import os
import translatedoc

result_text: str = translatedoc.extract_text("path_or_url.pdf")

model = "gpt-3.5-turbo-1106"
openai_client = openai.OpenAI(base_url=os.environ.get("OPENAI_API_BASE"))

chunks: list[str] = translatedoc.partition(result_text, model)

translated = "\n\n".join(
    translatedoc.translate(chunk, model, "Japanese", openai_client) for chunk in chunks
)
```

## 環境変数

| 環境変数名                     | 概要                                         | デフォルト値                |
|--------------------------------|----------------------------------------------|-----------------------------|
| `OPENAI_API_BASE`              | OpenAI APIのベースURL                        | `https://api.openai.com/v1` |
| `OPENAI_API_KEY`               | OpenAI APIのキー                             | -                           |
| `TRANSLATEDOC_MODEL`           | 翻訳に使用するモデル                         | `gpt-4o-mini`               |
| `TRANSLATEDOC_STRATEGY`        | ドキュメントのパーティション化に使用する戦略 | `hi_res`                    |
contextbase-py 1.0.0
Python SDK for interacting with the ContextBase memory API.
Requires Python: >=3.7

# ContextBase Python SDK

A Python SDK for interacting with the ContextBase MCP API, simple key-value memory storage service with authentication and search capabilities.

## Installation

```bash
pip install contextbase-py
```

## Usage

### Initialization

```python
from contextbase import Context

ctx = Context(base_url='https://contextbase.onrender.com')
```

### Authentication

```python
signup_token = ctx.signup('user@example.com', 'password')

login_token = ctx.login('user@example.com', 'password')

ctx.set_token('your-auth-token')
```

### Memory Operations

```python
ctx.set('myKey', 'myValue')

ctx.set('temporaryKey', 'temporaryValue', 3600)  # 1 hour TTL
ctx.set('temporaryKey', 'temporaryValue')  # Without TTL

memory = ctx.get('myKey')

all_memories = ctx.list()

search_results = ctx.search('queryString')

ctx.delete('myKey')
```

## API Reference

### Constructor

```python
Context(
    base_url: str,
    token: str = None  # Optional initially, required for memory operations
)
```

### Methods

| Method | Parameters | Return Type | Description |
|--------|------------|-------------|-------------|
| `set_token` | `token: str` | `None` | Sets the authentication token |
| `signup` | `email: str, password: str` | `str` | Creates a new user account and returns a token |
| `login` | `email: str, password: str` | `str` | Authenticates user and returns a token |
| `set` | `key: str, value: str, ttl: int = None` | `dict` | Stores a memory with optional TTL (in seconds) |
| `get` | `key: str` | `dict` | Retrieves a memory by key |
| `list` | None | `list` | Lists all memories |
| `search` | `query: str` | `list` | Searches memories by query string |
| `delete` | `key: str` | `dict` | Deletes a memory by key |


## License

MIT
hack4u-courses-library 0.1.5
Libreria de prueba - Consultar los cursos de un modulo

# Hack4U Academy Courses Library

Una biblioteca Python para consultar cursos de la academia Hack4U.

## Cursos disponibles

- **Introducion a Linux** [15 horas]
- **Personalizacion de Linux** [3 horas]
- **Introducion al Hacking** [53 horas]
- **Python Ofensivo** [35 horas]

## Instalación

Instala el paquete usando `pip3`:

```bash
pip3 install hack4u
```

## Uso básico

### Listar todos los Cursos

```python
from hack4u import list_courses

for course in list_courses():
    print(course)
```

### Obtener un curso por nombre

```python
from hack4u import get_course_by_name

course = get_course_by_name("Introducion a Linux")
print(course)
```

### Calcular duración total de los Cursos

```python
from hack4u.utils import total_duration

print(f"Duracion total: {total_duration()} horas")
```
link2proxy 0.1.0
Get proxies for free and automatically without any hassle.
Requires Python: >=3.6



---

# 📡 Link2Proxy 📡

## Introduction

Welcome to **Link2Proxy**, a Python module that allows you to easily fetch and rotate proxies automatically. Whether you're scraping websites or need proxies for testing purposes, **Link2Proxy** helps you get free proxies from multiple sources, store them locally, and use them to make requests.

## 📝 Installation

To install **Link2Proxy**, you can clone this repository or install it via `pip` once the module is uploaded to PyPI.

```bash
pip install link2proxy
```

## 🔧 Usage

### `get_proxies()`

This function allows you to fetch proxies from multiple online sources and store them locally in a file.

#### Example:

```python
import link2proxy

# Fetch proxies from the available sources and save them to a file
link2proxy.get_proxies()
```

- **Description**: 
  - Fetches proxies from various online sources (e.g., spys.me, sslproxies.org, etc.).
  - Proxies are stored in a local file (`link2proxy.txt`).
  - This is useful if you need to periodically refresh your proxy list.

- **Parameters**:
  - No parameters are needed.

- **Returns**:
  - No return value. The proxies are saved in the local file.

---

### `get_proxy()`

This function retrieves a proxy from the local file where they are stored. If the file is empty, it will automatically call `get_proxies()` to populate the list with fresh proxies.

#### Example:

```python
import link2proxy

# Get a proxy and use it for a request
proxy = link2proxy.get_proxy()
print(requests.get('https://google.com', proxies=proxy).status_code)
```

- **Description**:
  - Fetches one proxy from the saved list (stored in `link2proxy.txt`).
  - If the file is empty, it triggers `get_proxies()` to fetch fresh proxies.

- **Parameters**:
  - No parameters are needed.

- **Returns**:
  - A dictionary containing a proxy for both `http` and `https`:
    ```python
    {"http://": "http://<proxy>", "https://": "https://<proxy>"}
    ```

---

## 📄 File Structure

The proxies are stored in a file called `link2proxy.txt` inside a folder called `proxies` in the root directory of your project. This file will contain a list of proxies in the format `ip:port`.

Example of file structure:
```
/project_directory
  /proxies
    link2proxy.txt
```

## ⚠️ Disclaimer

- **Please use this program only for educational purposes.**
- **It is not meant to be used in any malicious way, and I decline any responsibility for what you do with it.**

---

### <p align="center">🔗 Connect with Zarby 🔗</p>