semvec/pypi-packages huggingface dataset:
doguda 0.1.9
Turn Python functions into CLI commands and HTTP endpoints instantly
Requires Python: >=3.10
Keywords: cli, http, fastapi, typer, automation, api, command-line

# Doguda

**Turn Python functions into CLI commands and HTTP endpoints instantly.**

[![PyPI version](https://badge.fury.io/py/doguda.svg)](https://badge.fury.io/py/doguda)
[![Python 3.10+](https://img.shields.io/badge/python-3.10+-blue.svg)](https://www.python.org/downloads/)
[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)

## Installation

```bash
pip install doguda
```

## Quick Start

Create a file (e.g., `my_commands.py`):

```python
from doguda import DogudaApp

app = DogudaApp("MyCommands")

@app.command
def hello(name: str = "World") -> str:
    """Say hello to someone."""
    return f"Hello, {name}!"

@app.command
async def add(a: int, b: int) -> int:
    """Add two numbers."""
    return a + b
```

### CLI Usage

Ensure your module is in the current directory or `DOGUDA_PATH`.

Run commands directly from the command line:

```bash
# Execute a command (automatically discovered)
doguda exec hello --name "Doguda"
# Output: Hello, Doguda!

doguda exec add --a 2 --b 3
# Output: 5
```

### List Available Commands

```bash
doguda list
```

Output:
```
📦 MyCommands
  • hello(name: str)
      Say hello to someone.
  • add(a: int, b: int)
      Add two numbers.
```

### HTTP Server

Start a FastAPI server with your commands as endpoints:

```bash
doguda serve --host 0.0.0.0 --port 8000
```

Then call your functions via HTTP:

```bash
curl -X POST http://localhost:8000/v1/doguda/hello \
  -H "Content-Type: application/json" \
  -d '{"name": "Doguda"}'
```

## Organizing Commands

You can split your commands across multiple files. Valid `DogudaApp` instances with the **same name** will be automatically merged into a single logical app in the CLI.

```python
# users.py
app = DogudaApp("Backend") # Same name

# reports.py
app = DogudaApp("Backend") # Same name
```

When running `doguda list`, these will appear unified under `📦 Backend`.

## Environment Variables

| Variable | Description | Default |
|----------|-------------|---------|
| `DOGUDA_PATH` | Path to search for modules | Current directory |

## Response Models

Use Pydantic models for structured responses:

```python
from pydantic import BaseModel
from doguda import DogudaApp

app = DogudaApp()

class UserResponse(BaseModel):
    id: int
    name: str
    email: str

@app.command
def get_user(user_id: int) -> UserResponse:
    """Get user by ID."""
    return UserResponse(id=user_id, name="John", email="john@example.com")
```

## License

MIT License - see [LICENSE](LICENSE) for details.
vault-retriever 1.0.0
Vault Retriever - Obsidian 知识库智能检索服务
Requires Python: >=3.12
Keywords: knowledge-base, mcp, obsidian, rag, retriever, semantic-search

# Vault Retriever

[![PyPI](https://img.shields.io/pypi/v/vault-retriever)](https://pypi.org/project/vault-retriever/)
[![Python](https://img.shields.io/pypi/pyversions/vault-retriever)](https://pypi.org/project/vault-retriever/)
[![License](https://img.shields.io/github/license/chyax98/vault-retriever)](https://github.com/chyax98/vault-retriever/blob/main/LICENSE)

Obsidian 知识库智能检索服务，为 AI 提供语义搜索和知识图谱分析能力。

## 特性

- **混合检索**：BM25 关键词 + 向量语义 + RRF 融合 + PageRank 加权
- **轻量高效**：mmap 索引加载，内存占用 ~300MB
- **后台索引**：启动不阻塞，增量更新
- **零配置**：开箱即用

## 安装

```bash
uv tool install vault-retriever --python 3.12
```

## 工具列表

| 工具 | 说明 |
|------|------|
| `vault_search` | 智能搜索笔记，融合关键词+语义+PageRank |
| `vault_read` | 读取笔记完整内容 |
| `vault_list` | 列出笔记，支持目录过滤和最近修改筛选 |
| `vault_links` | 获取笔记的反向链接和出链关系 |
| `vault_tags` | 获取标签统计或按标签查找笔记 |
| `vault_related` | 查找语义相似的相关笔记 |

## 使用

### Vault 路径配置

优先级：`--vault` 参数 > `OBSIDIAN_VAULT_PATH` 环境变量 > 当前目录

```bash
# 命令行参数
vault-retriever --vault /path/to/vault

# 环境变量
export OBSIDIAN_VAULT_PATH=/path/to/vault
vault-retriever
```

### Claude Code 配置

**命令行添加：**

```bash
claude mcp add vault-retriever \
  -e OBSIDIAN_VAULT_PATH=/path/to/vault \
  -- vault-retriever
```

**项目 `.mcp.json`（放在 vault 目录下）：**

```json
{
  "mcpServers": {
    "vault-retriever": {
      "type": "stdio",
      "command": "vault-retriever",
      "env": {
        "OBSIDIAN_VAULT_PATH": "${PWD}"
      }
    }
  }
}
```

## 索引机制

- 启动时后台初始化（不阻塞主线程）
- BM25 索引使用 mmap 加载，内存高效
- 向量索引使用 LanceDB 持久化
- PageRank 图谱缓存到磁盘
- 每 10 分钟检查文件变动，增量更新

## 配置

在 vault 目录下创建 `.obsidian/vault-retriever.json`：

```json
{
  "embedding_model": "BAAI/bge-small-zh-v1.5",
  "index_interval": 600
}
```

- `embedding_model`: 向量模型（默认 bge-small-zh-v1.5）
- `index_interval`: 索引更新间隔秒数（默认 600）

## 开发

```bash
git clone https://github.com/chyax98/vault-retriever.git
cd vault-retriever
uv sync
uv run vault-retriever --vault /path/to/vault
```

## License

MIT