semvec/pypi-packages huggingface dataset:
tsst 0.8.7
TSST is an integration platform for Taiwan brokerage Python APIs, enabling quick switching between different brokerage APIs using a unified trading logic.
Requires Python: >=3.9

# TSST Module

TSST 模組 是一款基於 Python 的金融交易工具，專為需要高效執行交易與策略開發的用戶設計。該套件解決了多券商 API 整合的痛點，提供統一的介面支持股票、期貨等資產的交易操作與數據處理，無需重複學習各家券商的 API 使用方法。

1. 多券商無縫切換
通過統一的介面支持多家券商的即時行情與下單功能，無論是永豐還是群益，均可輕鬆整合並切換，降低多 API 接入的學習成本。

2. 回測與實戰輕鬆切換
提供真實交易高度相符的回測模組，幫助快速驗證交易策略，並實現回測到實戰的無縫過渡，讓策略開發更高效。

3. Python 開發，簡單易用
使用業界廣泛採用的 Python 作為開發語言，結合清晰的 API 設計，降低入門門檻，助力初學者和資深交易者快速上手。

## 環境要求
* Python >= 3.9
* 建議使用 Windows OS，MAC/Linux 目前尚無法確認支援程度
* 建議使用 uv 做為開發環境管理，有提供 pyproject.toml 可快速安裝所需 Python 套件

## 前置作業
1. 必須開立對應券商的證券戶及 API 下單功能，詳細情洽各券商相關部門。

## 目前支援券商及功能一覽


| 主功能/券商    | 永豐 | 群益<br/>(即將推出) |
| :------------: |:----:|:-------------------:|
| 證券即時行情 |  O   |          O          |
| 期貨即時行情 |  O   |          O          |
| 證券下單 |  O   |          O          |
| 期貨下單 |  O   |          O          |
| 回測 |  O   |          (待開發)          |

回測模組需另外下載「TSST - 回測模組」才能使用。

## 安裝說明

```uv add tsst``` 或 ```pip install tsst```

## 使用範例
#### 初始化
```python
from tsst.main import Tsst

class MyTsst(Tsst):
    def __init__(self, **kwargs):
        super().__init__(**kwargs)
    
    def on_stock_tick(self, sender: str, response: Any, **kwarg):
        # 接收股票 Tick, 在這裡撰寫你的策略
        pass
    
    def on_future_tick(self, sender: str, response: ANy, **kwarg):
        # 接收期貨 Tick, 在這裡撰寫你的策略
        pass
    
    def on_order(self, sender, response, **kwargs):
        # 接收委託回報
        pass
    
    def on_deal(self, sender, response, **kwargs):
        # 接收成交回報
        pass

# 初始化
tsst = MyTsst(
    is_simulation=True,
    use_broker="Sino", #使用永豐 API, 群益為 Capital
    is_backtest=False
)
```

登入(永豐)
```python
tsst.login({
    "tsst_token": "TSST Token",
    "api_key": "你的永豐API KEY",
    "secret_key": "你的永豐API SECRET KEY",
    "ca_path": "永豐憑證存放路徑",
    "ca_password": "永豐憑證密碼",
})

# 訂閱永豐台指期近月、台積電即時行情報價
tsst.subscribe({
    "codes": [
        { "code": "TXFR1", "market": "Future" },
        { "code": "2330", "market": "Stock" }
    ]
})
```

登入(群益)
```python
tsst.login({
    "tsst_token": "TSST Token",
    "account": "你的群益帳號",
    "password": "你的群益密碼",
})

# 訂閱群益台指期近月、台積電即時行情報價
tsst.subscribe({
    "codes": [
        { "code": "TX00", "market": "Future" },
        { "code": "2330", "market": "Stock" }
    ]
})
```

下單
```python
tsst.create_order(
    code = "2330",
    product_type = "Stock",
    params = {
        "price": 990,
        "quantity": 2,
        "action": "Buy",
        "price_type": "LMT",
        "order_type": "ROD",
        "order_cond": "Cash",
        "order_lot": "Common"
    }
)
```

