semvec/pypi-packages huggingface dataset:
directory-sso-api-client 7.6.1
Python API client for Export Directory.
License: MIT

# directory-sso-api-client

[![code-climate-image]][code-climate]
[![circle-ci-image]][circle-ci]
[![codecov-image]][codecov]
[![pypi-image]][pypi]
[![semver-image]][semver]

**[Directory SSO API client](https://great.gov.uk/)**

---

## Installation

```sh
    $ pip install directory-sso-api-client
```

The api client expects the following settings:

| Setting                                  | Notes                                                       |
| ---------------------------------------- | ----------------------------------------------------------- |
| DIRECTORY_SSO_API_CLIENT_BASE_URL        |                                                             |
| DIRECTORY_SSO_API_CLIENT_API_KEY         | Unique to client. Retrieved during the on-boarding process. |
| DIRECTORY_SSO_API_CLIENT_SENDER_ID       | Unique to client. Retrieved during the on-boarding process. |
| DIRECTORY_SSO_API_CLIENT_DEFAULT_TIMEOUT |                                                             |

Once that is done the API client can be used:

```py
from directory_sso_api_client.client import sso_api_client
```

## Authentication backend

Add the following to your settings

```
AUTHENTICATION_BACKENDS = ['directory_sso_api_client.backends.SSOUserBackend']

AUTH_USER_MODEL='directory_sso_api_client.SSOUser',

MIDDLEWARE_CLASSES = [
    ...
    'django.contrib.sessions.middleware.SessionMiddleware',
    'django.contrib.auth.middleware.AuthenticationMiddleware',
    ...
```

That will result in the user being authenticate via their sso session cookie and then attached to `request.user`.

## Development

```shell
$ git clone https://github.com/uktrade/directory-sso-api-client
$ cd directory-sso-api-client
$ [create virtual environment and activate]
$ pip install -r requirements_test.txt
```

## Publish to PyPI

The package should be published to PyPI on merge to master. If you need to do it locally then get the credentials from rattic and add the environment variables to your host machine:

| Setting                     |
| --------------------------- |
| DIRECTORY_PYPI_USERNAME     |
| DIRECTORY_PYPI_PASSWORD     |

Then run the following command:
```sh
    make publish
```


[code-climate-image]: https://codeclimate.com/github/uktrade/directory-sso-api-client/badges/issue_count.svg
[code-climate]: https://codeclimate.com/github/uktrade/directory-sso-api-client

[circle-ci-image]: https://circleci.com/gh/uktrade/directory-sso-api-client/tree/master.svg?style=svg
[circle-ci]: https://circleci.com/gh/uktrade/directory-sso-api-client/tree/master

[codecov-image]: https://codecov.io/gh/uktrade/directory-sso-api-client/branch/master/graph/badge.svg
[codecov]: https://codecov.io/gh/uktrade/directory-sso-api-client

[pypi-image]: https://badge.fury.io/py/directory-sso-api-client.svg
[pypi]: https://badge.fury.io/py/directory-sso-api-client

[semver-image]: https://img.shields.io/badge/Versioning%20strategy-SemVer-5FBB1C.svg
[semver]: https://semver.org
aliyun-doc-monitor 0.1.3
文档监控助手 - 自动追踪文档更新并生成AI摘要的MCP服务器
License: MIT
Requires Python: >=3.10
Keywords: aliyun, documentation, monitor, mcp, ai

# 阿里云文档监控助手

自动监控阿里云官网文档更新，并使用AI生成变更摘要通知。

## 功能特性

- 🕷️ **自动爬取**: 定期爬取阿里云官网公开文档
- 🔍 **变更检测**: 智能识别文档的新增、修改和删除
- 🤖 **AI摘要**: 使用大模型生成简洁的中文变更摘要
- 📢 **多渠道通知**: 支持Webhook、文件输出等通知方式
- 💾 **历史记录**: 完整的文档版本历史和变更记录
- 🔧 **MCP集成**: 可作为MCP服务器运行，提供工具接口

## 快速开始

### 安装依赖

```bash
pip install -r requirements.txt
```

### 配置

1. 复制配置模板：
```bash
cp config.yaml.example config.yaml
```

2. 编辑 `config.yaml`，配置必要参数：
   - 大模型API密钥
   - 通知渠道（Webhook URL等）
   - 爬虫参数

3. 设置环境变量：
```bash
export HUGGINGFACE_API_KEY="your_api_key"
export WEBHOOK_URL="your_webhook_url"
```

### 初始化数据库

```bash
python -m src.init_db
```

### 运行

```bash
# 启动监控服务（定时任务）
python -m src.main

# 手动触发一次检查
python -m src.main --check-now
```

## 项目结构

```
aliyun-doc-monitor/
├── src/                    # 源代码
│   ├── main.py            # 主入口
│   ├── crawler.py         # 爬虫模块
│   ├── detector.py        # 变更检测
│   ├── summarizer.py      # AI摘要
│   ├── notifier.py        # 通知发送
│   ├── storage.py         # 数据存储
│   ├── scheduler.py       # 任务调度
│   ├── mcp_server.py      # MCP服务器
│   ├── config.py          # 配置管理
│   ├── models.py          # 数据模型
│   └── utils.py           # 工具函数
├── tests/                 # 测试文件
├── data/                  # 数据库文件
├── logs/                  # 日志文件
├── notifications/         # 通知输出
├── config.yaml            # 配置文件
└── requirements.txt       # 依赖列表
```

## 配置说明

详见 `config.yaml` 文件中的注释。

主要配置项：
- `crawler`: 爬虫参数（请求延迟、重试次数等）
- `scheduler`: 调度参数（执行频率、时区等）
- `llm`: 大模型配置（提供商、模型、API密钥等）
- `notifications`: 通知渠道配置
- `storage`: 数据存储配置

## MCP集成

作为MCP服务器运行：

```bash
python -m src.mcp_server
```

在 Kiro 的 `mcp.json` 中配置：

```json
{
  "mcpServers": {
    "aliyun-doc-monitor": {
      "command": "python",
      "args": ["-m", "src.mcp_server"],
      "env": {
        "HUGGINGFACE_API_KEY": "your_key"
      }
    }
  }
}
```

可用工具：
- `trigger_check`: 手动触发文档检查
- `get_recent_changes`: 获取最近的文档变更
- `get_scan_history`: 获取扫描历史记录
- `configure_monitor`: 配置监控参数
- `get_statistics`: 获取统计信息

## 开发

### 运行测试

```bash
# 运行所有测试
pytest

# 运行特定测试
pytest tests/test_crawler.py

# 运行Property-Based Tests
pytest tests/test_properties.py

# 生成覆盖率报告
pytest --cov=src --cov-report=html
```

### 代码格式化

```bash
black src/ tests/
```

### 类型检查

```bash
mypy src/
```

## 许可证

MIT License

## 贡献

欢迎提交Issue和Pull Request！
langskills 0.1.1
Python SDK for Skills — 轻松集成到 LangChain 的 skills 功能，支持渐进式披露
License: MIT
Requires Python: >=3.11
Keywords: langchain, skills, agent, llm, progressive-disclosure

# LangSkills

Python SDK for Skills — LangChain 渐进式披露（Progressive Disclosure）工具，按需加载 skill 内容，节省 Token。

## 特性

- **渐进式披露**：启动时仅加载 skill 元信息（name + description），完整内容按需加载
- **节省 Token**：避免一次性注入所有 skill 文档
- **LangChain 原生集成**：开箱即用的 `load_skill` Tool
- **标准格式**：兼容 [Agent Skills](https://agentskills.io/) / Cursor SKILL.md 规范

## 安装
```bash
pip install langskills
```

## 快速开始

### 1. 准备 Skills 目录
```
skills/
├── pdf_parser/
│   └── SKILL.md
└── weather_query/
    └── SKILL.md
```

**SKILL.md 示例**（YAML frontmatter + Markdown）：
```markdown
---
name: Weather Query
description: Get current weather information for any city
version: 1.0
---

Use this skill to fetch real-time weather data.
Call the weather API with city name as parameter.
```

### 2. 集成到 LangChain
```python
import uuid
from langchain.chat_models import init_chat_model
from langskills import SkillsLoader
from langchain.agents import create_agent

# 加载 skills
loader = SkillsLoader.from_directory("./skills")
tools = loader.to_langchain_tools()  # 生成 load_skill tool

# 初始化模型
llm = init_chat_model(
    base_url="https://api.example.com/v1",
    api_key="your-api-key",
    model="Qwen/Qwen3-32B",
    model_provider="openai",
)

# 创建 agent
agent = create_agent(llm, tools=tools)

# 调用
response = agent.invoke(
    {"messages": [{"role": "user", "content": "今天天气如何"}]},
    {"configurable": {"thread_id": str(uuid.uuid4())}},
)

print(response["messages"])
```

### 工作流程

1. Agent 启动时看到 `load_skill` tool（列出所有 skill 名称和描述）
2. 用户提问后，agent 判断需要哪个 skill
3. 调用 `load_skill(skill_name="Weather Query")` 加载完整内容
4. 根据内容执行任务

## API
```python
from langskills import SkillsLoader

loader = SkillsLoader.from_directory("./skills")

# 列出所有 skill 名称
loader.list_skill_names()

# 获取简要信息（仅元数据）
loader.get_skill_summaries()

# 按需加载完整内容
loader.load_skill_content("Weather Query")

# 转为 LangChain tools
tools = loader.to_langchain_tools()
```

## 开发
```bash
# 安装依赖
uv sync

# 运行测试
pytest
```

## 发布
```bash
uv build
twine upload dist/*
```

## License

MIT