semvec/pypi-packages huggingface dataset:
phantombrowser 0.0.4
Typed Python wrapper for Phantomjs Cloud API
License: MIT

[![ruff](https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/charliermarsh/ruff/main/assets/badge/v2.json)](https://github.com/astral-sh/ruff) 
[![status workflow test](https://github.com/guangrei/PhantomBrowser/actions/workflows/python-app.yml/badge.svg)](https://github.com/guangrei/PhantomBrowser/actions) 
[![status workflow build](https://github.com/guangrei/PhantomBrowser/actions/workflows/release_to_pypi.yml/badge.svg)](https://github.com/guangrei/PhantomBrowser/actions)

[![Downloads](https://static.pepy.tech/badge/phantombrowser)](https://pepy.tech/project/phantombrowser)
[![Downloads](https://static.pepy.tech/badge/phantombrowser/month)](https://pepy.tech/project/phantombrowser)
[![Downloads](https://static.pepy.tech/badge/phantombrowser/week)](https://pepy.tech/project/phantombrowser)

PhantomBrowser is typed Python wrapper for [phantomjscloud.com](https://phantomjscloud.com) api with optimize magic rendering and support asynchronous.

## Installation

```
pip install phantombrowser
```

## Example

render html:

```python
from PhantomBrowser import Browser


browser = Browser()
response = browser.get("https://example.com")
print(response.text)
browser.close()
```

render plain text:
```python
from PhantomBrowser import Browser


browser = Browser()
response = browser.get("https://example.com", render="plainText")
print(response.text)
browser.close()
```

render image:
```python
from PhantomBrowser import Browser


browser = Browser()
response = browser.get("https://example.com", render="png")
browser.saveAs("example.png", response.content)
browser.close()
```

render PDF:
```python
from PhantomBrowser import Browser


browser = Browser()
response = browser.get("https://example.com", render="pdf")
browser.saveAs("example.pdf", response.content)
browser.close()
```

the other method like `browser.post()`, `browser.put()`, `browser.patch()`, `browser.option()` and `browser.delete()` also supported.

You can also use the API key by setting the environment variable `PHANTOMJSCLOUD.COM_APIKEY` or directly in the class
```python
from PhantomBrowser import Browser


browser = Browser("Your API Key")
```

## Asynchronous Example

```python
from PhantomBrowser import AsyncBrowser
import asyncio


async def main():
    browser = AsyncBrowser()
    response = await browser.get("https://example.com")
    print(await response.text())
    await browser.close()

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

## License

MIT
wechat-copilot 0.0.1
自动解析微信窗口的聊天内容,结合AI大模型，生成回复建议。
License: MIT
Requires Python: >=3.8

# wechat-copilot

自动解析微信窗口的聊天内容,结合 AI 大模型，生成回复建议。

![演示](docs/demo.gif)

## 快速安装

```bash
pip install wechat-copilot
```

## 配置

1. 创建配置文件:

```bash
mkdir -p ~/.wechat-copilot
touch ~/.wechat-copilot/config.env
```

2. 编辑配置文件 `~/.wechat-copilot/config.env`:

```bash
# 必填：OpenAI API密钥
OPENAI_API_KEY=your_key_here

# 可选：OpenAI API地址（默认为 https://api.openai.com/v1）
OPENAI_BASE_URL=https://api.openai.com/v1

# 可选：快捷键设置（默认为 cmd+shift+space）
SHORTCUT=cmd+shift+space
```

## 使用方法

1. 运行助手:

```bash
wechat-copilot
```

2. 打开微信聊天窗口
3. 快捷键：`cmd+shift+space` 触发
4. GPT 会根据聊天内容生成回复建议，以系统通知的方式展示，自动复制到剪贴板
5. 粘贴文本到聊天框，自行决定二次编辑

## 开发者指南

如果你想参与开发:

```bash
git clone https://github.com/yourusername/wechat-copilot.git
cd wechat-copilot
pip install -e ".[dev]"
```

## 核心思路

1. 使用 `pyobjc` 获取微信窗口的聊天内容
2. 使用 `openai` 的 API 生成回复建议
3. 使用 `osascript` 生成系统通知
4. 使用 `pyperclip` 自动复制到剪贴板

---

喜欢的话，可以点个 ��star🌟 支持一下。感谢感谢。