## 其它
[開發文件](https://tsst.fhfgft.com)
[永豐回測模組](https://tsst.fhfgft.com)
[聯絡我們](https://tsst.aiaristos.com/)

## 免責聲明
本套件提供統一的介面，用於快速切換不同券商 API 進行下單操作，並支持回測功能以驗證交易策略。需特別注意，所有數據來源及交易執行均由對應的券商 API 提供與處理。由於交易量巨大，券商提供的數據可能存在遺漏或錯誤，因此，本套件對因數據問題或交易執行偏差而導致的財產損失概不負責。請使用者自行評估並承擔相關風險。
pixtreme-upscale 0.8.6
Multi-backend deep learning upscalers for pixtreme
Requires Python: >=3.12

# pixtreme-upscale

Multi-backend deep learning upscalers for pixtreme

## Overview

`pixtreme-upscale` provides GPU-accelerated deep learning super-resolution with support for ONNX, PyTorch, and TensorRT backends. Integrates with Spandrel for automatic model architecture detection.

## Features

- **Multi-Backend Support**: ONNX Runtime, PyTorch, TensorRT
- **Automatic Tiling**: Handle large images with automatic tiling workflow
- **Model Conversion**: PyTorch → ONNX → TensorRT pipeline
- **Spandrel Integration**: Automatic architecture detection for 100+ models
- **Zero-Copy**: Direct GPU memory operations

## Installation

**Requirements**:
- Python >= 3.12
- CUDA Toolkit 12.x
- NVIDIA GPU with compute capability >= 6.0

```bash
# Base installation (ONNX + PyTorch)
pip install pixtreme-upscale

# With TensorRT support
pip install pixtreme-upscale[tensorrt]
```

Requires `pixtreme-core`, PyTorch, ONNX Runtime, and CUDA Toolkit 12.x.

## Quick Start

```python
import pixtreme_upscale as pu
import pixtreme_core as px

# Read image
img = px.imread("input.jpg")

# ONNX backend (fastest compatibility)
upscaler = pu.OnnxUpscaler("model.onnx")
upscaled = upscaler.get(img)

# PyTorch backend (most flexible)
upscaler = pu.TorchUpscaler("model.pth")
upscaled = upscaler.get(img)

# TensorRT backend (fastest performance)
upscaler = pu.TrtUpscaler("model.onnx")  # Auto-converts to TRT
upscaled = upscaler.get(img)

# Save result
px.imwrite("output.jpg", upscaled)
```

## Automatic Tiling

All upscalers automatically handle large images via tiling:

```python
# Automatically tiles large images
large_img = px.imread("8k_image.jpg")
upscaled = upscaler.get(large_img)  # Handles tiling internally
```

## Model Conversion

```python
from pixtreme_upscale.utils.model_convert import torch_to_onnx, onnx_to_trt

# PyTorch → ONNX
torch_to_onnx("model.pth", "model.onnx", input_shape=(1, 3, 1080, 1920))

# ONNX → TensorRT
onnx_to_trt("model.onnx", "model.trt", precision="fp16")
```

## Supported Models

Works with Spandrel-supported architectures:
- ESRGAN, Real-ESRGAN, RealESRGAN+
- SwinIR, HAT, OmniSR
- And 100+ more architectures

## License

MIT License - see LICENSE file for details.

## Links

- Repository: https://github.com/sync-dev-org/pixtreme
pixtreme-legacy 0.8.6
Legacy compatibility functions for pixtreme (_cp functions)
Requires Python: >=3.12

# pixtreme-legacy

**⚠️ Legacy Compatibility Package**: This package provides `_cp` functions removed from pixtreme v0.5.2+.

## Status

- **Maintenance Mode**: Functions migrated from main pixtreme package in v0.5.2
- **Note**: v0.5.1 was broken; use v0.5.2 or later
- **Recommendation**: Migrate to standard functions (without `_cp` suffix) when possible

## Purpose

This package provides backward compatibility for `_cp` functions that were removed from the main `pixtreme` package in v0.5.1. It contains the following functions:

- `apply_lut_cp` - Apply 3D LUT with CuPy implementation
- `uyvy422_to_ycbcr444_cp` - Convert UYVY422 to YCbCr444
- `ndi_uyvy422_to_ycbcr444_cp` - Convert NDI UYVY422 to YCbCr444
- `yuv420p_to_ycbcr444_cp` - Convert YUV420 to YCbCr444
- `yuv422p10le_to_ycbcr444_cp` - Convert YUV422p10le to YCbCr444

## Installation

**Requirements**:
- Python >= 3.12
- CUDA Toolkit 12.x
- NVIDIA GPU with compute capability >= 6.0

```bash
pip install pixtreme-legacy
```

## Usage

```python
from pixtreme_legacy import apply_lut_cp

# No warnings - clean compatibility layer
result = apply_lut_cp(image, lut)
```

**Note**: This package depends on `pixtreme>=0.6.0` for common utilities (`to_float32`, `resize`, etc.).

## Migration Guide

Replace `_cp` functions with their standard equivalents:

### Before (deprecated)
```python
from pixtreme import apply_lut_cp
result = apply_lut_cp(image, lut, interpolation=0)
```

### After (recommended)
```python
from pixtreme import apply_lut
result = apply_lut(image, lut, interpolation=0)
```

## Why were _cp functions deprecated?

The `_cp` suffix originally indicated "CuPy native" implementations, as opposed to CUDA kernel implementations. However:

1. **Redundancy**: Both implementations exist in the main functions now
2. **Confusion**: Users don't need to choose between implementations
3. **Maintenance**: Duplicate APIs increase maintenance burden

The standard functions (without `_cp`) now automatically select the best implementation.

## Timeline

- **v0.4.0**: `_cp` functions available without warnings
- **v0.5.0**: `_cp` functions deprecated with warnings, `pixtreme-legacy` package created
- **v0.5.1**: **BROKEN** - Attempted `_cp` function removal but incomplete (do not use)
- **v0.5.2**: `_cp` functions **fully removed from main package**, migrated to `pixtreme-legacy` without warnings
- **v0.6.0**: Main `pixtreme` package split into modular packages (`pixtreme-core`, `pixtreme-aces`, `pixtreme-filter`, `pixtreme-draw`, `pixtreme-upscale`)

## License

MIT License (same as pixtreme)
pixtreme-draw 0.8.6
GPU-accelerated drawing primitives for pixtreme
Requires Python: >=3.12

# pixtreme-draw

GPU-accelerated drawing primitives for pixtreme

## Overview

`pixtreme-draw` provides high-performance drawing operations for rendering shapes, text, and masks directly on GPU memory.

## Features

- **Shape Drawing**: Circles, rectangles with anti-aliasing
- **Text Rendering**: GPU-accelerated text with custom fonts
- **Mask Generation**: Rounded masks for compositing
- **Zero-Copy**: Direct GPU memory operations via CuPy

## Installation

**Requirements**:
- Python >= 3.12
- CUDA Toolkit 12.x
- NVIDIA GPU with compute capability >= 6.0

```bash
pip install pixtreme-draw
```

Requires `pixtreme-core`, `pixtreme-filter`, and CUDA Toolkit 12.x.

## Quick Start

```python
import pixtreme_draw as pd
import pixtreme_core as px

# Read image
img = px.imread("input.jpg")

# Draw filled circle
img = pd.circle(img, center_x=256, center_y=256, radius=100, color=(0.0, 1.0, 0.0))

# Draw filled rectangle
img = pd.rectangle(img, top_left_x=100, top_left_y=100, bottom_right_x=300, bottom_right_y=300, color=(1.0, 0.0, 0.0))

# Add text label with background
img = pd.add_label(img, text="Hello World", org=(50, 50), color=(1.0, 1.0, 1.0))

# Save result
px.imwrite("output.jpg", img)
```

## API

### Shape Drawing

```python
# Circle (filled)
pd.circle(image, center_x, center_y, radius, color=(1.0, 1.0, 1.0))

# Rectangle (filled)
pd.rectangle(image, top_left_x, top_left_y, bottom_right_x, bottom_right_y, color=(1.0, 1.0, 1.0))
```

### Text Rendering

```python
# Simple text
pd.put_text(image, text, org, font_face=cv2.FONT_HERSHEY_SIMPLEX, font_scale=1.0, color=(1.0, 1.0, 1.0), thickness=2)

# Text with background label
pd.add_label(image, text, org=(0, 0), font_scale=1.0, color=(1.0, 1.0, 1.0), label_color=(0.0, 0.0, 0.0))
```

### Mask Generation

```python
# Rounded mask for compositing
mask = pd.create_rounded_mask(dsize=(512, 512), radius_ratio=0.1, blur_size=0, sigma=1.0)
```

## License

MIT License - see LICENSE file for details.

## Links

- Repository: https://github.com/sync-dev-org/pixtreme
pixtreme-core 0.8.6
pixtreme-core: High-Performance GPU Image Processing Core Library
Requires Python: >=3.12

# pixtreme-core

High-Performance GPU Image Processing Core Library

## Overview

`pixtreme-core` provides the fundamental building blocks for GPU-accelerated image processing:

- **I/O**: Hardware-accelerated image reading/writing via NVIDIA nvimgcodec
- **Color**: Color space conversions (BGR, RGB, HSV, YCbCr, LUT operations)
- **Transform**: Geometric transformations (resize, affine, tiling) with 11 interpolation methods
- **Utils**: Framework interoperability (NumPy, CuPy, PyTorch) via DLPack

All operations work directly on GPU memory using CuPy arrays for maximum performance.

## Installation

**Requirements**:
- Python >= 3.12
- CUDA Toolkit 12.x
- NVIDIA GPU with compute capability >= 6.0

```bash
pip install pixtreme-core
```

### OpenCV Variants

`pixtreme-core` uses `opencv-python` by default. For different environments:

- **Headless environments** (no GUI): Replace with `opencv-python-headless`
  ```bash
  pip uninstall opencv-python
  pip install opencv-python-headless
  ```

- **Contrib modules needed**: Replace with `opencv-contrib-python`
  ```bash
  pip uninstall opencv-python
  pip install opencv-contrib-python
  ```

All variants provide the same `cv2` module and are compatible with pixtreme.

## Quick Start

```python
import pixtreme_core as px

# Read image (returns CuPy array on GPU)
img = px.imread("input.jpg")

# Resize with auto-selected interpolation
img = px.resize(img, (512, 512))

# Convert color space
img = px.bgr_to_rgb(img)

# Write image
px.imwrite("output.jpg", img)
```

## Features

### Image I/O
- `imread()`: Hardware-accelerated JPEG/PNG decoding
- `imwrite()`: Efficient image encoding
- `imshow()`: Display with matplotlib

### Color Conversions
- BGR ↔ RGB, HSV, YCbCr, Grayscale
- 3D LUT operations with trilinear/tetrahedral interpolation
- Video format support (UYVY422, YUV420p, YUV422p10le)
- Legal/full range YCbCr conversion

### Geometric Transforms
- `resize()`: 11 interpolation methods including Lanczos, Mitchell, Catmull-Rom
- `affine()`: Affine transformations
- `tile_image()`, `merge_tiles()`: Tiling workflow for large images
- `erode()`: Morphological erosion

### Framework Interoperability
- `to_cupy()`, `to_numpy()`, `to_tensor()`: Zero-copy conversions via DLPack
- `to_uint8()`, `to_uint16()`, `to_float32()`: Type conversions with range scaling

## License

MIT License - see LICENSE file for details.

## Links

- Repository: https://github.com/sync-dev-org/pixtreme
- Documentation: https://github.com/sync-dev-org/pixtreme/blob/main/README.md
pixtreme-aces 0.8.6
ACES color management for pixtreme (OCIO ACES 1.2 compliant)
Requires Python: >=3.12

# pixtreme-aces

ACES Color Management for pixtreme (OCIO ACES 1.2 Compliant)

## Overview

`pixtreme-aces` provides professional ACES color management functionality for VFX and color grading workflows. It implements the Academy Color Encoding System (ACES) 1.2 standard with full GPU acceleration.

## Features

- **ACES 1.2 Compliance**: Matrix values match OpenColorIO-Config-ACES standard
- **Industry Standard Workflow**: Compatible with Nuke, Houdini, Maya color pipelines
- **GPU Accelerated**: All operations run on CUDA-enabled GPUs via CuPy
- **Type Preservation**: Seamlessly works with both NumPy and CuPy arrays

## Installation

**Requirements**:
- Python >= 3.12
- CUDA Toolkit 12.x
- NVIDIA GPU with compute capability >= 6.0

```bash
pip install pixtreme-aces
```

Requires `pixtreme-core` and CUDA Toolkit 12.x.

## Quick Start

```python
import pixtreme_aces as aces
import pixtreme_core as px

# Read display-referred image (Rec.709/sRGB)
img = px.imread("input.jpg")

# Convert to ACES2065-1 (scene-referred, linear AP0)
aces_img = aces.rec709_to_aces2065_1(img)

# Work in ACES color space
# ... color grading, compositing, etc.

# Convert back to Rec.709 for display
output = aces.aces2065_1_to_rec709(aces_img)

px.imwrite("output.jpg", output)
```

## Color Space Conversions

### ACES Working Spaces

- **ACES2065-1**: Archive format (linear AP0, wide gamut)
- **ACEScg**: CG/VFX working space (linear AP1)
- **ACEScct**: Grading space (log-encoded AP1)

```python
# ACES2065-1 ↔ ACEScg
acescg = aces.aces2065_1_to_acescg(aces_img)
aces_img = aces.acescg_to_aces2065_1(acescg)

# ACES2065-1 ↔ ACEScct
acescct = aces.aces2065_1_to_acescct(aces_img)
aces_img = aces.acescct_to_aces2065_1(acescct)
```

## References

- [ACES Central](https://acescentral.com)
- [ACES Technical Documentation](https://docs.acescentral.com)
- [OpenColorIO-Config-ACES](https://github.com/AcademySoftwareFoundation/OpenColorIO-Config-ACES)
- SMPTE ST 2065-1: ACES2065-1 specification

## License

MIT License - see LICENSE file for details.

ACES® is a trademark of the Academy of Motion Picture Arts and Sciences (A.M.P.A.S.).
This software is not endorsed by A.M.P.A.S.

## Links

- Repository: https://github.com/sync-dev-org/pixtreme
pmnb 0.2.1
'产品经理常用工具箱'
Requires Python: >=3.6

# 产品经理常用工具pmnb（pm牛逼） import pmnb as pm

## jsq （计算器首字母）方法：from pmnb import jsq
 * ipr：提升量计算：输入：jsq.ipr(之前的值，新的值)，输出：提升的绝对值，相对值  
 * ABSample：AB样本量计算  ABSample(),直接执行，根据提示输入就有结果
 * rank_wilson_score:威尔逊置信区间下界，jsq.rank_wilson_score(正样本数，总数)
 * confidence：置信度计算，直接执行，输出置信区间，置信度

## feed（内容相关） 方法：from pmnb import feed
 * xsd：相似度的首字母，计算标题相似度，输入文本1跟文本2，输出他们的相似度
 * count_words:统计excel某个sheet里某一列的词频

## analyse(分析相关) 方法：from pmnb import analyse
 * lr_one_hot()：根据lr模型输出各个特征以及重要程度,字符用one-hot编码
 * lr_factorize():根据lr模型输出各个特征以及重要程度,字符用序号编码
 * Tree_one_hot()：根据决策树模型输出各个特征以及重要程度,字符用one-hot编码
 * Tree_factorize():根据决策树模型输出各个特征以及重要程度,字符用序号编码
 * xgb_one_hot()：根据xgb模型输出各个特征以及重要程度,字符用one-hot编码
 * xgb_factorize():根据xgb模型输出各个特征以及重要程度,字符用序号编码


## growth（增长相关） 方法：from pmnb import growth
 * DAU:DAU预估，输入次日，7日，15日留存，日新增，天数，返回留存曲线跟第X天的DAU