repo_full_name stringlengths 6 93 | repo_url stringlengths 25 112 | repo_api_url stringclasses 28
values | owner stringclasses 28
values | repo_name stringclasses 28
values | description stringclasses 28
values | stars int64 617 98.8k | forks int64 31 355 ⌀ | watchers int64 990 999 ⌀ | license stringclasses 2
values | default_branch stringclasses 2
values | repo_created_at timestamp[s]date 2012-07-24 23:12:50 2025-06-16 08:07:28 ⌀ | repo_updated_at timestamp[s]date 2026-02-23 15:23:15 2026-05-03 18:52:12 ⌀ | repo_topics listlengths 0 13 ⌀ | repo_languages unknown | is_fork bool 1
class | open_issues int64 3 104 ⌀ | file_path stringlengths 3 208 | file_name stringclasses 509
values | file_extension stringclasses 1
value | file_size_bytes int64 101 84k ⌀ | file_url stringclasses 627
values | file_raw_url stringclasses 627
values | file_sha stringclasses 624
values | language stringclasses 8
values | parsed_at stringdate 2026-05-04 01:12:36 2026-05-04 19:41:55 | text stringlengths 100 102k |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
stanfordnlp/dspy | https://github.com/stanfordnlp/dspy | null | null | null | null | 34,175 | null | null | mit | null | null | null | null | null | null | null | dspy/dsp/colbertv2.py | null | null | null | null | null | null | Python | 2026-05-04T02:23:49.002957 | from typing import Any
import requests
from dspy.clients.cache import request_cache
from dspy.dsp.utils import dotdict
# TODO: Ideally, this takes the name of the index and looks up its port.
class ColBERTv2:
"""Wrapper for the ColBERTv2 Retrieval."""
def __init__(
self,
url: str = "http:/... |
stanfordnlp/dspy | https://github.com/stanfordnlp/dspy | null | null | null | null | 34,175 | null | null | mit | null | null | null | null | null | null | null | dspy/dsp/utils/__init__.py | null | null | null | null | null | null | Python | 2026-05-04T02:23:49.115068 | from dspy.dsp.utils.dpr import *
from dspy.dsp.utils.settings import *
from dspy.dsp.utils.utils import *
|
stanfordnlp/dspy | https://github.com/stanfordnlp/dspy | null | null | null | null | 34,175 | null | null | mit | null | null | null | null | null | null | null | dspy/dsp/utils/dpr.py | null | null | null | null | null | null | Python | 2026-05-04T02:23:49.259319 | """
Source: DPR Implementation from Facebook Research
https://github.com/facebookresearch/DPR/tree/master/dpr
Original license: https://github.com/facebookresearch/DPR/blob/main/LICENSE
"""
import copy
import logging
import unicodedata
import regex
logger = logging.getLogger(__name__)
class Tokens:
"""A class ... |
stanfordnlp/dspy | https://github.com/stanfordnlp/dspy | null | null | null | null | 34,175 | null | null | mit | null | null | null | null | null | null | null | dspy/dsp/utils/settings.py | null | null | null | null | null | null | Python | 2026-05-04T02:23:49.326124 | import asyncio
import contextvars
import copy
import logging
import threading
from contextlib import contextmanager
from typing import Any
import cloudpickle
from dspy.dsp.utils.utils import dotdict
logger = logging.getLogger(__name__)
DEFAULT_CONFIG = dotdict(
lm=None,
adapter=None,
rm=None,
branch... |
stanfordnlp/dspy | https://github.com/stanfordnlp/dspy | null | null | null | null | 34,175 | null | null | mit | null | null | null | null | null | null | null | dspy/dsp/utils/utils.py | null | null | null | null | null | null | Python | 2026-05-04T02:23:49.521812 | import copy
import datetime
import itertools
import os
from collections import defaultdict
import tqdm
def print_message(*s, condition=True, pad=False, sep=None):
"""Print a timestamped message to stdout.
Args:
*s: Values to print.
condition: If False, don't print (default: True).
... |
stanfordnlp/dspy | https://github.com/stanfordnlp/dspy | null | null | null | null | 34,175 | null | null | mit | null | null | null | null | null | null | null | dspy/clients/utils_finetune.py | null | null | null | null | null | null | Python | 2026-05-04T02:23:51.694669 | import os
from enum import Enum
from typing import TYPE_CHECKING, Any, Literal, TypedDict
import orjson
import dspy
from dspy.utils.caching import DSPY_CACHEDIR
if TYPE_CHECKING:
from dspy.adapters.base import Adapter
class TrainingStatus(str, Enum):
not_started = "not_started"
pending = "pending"
... |
stanfordnlp/dspy | https://github.com/stanfordnlp/dspy | null | null | null | null | 34,175 | null | null | mit | null | null | null | null | null | null | null | dspy/datasets/__init__.py | null | null | null | null | null | null | Python | 2026-05-04T02:23:51.699224 | from dspy.datasets.alfworld import AlfWorld
from dspy.datasets.colors import Colors
from dspy.datasets.dataloader import DataLoader
from dspy.datasets.dataset import Dataset
from dspy.datasets.hotpotqa import HotPotQA
from dspy.datasets.math import MATH
__all__ = [
"Colors",
"DataLoader",
"Dataset",
"H... |
stanfordnlp/dspy | https://github.com/stanfordnlp/dspy | null | null | null | null | 34,175 | null | null | mit | null | null | null | null | null | null | null | dspy/clients/provider.py | null | null | null | null | null | null | Python | 2026-05-04T02:23:51.725378 | from abc import abstractmethod
from concurrent.futures import Future
from threading import Thread
from typing import TYPE_CHECKING, Any
from dspy.clients.utils_finetune import TrainDataFormat
if TYPE_CHECKING:
from dspy.clients.lm import LM
class TrainingJob(Future):
"""A future representing an asynchronous... |
stanfordnlp/dspy | https://github.com/stanfordnlp/dspy | null | null | null | null | 34,175 | null | null | mit | null | null | null | null | null | null | null | dspy/datasets/alfworld/alfworld.py | null | null | null | null | null | null | Python | 2026-05-04T02:23:51.725852 | import os
import queue
import random
def env_worker(inq, outq):
"""
Worker process: creates a single AlfredTWEnv instance,
handles 'init' (with task idx) and 'step' (with action).
"""
try:
import io
from contextlib import redirect_stderr, redirect_stdout
import alfworld.a... |
ZhuLinsen/daily_stock_analysis | https://github.com/ZhuLinsen/daily_stock_analysis | null | null | null | null | 33,852 | null | null | mit | null | null | null | null | null | null | null | .github/scripts/ai_review.py | null | null | null | null | null | null | Python | 2026-05-04T02:23:54.403727 | #!/usr/bin/env python3
"""
AI code review script used by GitHub Actions PR Review workflow.
"""
import json
import os
import subprocess
import traceback
MAX_DIFF_LENGTH = 18000
REVIEW_PATHS = [
'*.py',
'*.md',
'README.md',
'AGENTS.md',
'docs/**',
'.github/PULL_REQUEST_TEMPLATE.md',
'requir... |
ZhuLinsen/daily_stock_analysis | https://github.com/ZhuLinsen/daily_stock_analysis | null | null | null | null | 33,852 | null | null | mit | null | null | null | null | null | null | null | api/app.py | null | null | null | null | null | null | Python | 2026-05-04T02:23:54.410942 | # -*- coding: utf-8 -*-
"""
===================================
FastAPI 应用工厂模块
===================================
职责:
1. 创建和配置 FastAPI 应用实例
2. 配置 CORS 中间件
3. 注册路由和异常处理器
4. 托管前端静态文件(生产模式)
使用方式:
from api.app import create_app
app = create_app()
"""
import logging
import mimetypes
import os
import re
from cont... |
ZhuLinsen/daily_stock_analysis | https://github.com/ZhuLinsen/daily_stock_analysis | null | null | null | null | 33,852 | null | null | mit | null | null | null | null | null | null | null | api/v1/__init__.py | null | null | null | null | null | null | Python | 2026-05-04T02:23:54.425082 | # -*- coding: utf-8 -*-
"""
===================================
API v1 模块初始化
===================================
职责:
1. 导出 v1 版本 API 的路由
"""
from api.v1.router import router as api_v1_router
__all__ = ["api_v1_router"]
|
ZhuLinsen/daily_stock_analysis | https://github.com/ZhuLinsen/daily_stock_analysis | null | null | null | null | 33,852 | null | null | mit | null | null | null | null | null | null | null | api/deps.py | null | null | null | null | null | null | Python | 2026-05-04T02:23:54.432747 | # -*- coding: utf-8 -*-
"""
===================================
API 依赖注入模块
===================================
职责:
1. 提供数据库 Session 依赖
2. 提供配置依赖
3. 提供服务层依赖
"""
from typing import Generator
from fastapi import Request
from sqlalchemy.orm import Session
from src.storage import DatabaseManager
from src.config import g... |
ZhuLinsen/daily_stock_analysis | https://github.com/ZhuLinsen/daily_stock_analysis | null | null | null | null | 33,852 | null | null | mit | null | null | null | null | null | null | null | api/__init__.py | null | null | null | null | null | null | Python | 2026-05-04T02:23:54.434324 | # -*- coding: utf-8 -*-
"""
===================================
API 模块初始化
===================================
职责:
1. 导出 API 模块的公共接口
2. 统一版本管理
"""
__version__ = "1.0.0"
|
ZhuLinsen/daily_stock_analysis | https://github.com/ZhuLinsen/daily_stock_analysis | null | null | null | null | 33,852 | null | null | mit | null | null | null | null | null | null | null | analyzer_service.py | null | null | null | null | null | null | Python | 2026-05-04T02:23:54.516424 | # -*- coding: utf-8 -*-
"""
===================================
A股自选股智能分析系统 - 分析服务层
===================================
职责:
1. 封装核心分析逻辑,支持多调用方(CLI、WebUI、Bot)
2. 提供清晰的API接口,不依赖于命令行参数
3. 支持依赖注入,便于测试和扩展
4. 统一管理分析流程和配置
"""
import uuid
from typing import List, Optional
from src.analyzer import AnalysisResult
from src.con... |
ZhuLinsen/daily_stock_analysis | https://github.com/ZhuLinsen/daily_stock_analysis | null | null | null | null | 33,852 | null | null | mit | null | null | null | null | null | null | null | api/middlewares/auth.py | null | null | null | null | null | null | Python | 2026-05-04T02:23:54.518061 | # -*- coding: utf-8 -*-
"""
Auth middleware: protect /api/v1/* when admin auth is enabled.
"""
from __future__ import annotations
import logging
from typing import Callable
from fastapi import Request
from fastapi.responses import JSONResponse
from starlette.middleware.base import BaseHTTPMiddleware
from src.auth i... |
ZhuLinsen/daily_stock_analysis | https://github.com/ZhuLinsen/daily_stock_analysis | null | null | null | null | 33,852 | null | null | mit | null | null | null | null | null | null | null | api/middlewares/__init__.py | null | null | null | null | null | null | Python | 2026-05-04T02:23:54.531257 | # -*- coding: utf-8 -*-
"""
===================================
API 中间件模块初始化
===================================
职责:
1. 导出所有中间件
"""
from api.middlewares.error_handler import ErrorHandlerMiddleware
__all__ = ["ErrorHandlerMiddleware"]
|
ZhuLinsen/daily_stock_analysis | https://github.com/ZhuLinsen/daily_stock_analysis | null | null | null | null | 33,852 | null | null | mit | null | null | null | null | null | null | null | api/v1/endpoints/__init__.py | null | null | null | null | null | null | Python | 2026-05-04T02:23:54.532516 | # -*- coding: utf-8 -*-
"""
===================================
API v1 Endpoints 模块初始化
===================================
职责:
1. 声明所有 endpoint 路由模块
"""
from api.v1.endpoints import (
health,
analysis,
history,
stocks,
backtest,
system_config,
auth,
agent,
usage,
portfolio,
)
_... |
ZhuLinsen/daily_stock_analysis | https://github.com/ZhuLinsen/daily_stock_analysis | null | null | null | null | 33,852 | null | null | mit | null | null | null | null | null | null | null | api/middlewares/error_handler.py | null | null | null | null | null | null | Python | 2026-05-04T02:23:54.554849 | # -*- coding: utf-8 -*-
"""
===================================
全局异常处理中间件
===================================
职责:
1. 捕获未处理的异常
2. 统一错误响应格式
3. 记录错误日志
"""
import logging
import traceback
from typing import Callable
from fastapi import Request, Response
from fastapi.responses import JSONResponse
from starlette.middlewar... |
ZhuLinsen/daily_stock_analysis | https://github.com/ZhuLinsen/daily_stock_analysis | null | null | null | null | 33,852 | null | null | mit | null | null | null | null | null | null | null | api/v1/endpoints/analysis.py | null | null | null | null | null | null | Python | 2026-05-04T02:23:54.974203 | # -*- coding: utf-8 -*-
"""
===================================
股票分析接口
===================================
职责:
1. 提供 POST /api/v1/analysis/analyze 触发分析接口
2. 提供 GET /api/v1/analysis/status/{task_id} 查询任务状态接口
3. 提供 GET /api/v1/analysis/tasks 获取任务列表接口
4. 提供 GET /api/v1/analysis/tasks/stream SSE 实时推送接口
特性:
- 异步任务队列:分析任务异... |
ZhuLinsen/daily_stock_analysis | https://github.com/ZhuLinsen/daily_stock_analysis | null | null | null | null | 33,852 | null | null | mit | null | null | null | null | null | null | null | api/v1/endpoints/health.py | null | null | null | null | null | null | Python | 2026-05-04T02:23:55.117619 | # -*- coding: utf-8 -*-
"""
===================================
健康检查接口
===================================
职责:
1. 提供 /api/v1/health 健康检查接口
2. 用于负载均衡器和监控系统
"""
from datetime import datetime
from fastapi import APIRouter
from api.v1.schemas.common import HealthResponse
router = APIRouter()
@router.get("/health", r... |
ZhuLinsen/daily_stock_analysis | https://github.com/ZhuLinsen/daily_stock_analysis | null | null | null | null | 33,852 | null | null | mit | null | null | null | null | null | null | null | api/v1/endpoints/agent.py | null | null | null | null | null | null | Python | 2026-05-04T02:23:55.119724 | # -*- coding: utf-8 -*-
"""
Agent API endpoints.
"""
import asyncio
import json
import logging
import uuid
from typing import Any, Dict, List, Optional
from fastapi import APIRouter, HTTPException
from fastapi.responses import StreamingResponse
from pydantic import AliasChoices, BaseModel, ConfigDict, Field
from src... |
ZhuLinsen/daily_stock_analysis | https://github.com/ZhuLinsen/daily_stock_analysis | null | null | null | null | 33,852 | null | null | mit | null | null | null | null | null | null | null | api/v1/endpoints/auth.py | null | null | null | null | null | null | Python | 2026-05-04T02:23:55.120996 | # -*- coding: utf-8 -*-
"""Authentication endpoints for Web admin login."""
from __future__ import annotations
import logging
import os
from fastapi import APIRouter, Request
from fastapi.responses import JSONResponse, Response
from pydantic import BaseModel, Field
from api.deps import get_system_config_service
fro... |
ZhuLinsen/daily_stock_analysis | https://github.com/ZhuLinsen/daily_stock_analysis | null | null | null | null | 33,852 | null | null | mit | null | null | null | null | null | null | null | api/v1/endpoints/history.py | null | null | null | null | null | null | Python | 2026-05-04T02:23:55.122467 | # -*- coding: utf-8 -*-
"""
===================================
历史记录接口
===================================
职责:
1. 提供 GET /api/v1/history 历史列表查询接口
2. 提供 GET /api/v1/history/{query_id} 历史详情查询接口
"""
import logging
from typing import Optional
from fastapi import APIRouter, HTTPException, Query, Depends, Body
from api.d... |
ZhuLinsen/daily_stock_analysis | https://github.com/ZhuLinsen/daily_stock_analysis | null | null | null | null | 33,852 | null | null | mit | null | null | null | null | null | null | null | api/v1/endpoints/backtest.py | null | null | null | null | null | null | Python | 2026-05-04T02:23:55.131685 | # -*- coding: utf-8 -*-
"""Backtest endpoints."""
from __future__ import annotations
import logging
from datetime import date
from typing import Optional
from fastapi import APIRouter, Depends, HTTPException, Query
from api.deps import get_database_manager
from api.v1.schemas.backtest import (
BacktestRunReques... |
ZhuLinsen/daily_stock_analysis | https://github.com/ZhuLinsen/daily_stock_analysis | null | null | null | null | 33,852 | null | null | mit | null | null | null | null | null | null | null | api/v1/endpoints/usage.py | null | null | null | null | null | null | Python | 2026-05-04T02:23:55.161783 | # -*- coding: utf-8 -*-
"""LLM usage tracking endpoint."""
from __future__ import annotations
import logging
from datetime import datetime, timedelta, timezone
from fastapi import APIRouter, Depends, Query
from api.deps import get_database_manager
from api.v1.schemas.usage import UsageSummaryResponse
from src.stora... |
ZhuLinsen/daily_stock_analysis | https://github.com/ZhuLinsen/daily_stock_analysis | null | null | null | null | 33,852 | null | null | mit | null | null | null | null | null | null | null | api/v1/endpoints/stocks.py | null | null | null | null | null | null | Python | 2026-05-04T02:23:55.163267 | # -*- coding: utf-8 -*-
"""
===================================
股票数据接口
===================================
职责:
1. POST /api/v1/stocks/extract-from-image 从图片提取股票代码
2. POST /api/v1/stocks/parse-import 解析 CSV/Excel/剪贴板
3. GET /api/v1/stocks/{code}/quote 实时行情接口
4. GET /api/v1/stocks/{code}/history 历史行情接口
"""
import loggi... |
ZhuLinsen/daily_stock_analysis | https://github.com/ZhuLinsen/daily_stock_analysis | null | null | null | null | 33,852 | null | null | mit | null | null | null | null | null | null | null | api/v1/endpoints/portfolio.py | null | null | null | null | null | null | Python | 2026-05-04T02:23:55.233078 | # -*- coding: utf-8 -*-
"""Portfolio endpoints (P0 core account + snapshot workflow)."""
from __future__ import annotations
import logging
from datetime import date
from typing import Optional
from fastapi import APIRouter, File, Form, HTTPException, Query, UploadFile
from api.v1.schemas.common import ErrorResponse... |
ZhuLinsen/daily_stock_analysis | https://github.com/ZhuLinsen/daily_stock_analysis | null | null | null | null | 33,852 | null | null | mit | null | null | null | null | null | null | null | api/v1/endpoints/system_config.py | null | null | null | null | null | null | Python | 2026-05-04T02:23:55.292165 | # -*- coding: utf-8 -*-
"""System configuration endpoints."""
from __future__ import annotations
import logging
import os
from fastapi import APIRouter, Depends, HTTPException, Query
from api.deps import get_system_config_service
from api.v1.schemas.common import ErrorResponse
from api.v1.schemas.system_config impo... |
ZhuLinsen/daily_stock_analysis | https://github.com/ZhuLinsen/daily_stock_analysis | null | null | null | null | 33,852 | null | null | mit | null | null | null | null | null | null | null | api/v1/router.py | null | null | null | null | null | null | Python | 2026-05-04T02:23:55.673385 | # -*- coding: utf-8 -*-
"""
===================================
API v1 路由聚合
===================================
职责:
1. 聚合 v1 版本的所有 endpoint 路由
2. 统一添加 /api/v1 前缀
"""
from fastapi import APIRouter
from api.v1.endpoints import analysis, auth, history, stocks, backtest, system_config, agent, usage, portfolio
# 创建 v1 版... |
ZhuLinsen/daily_stock_analysis | https://github.com/ZhuLinsen/daily_stock_analysis | null | null | null | null | 33,852 | null | null | mit | null | null | null | null | null | null | null | api/v1/schemas/common.py | null | null | null | null | null | null | Python | 2026-05-04T02:23:55.708368 | # -*- coding: utf-8 -*-
"""
===================================
通用响应模型
===================================
职责:
1. 定义通用的响应模型(HealthResponse, ErrorResponse 等)
2. 提供统一的响应格式
"""
from typing import Optional, Any
from pydantic import BaseModel, Field
class RootResponse(BaseModel):
"""API 根路由响应"""
message: s... |
ZhuLinsen/daily_stock_analysis | https://github.com/ZhuLinsen/daily_stock_analysis | null | null | null | null | 33,852 | null | null | mit | null | null | null | null | null | null | null | api/v1/schemas/__init__.py | null | null | null | null | null | null | Python | 2026-05-04T02:23:55.709553 | # -*- coding: utf-8 -*-
"""
===================================
API v1 Schemas 模块初始化
===================================
职责:
1. 导出所有 Pydantic 模型
"""
from api.v1.schemas.common import (
RootResponse,
HealthResponse,
ErrorResponse,
SuccessResponse,
)
from api.v1.schemas.analysis import (
AnalyzeRequ... |
ZhuLinsen/daily_stock_analysis | https://github.com/ZhuLinsen/daily_stock_analysis | null | null | null | null | 33,852 | null | null | mit | null | null | null | null | null | null | null | api/v1/schemas/backtest.py | null | null | null | null | null | null | Python | 2026-05-04T02:23:55.719000 | # -*- coding: utf-8 -*-
"""Backtest API schemas."""
from __future__ import annotations
from typing import Any, Dict, List, Optional
from pydantic import BaseModel, Field
class BacktestRunRequest(BaseModel):
code: Optional[str] = Field(None, description="仅回测指定股票")
force: bool = Field(False, description="强制重... |
ZhuLinsen/daily_stock_analysis | https://github.com/ZhuLinsen/daily_stock_analysis | null | null | null | null | 33,852 | null | null | mit | null | null | null | null | null | null | null | api/v1/schemas/history.py | null | null | null | null | null | null | Python | 2026-05-04T02:23:55.732978 | # -*- coding: utf-8 -*-
"""
===================================
历史记录相关模型
===================================
职责:
1. 定义历史记录列表和详情模型
2. 定义分析报告完整模型
"""
from typing import Optional, List, Any
from pydantic import BaseModel, ConfigDict, Field
class HistoryItem(BaseModel):
"""历史记录摘要(列表展示用)"""
id: Optional[int] =... |
ZhuLinsen/daily_stock_analysis | https://github.com/ZhuLinsen/daily_stock_analysis | null | null | null | null | 33,852 | null | null | mit | null | null | null | null | null | null | null | api/v1/schemas/analysis.py | null | null | null | null | null | null | Python | 2026-05-04T02:23:55.745239 | # -*- coding: utf-8 -*-
"""
===================================
分析相关模型
===================================
职责:
1. 定义分析请求和响应模型
2. 定义任务状态模型
3. 定义异步任务队列相关模型
"""
from typing import Optional, List, Any
from enum import Enum
from pydantic import BaseModel, Field
from src.utils.analysis_metadata import SELECTION_SOURCE_PAT... |
ZhuLinsen/daily_stock_analysis | https://github.com/ZhuLinsen/daily_stock_analysis | null | null | null | null | 33,852 | null | null | mit | null | null | null | null | null | null | null | api/v1/schemas/portfolio.py | null | null | null | null | null | null | Python | 2026-05-04T02:23:55.774666 | # -*- coding: utf-8 -*-
"""Portfolio API schemas."""
from __future__ import annotations
from datetime import date
from typing import Any, Dict, List, Literal, Optional
from pydantic import BaseModel, Field
class PortfolioAccountCreateRequest(BaseModel):
name: str = Field(..., min_length=1, max_length=64)
b... |
ZhuLinsen/daily_stock_analysis | https://github.com/ZhuLinsen/daily_stock_analysis | null | null | null | null | 33,852 | null | null | mit | null | null | null | null | null | null | null | api/v1/schemas/system_config.py | null | null | null | null | null | null | Python | 2026-05-04T02:23:55.803701 | # -*- coding: utf-8 -*-
"""System configuration API schemas."""
from __future__ import annotations
from typing import Any, Dict, List, Literal, Optional
from pydantic import BaseModel, ConfigDict, Field
class SystemConfigOption(BaseModel):
"""Select option metadata for frontend rendering."""
label: str
... |
ZhuLinsen/daily_stock_analysis | https://github.com/ZhuLinsen/daily_stock_analysis | null | null | null | null | 33,852 | null | null | mit | null | null | null | null | null | null | null | api/v1/schemas/stocks.py | null | null | null | null | null | null | Python | 2026-05-04T02:23:55.804781 | # -*- coding: utf-8 -*-
"""
===================================
股票数据相关模型
===================================
职责:
1. 定义股票实时行情模型
2. 定义历史 K 线数据模型
"""
from typing import Optional, List
from pydantic import BaseModel, Field
class StockQuote(BaseModel):
"""股票实时行情"""
stock_code: str = Field(..., description=... |
ZhuLinsen/daily_stock_analysis | https://github.com/ZhuLinsen/daily_stock_analysis | null | null | null | null | 33,852 | null | null | mit | null | null | null | null | null | null | null | api/v1/schemas/usage.py | null | null | null | null | null | null | Python | 2026-05-04T02:23:56.048311 | # -*- coding: utf-8 -*-
"""Schemas for LLM usage tracking API."""
from __future__ import annotations
from typing import List
from pydantic import BaseModel, Field
class CallTypeBreakdown(BaseModel):
call_type: str = Field(..., description="'analysis' | 'agent' | 'market_review'")
calls: int
total_token... |
ZhuLinsen/daily_stock_analysis | https://github.com/ZhuLinsen/daily_stock_analysis | null | null | null | null | 33,852 | null | null | mit | null | null | null | null | null | null | null | bot/__init__.py | null | null | null | null | null | null | Python | 2026-05-04T02:23:56.288441 | # -*- coding: utf-8 -*-
"""
===================================
机器人命令触发系统
===================================
通过 @机器人 或发送命令触发股票分析等功能。
支持飞书、钉钉、企业微信、Telegram 等多平台。
模块结构:
- models.py: 统一的消息/响应模型
- dispatcher.py: 命令分发器
- commands/: 命令处理器
- platforms/: 平台适配器
- handler.py: Webhook 处理器
使用方式:
1. 配置环境变量(各平台的 Token 等)
2. 启动 W... |
ZhuLinsen/daily_stock_analysis | https://github.com/ZhuLinsen/daily_stock_analysis | null | null | null | null | 33,852 | null | null | mit | null | null | null | null | null | null | null | bot/commands/analyze.py | null | null | null | null | null | null | Python | 2026-05-04T02:23:56.289716 | # -*- coding: utf-8 -*-
"""
===================================
股票分析命令
===================================
分析指定股票,调用 AI 生成分析报告。
"""
import re
import logging
from typing import List, Optional
from bot.commands.base import BotCommand
from bot.models import BotMessage, BotResponse
from data_provider.base import canonic... |
ZhuLinsen/daily_stock_analysis | https://github.com/ZhuLinsen/daily_stock_analysis | null | null | null | null | 33,852 | null | null | mit | null | null | null | null | null | null | null | bot/commands/__init__.py | null | null | null | null | null | null | Python | 2026-05-04T02:23:56.304924 | # -*- coding: utf-8 -*-
"""
===================================
命令处理器模块
===================================
包含所有机器人命令的实现。
"""
from bot.commands.base import BotCommand
from bot.commands.help import HelpCommand
from bot.commands.status import StatusCommand
from bot.commands.analyze import AnalyzeCommand
from bot.comman... |
ZhuLinsen/daily_stock_analysis | https://github.com/ZhuLinsen/daily_stock_analysis | null | null | null | null | 33,852 | null | null | mit | null | null | null | null | null | null | null | bot/commands/base.py | null | null | null | null | null | null | Python | 2026-05-04T02:23:56.361980 | # -*- coding: utf-8 -*-
"""
===================================
命令基类
===================================
定义命令处理器的抽象基类,所有命令都必须继承此类。
"""
import asyncio
from abc import ABC, abstractmethod
from typing import List, Optional
from bot.models import BotMessage, BotResponse
class BotCommand(ABC):
"""
命令处理器抽象基类
... |
ZhuLinsen/daily_stock_analysis | https://github.com/ZhuLinsen/daily_stock_analysis | null | null | null | null | 33,852 | null | null | mit | null | null | null | null | null | null | null | bot/commands/help.py | null | null | null | null | null | null | Python | 2026-05-04T02:23:56.380768 | # -*- coding: utf-8 -*-
"""
===================================
帮助命令
===================================
显示可用命令列表和使用说明。
"""
from typing import List
from bot.commands.base import BotCommand
from bot.models import BotMessage, BotResponse
class HelpCommand(BotCommand):
"""
帮助命令
显示所有可用命令的列表和使用说明。
... |
ZhuLinsen/daily_stock_analysis | https://github.com/ZhuLinsen/daily_stock_analysis | null | null | null | null | 33,852 | null | null | mit | null | null | null | null | null | null | null | bot/commands/ask.py | null | null | null | null | null | null | Python | 2026-05-04T02:23:56.400445 | # -*- coding: utf-8 -*-
"""
Ask command - analyze one or more stocks using Agent skills.
Usage:
/ask 600519 -> Analyze with default skill
/ask 600519 用缠论分析 -> Parse skill from message
/ask 600519 chan_theory -> Specify skill id directly
/ask 600519,000858... |
ZhuLinsen/daily_stock_analysis | https://github.com/ZhuLinsen/daily_stock_analysis | null | null | null | null | 33,852 | null | null | mit | null | null | null | null | null | null | null | bot/commands/chat.py | null | null | null | null | null | null | Python | 2026-05-04T02:23:56.416862 | # -*- coding: utf-8 -*-
"""
Chat command for free-form conversation with the Agent.
"""
import logging
from typing import List, Optional
from bot.commands.base import BotCommand
from bot.models import BotMessage, BotResponse, ChatType
from src.config import get_config
logger = logging.getLogger(__name__)
def _scop... |
ZhuLinsen/daily_stock_analysis | https://github.com/ZhuLinsen/daily_stock_analysis | null | null | null | null | 33,852 | null | null | mit | null | null | null | null | null | null | null | bot/commands/history.py | null | null | null | null | null | null | Python | 2026-05-04T02:23:56.470876 | # -*- coding: utf-8 -*-
"""
History command — view recent Agent conversation sessions.
**User isolation**: each user can only see sessions whose ``session_id``
starts with their own ``{platform}_{user_id}`` prefix.
"""
import logging
from typing import List, Optional
from bot.commands.base import BotCommand
from bot... |
ZhuLinsen/daily_stock_analysis | https://github.com/ZhuLinsen/daily_stock_analysis | null | null | null | null | 33,852 | null | null | mit | null | null | null | null | null | null | null | bot/commands/batch.py | null | null | null | null | null | null | Python | 2026-05-04T02:23:56.473540 | # -*- coding: utf-8 -*-
"""
===================================
批量分析命令
===================================
批量分析自选股列表中的所有股票。
"""
import logging
import threading
import uuid
from typing import List
from bot.commands.base import BotCommand
from bot.models import BotMessage, BotResponse
logger = logging.getLogger(__nam... |
ZhuLinsen/daily_stock_analysis | https://github.com/ZhuLinsen/daily_stock_analysis | null | null | null | null | 33,852 | null | null | mit | null | null | null | null | null | null | null | bot/commands/market.py | null | null | null | null | null | null | Python | 2026-05-04T02:23:56.603193 | # -*- coding: utf-8 -*-
"""
===================================
大盘复盘命令
===================================
执行大盘复盘分析,生成市场概览报告。
"""
import logging
import threading
from typing import List
from bot.commands.base import BotCommand
from bot.models import BotMessage, BotResponse
logger = logging.getLogger(__name__)
cla... |
ZhuLinsen/daily_stock_analysis | https://github.com/ZhuLinsen/daily_stock_analysis | null | null | null | null | 33,852 | null | null | mit | null | null | null | null | null | null | null | bot/commands/strategies.py | null | null | null | null | null | null | Python | 2026-05-04T02:23:56.871698 | # -*- coding: utf-8 -*-
"""
Strategies / Skills listing command.
Shows all available trading strategies and their activation status.
"""
import logging
from typing import List
from bot.commands.base import BotCommand
from bot.models import BotMessage, BotResponse
logger = logging.getLogger(__name__)
class Strateg... |
ZhuLinsen/daily_stock_analysis | https://github.com/ZhuLinsen/daily_stock_analysis | null | null | null | null | 33,852 | null | null | mit | null | null | null | null | null | null | null | bot/commands/research.py | null | null | null | null | null | null | Python | 2026-05-04T02:23:56.884064 | # -*- coding: utf-8 -*-
"""
Research command — deep research on a stock or market topic.
Usage:
/research 600519 -> Deep research on Kweichow Moutai
/research 600519 近期业绩风险 -> Focused research with specific question
/research 新能源板块前景分析 -> Topic-based research
... |
ZhuLinsen/daily_stock_analysis | https://github.com/ZhuLinsen/daily_stock_analysis | null | null | null | null | 33,852 | null | null | mit | null | null | null | null | null | null | null | bot/commands/status.py | null | null | null | null | null | null | Python | 2026-05-04T02:23:56.888884 | # -*- coding: utf-8 -*-
"""
===================================
状态命令
===================================
显示系统运行状态和配置信息。
"""
import platform
import sys
from datetime import datetime
from typing import List
from bot.commands.base import BotCommand
from bot.models import BotMessage, BotResponse
class StatusCommand(Bo... |
ZhuLinsen/daily_stock_analysis | https://github.com/ZhuLinsen/daily_stock_analysis | null | null | null | null | 33,852 | null | null | mit | null | null | null | null | null | null | null | bot/dispatcher.py | null | null | null | null | null | null | Python | 2026-05-04T02:23:56.983643 | # -*- coding: utf-8 -*-
"""
===================================
命令分发器
===================================
负责解析命令、匹配处理器、分发执行。
"""
import asyncio
import logging
import re
import threading
import time
from collections import defaultdict
from typing import Dict, List, Optional, Type, Callable
from bot.models import BotM... |
ZhuLinsen/daily_stock_analysis | https://github.com/ZhuLinsen/daily_stock_analysis | null | null | null | null | 33,852 | null | null | mit | null | null | null | null | null | null | null | bot/handler.py | null | null | null | null | null | null | Python | 2026-05-04T02:23:56.995885 | # -*- coding: utf-8 -*-
"""
===================================
Bot Webhook 处理器
===================================
处理各平台的 Webhook 回调,分发到命令处理器。
"""
import asyncio
import json
import logging
import threading
from typing import Dict, Optional, TYPE_CHECKING
from bot.models import WebhookResponse
from bot.dispatcher im... |
ZhuLinsen/daily_stock_analysis | https://github.com/ZhuLinsen/daily_stock_analysis | null | null | null | null | 33,852 | null | null | mit | null | null | null | null | null | null | null | bot/platforms/__init__.py | null | null | null | null | null | null | Python | 2026-05-04T02:23:57.000573 | # -*- coding: utf-8 -*-
"""
===================================
平台适配器模块
===================================
包含各平台的 Webhook 处理和消息解析逻辑。
支持两种接入模式:
1. Webhook 模式:需要公网 IP,配置回调 URL
2. Stream 模式:无需公网 IP,通过 WebSocket 长连接(钉钉、飞书支持)
"""
from bot.platforms.base import BotPlatform
from bot.platforms.dingtalk import DingtalkPlatf... |
ZhuLinsen/daily_stock_analysis | https://github.com/ZhuLinsen/daily_stock_analysis | null | null | null | null | 33,852 | null | null | mit | null | null | null | null | null | null | null | bot/models.py | null | null | null | null | null | null | Python | 2026-05-04T02:23:57.016531 | # -*- coding: utf-8 -*-
"""
===================================
机器人消息模型
===================================
定义统一的消息和响应模型,屏蔽各平台差异。
"""
from dataclasses import dataclass, field
from datetime import datetime
from enum import Enum
from typing import Dict, Any, Optional, List
class ChatType(str, Enum):
"""会话类型"""
... |
ZhuLinsen/daily_stock_analysis | https://github.com/ZhuLinsen/daily_stock_analysis | null | null | null | null | 33,852 | null | null | mit | null | null | null | null | null | null | null | bot/platforms/base.py | null | null | null | null | null | null | Python | 2026-05-04T02:23:57.112720 | # -*- coding: utf-8 -*-
"""
===================================
平台适配器基类
===================================
定义平台适配器的抽象基类,各平台必须继承此类。
"""
from abc import ABC, abstractmethod
from typing import Dict, Any, Optional, Tuple
from bot.models import BotMessage, BotResponse, WebhookResponse
class BotPlatform(ABC):
"""
... |
ZhuLinsen/daily_stock_analysis | https://github.com/ZhuLinsen/daily_stock_analysis | null | null | null | null | 33,852 | null | null | mit | null | null | null | null | null | null | null | bot/platforms/dingtalk.py | null | null | null | null | null | null | Python | 2026-05-04T02:23:57.255861 | # -*- coding: utf-8 -*-
"""
===================================
钉钉平台适配器
===================================
处理钉钉机器人的 Webhook 回调。
钉钉机器人文档:
https://open.dingtalk.com/document/robots/robot-overview
"""
import hashlib
import hmac
import base64
import time
import logging
from datetime import datetime
from typing import D... |
ZhuLinsen/daily_stock_analysis | https://github.com/ZhuLinsen/daily_stock_analysis | null | null | null | null | 33,852 | null | null | mit | null | null | null | null | null | null | null | bot/platforms/dingtalk_stream.py | null | null | null | null | null | null | Python | 2026-05-04T02:23:57.295356 | # -*- coding: utf-8 -*-
"""
===================================
钉钉 Stream 模式适配器
===================================
使用钉钉官方 Stream SDK 接入机器人,无需公网 IP 和 Webhook 配置。
优势:
- 不需要公网 IP 或域名
- 不需要配置 Webhook URL
- 通过 WebSocket 长连接接收消息
- 更简单的接入方式
依赖:
pip install dingtalk-stream
钉钉 Stream SDK:
https://github.com/open-dingtalk/d... |
explosion/spaCy | https://github.com/explosion/spaCy | null | null | null | null | 33,539 | null | null | mit | null | null | null | null | null | null | null | spacy/cli/__init__.py | null | null | null | null | null | null | Python | 2026-05-04T02:24:00.119948 | from wasabi import msg
# Needed for testing
from . import download as download_module # noqa: F401
from ._util import app, setup_cli # noqa: F401
from .apply import apply # noqa: F401
from .assemble import assemble_cli # noqa: F401
# These are the actual functions, NOT the wrapped CLI commands. The CLI commands
#... |
explosion/spaCy | https://github.com/explosion/spaCy | null | null | null | null | 33,539 | null | null | mit | null | null | null | null | null | null | null | spacy/cli/apply.py | null | null | null | null | null | null | Python | 2026-05-04T02:24:00.163169 | from itertools import chain
from pathlib import Path
from typing import Iterable, List, Optional, Union, cast
import srsly
import tqdm
from wasabi import msg
from ..tokens import Doc, DocBin
from ..util import ensure_path, load_model
from ..vocab import Vocab
from ._util import Arg, Opt, app, import_code, setup_gpu, ... |
explosion/spaCy | https://github.com/explosion/spaCy | null | null | null | null | 33,539 | null | null | mit | null | null | null | null | null | null | null | spacy/about.py | null | null | null | null | null | null | Python | 2026-05-04T02:24:00.164594 | # fmt: off
__title__ = "spacy"
__version__ = "3.8.14"
__download_url__ = "https://github.com/explosion/spacy-models/releases/download"
__compatibility__ = "https://raw.githubusercontent.com/explosion/spacy-models/master/compatibility.json"
|
explosion/spaCy | https://github.com/explosion/spaCy | null | null | null | null | 33,539 | null | null | mit | null | null | null | null | null | null | null | spacy/cli/_util.py | null | null | null | null | null | null | Python | 2026-05-04T02:24:00.171532 | import os
import sys
from configparser import InterpolationError
from contextlib import contextmanager
from pathlib import Path
from typing import (
Any,
Dict,
List,
Optional,
Tuple,
Union,
overload,
)
import srsly
import typer
from click import NoSuchOption
from click.shell_completion impo... |
explosion/spaCy | https://github.com/explosion/spaCy | null | null | null | null | 33,539 | null | null | mit | null | null | null | null | null | null | null | .github/spacy_universe_alert.py | null | null | null | null | null | null | Python | 2026-05-04T02:24:00.172693 | import os
import sys
import json
from datetime import datetime
from slack_sdk.web.client import WebClient
CHANNEL = "#alerts-universe"
SLACK_TOKEN = os.environ.get("SLACK_BOT_TOKEN", "ENV VAR not available!")
DATETIME_FORMAT = "%Y-%m-%dT%H:%M:%SZ"
client = WebClient(SLACK_TOKEN)
github_context = json.loads(sys.stdin... |
explosion/spaCy | https://github.com/explosion/spaCy | null | null | null | null | 33,539 | null | null | mit | null | null | null | null | null | null | null | spacy/__init__.py | null | null | null | null | null | null | Python | 2026-05-04T02:24:00.232399 | import sys
from pathlib import Path
from typing import Any, Dict, Iterable, Union
# set library-specific custom warning handling before doing anything else
from .errors import setup_default_warnings
setup_default_warnings() # noqa: E402
# These are imported as part of the API
from thinc.api import Config, prefer_gp... |
explosion/spaCy | https://github.com/explosion/spaCy | null | null | null | null | 33,539 | null | null | mit | null | null | null | null | null | null | null | setup.py | null | null | null | null | null | null | Python | 2026-05-04T02:24:00.259520 | #!/usr/bin/env python
from setuptools import Extension, setup, find_packages
import sys
import numpy
from setuptools.command.build_ext import build_ext
from sysconfig import get_path
from pathlib import Path
import shutil
from Cython.Build import cythonize
from Cython.Compiler import Options
import os
import subprocess... |
explosion/spaCy | https://github.com/explosion/spaCy | null | null | null | null | 33,539 | null | null | mit | null | null | null | null | null | null | null | .github/validate_universe_json.py | null | null | null | null | null | null | Python | 2026-05-04T02:24:00.260350 | import json
import re
import sys
from pathlib import Path
def validate_json(document):
universe_file = Path(document)
with universe_file.open() as f:
universe_data = json.load(f)
for entry in universe_data["resources"]:
if "github" in entry:
assert not re.match(
... |
explosion/spaCy | https://github.com/explosion/spaCy | null | null | null | null | 33,539 | null | null | mit | null | null | null | null | null | null | null | extra/example_data/textcat_example_data/textcatjsonl_to_trainjson.py | null | null | null | null | null | null | Python | 2026-05-04T02:24:00.271322 | from pathlib import Path
import plac
import spacy
from spacy.training import docs_to_json
import srsly
import sys
@plac.annotations(
model=("Model name. Defaults to 'en'.", "option", "m", str),
input_file=("Input file (jsonl)", "positional", None, Path),
output_dir=("Output directory", "positional", None,... |
explosion/spaCy | https://github.com/explosion/spaCy | null | null | null | null | 33,539 | null | null | mit | null | null | null | null | null | null | null | spacy/cli/benchmark_speed.py | null | null | null | null | null | null | Python | 2026-05-04T02:24:00.749955 | import random
import time
from itertools import islice
from pathlib import Path
from typing import Iterable, List, Optional
import numpy
import typer
from tqdm import tqdm
from wasabi import msg
from .. import util
from ..language import Language
from ..tokens import Doc
from ..training import Corpus
from ._util impo... |
explosion/spaCy | https://github.com/explosion/spaCy | null | null | null | null | 33,539 | null | null | mit | null | null | null | null | null | null | null | spacy/cli/convert.py | null | null | null | null | null | null | Python | 2026-05-04T02:24:00.786509 | import itertools
import re
import sys
from enum import Enum
from pathlib import Path
from typing import Any, Callable, Iterable, Mapping, Optional, Union
import srsly
from wasabi import Printer
from ..tokens import Doc, DocBin
from ..training import docs_to_json
from ..training.converters import (
conll_ner_to_do... |
explosion/spaCy | https://github.com/explosion/spaCy | null | null | null | null | 33,539 | null | null | mit | null | null | null | null | null | null | null | spacy/cli/debug_config.py | null | null | null | null | null | null | Python | 2026-05-04T02:24:00.789979 | from pathlib import Path
from typing import Any, Dict, List, Optional, Union
import typer
from thinc.api import Config
from thinc.config import VARIABLE_RE
from wasabi import msg, table
from .. import util
from ..schemas import ConfigSchemaInit, ConfigSchemaTraining
from ..util import registry
from ._util import (
... |
explosion/spaCy | https://github.com/explosion/spaCy | null | null | null | null | 33,539 | null | null | mit | null | null | null | null | null | null | null | spacy/cli/debug_diff.py | null | null | null | null | null | null | Python | 2026-05-04T02:24:00.791147 | from pathlib import Path
from typing import Optional
import typer
from wasabi import MarkdownRenderer, Printer, diff_strings
from ..util import load_config
from ._util import Arg, Opt, debug_cli, show_validation_error
from .init_config import Optimizations, init_config
@debug_cli.command(
"diff-config",
con... |
explosion/spaCy | https://github.com/explosion/spaCy | null | null | null | null | 33,539 | null | null | mit | null | null | null | null | null | null | null | spacy/cli/assemble.py | null | null | null | null | null | null | Python | 2026-05-04T02:24:00.800625 | import logging
from pathlib import Path
from typing import Optional
import typer
from wasabi import msg
from .. import util
from ..util import get_sourced_components, load_model_from_config
from ._util import (
Arg,
Opt,
app,
import_code,
parse_config_overrides,
show_validation_error,
)
@app... |
explosion/spaCy | https://github.com/explosion/spaCy | null | null | null | null | 33,539 | null | null | mit | null | null | null | null | null | null | null | spacy/cli/debug_data.py | null | null | null | null | null | null | Python | 2026-05-04T02:24:00.801777 | import math
import sys
from collections import Counter
from pathlib import Path
from typing import (
Any,
Dict,
Iterable,
List,
Optional,
Sequence,
Set,
Tuple,
Union,
cast,
overload,
)
import numpy
import srsly
import typer
from wasabi import MESSAGES, Printer, msg
from .. ... |
explosion/spaCy | https://github.com/explosion/spaCy | null | null | null | null | 33,539 | null | null | mit | null | null | null | null | null | null | null | spacy/cli/debug_model.py | null | null | null | null | null | null | Python | 2026-05-04T02:24:00.843468 | import itertools
from pathlib import Path
from typing import Any, Dict, Optional
import typer
from thinc.api import (
Model,
data_validation,
fix_random_seed,
set_dropout_rate,
set_gpu_allocator,
)
from wasabi import msg
from spacy.training import Example
from spacy.util import resolve_dot_names
... |
explosion/spaCy | https://github.com/explosion/spaCy | null | null | null | null | 33,539 | null | null | mit | null | null | null | null | null | null | null | spacy/cli/evaluate.py | null | null | null | null | null | null | Python | 2026-05-04T02:24:00.862425 | import re
from pathlib import Path
from typing import Any, Dict, List, Optional
import srsly
from thinc.api import fix_random_seed
from wasabi import Printer
from .. import displacy, util
from ..tokens import Doc
from ..training import Corpus
from ._util import Arg, Opt, app, benchmark_cli, import_code, setup_gpu
@... |
explosion/spaCy | https://github.com/explosion/spaCy | null | null | null | null | 33,539 | null | null | mit | null | null | null | null | null | null | null | spacy/cli/find_function.py | null | null | null | null | null | null | Python | 2026-05-04T02:24:00.912258 | from typing import Optional, Tuple
from catalogue import RegistryError
from wasabi import msg
from ..util import registry
from ._util import Arg, Opt, app
@app.command("find-function")
def find_function_cli(
# fmt: off
func_name: str = Arg(..., help="Name of the registered function."),
registry_name: Op... |
explosion/spaCy | https://github.com/explosion/spaCy | null | null | null | null | 33,539 | null | null | mit | null | null | null | null | null | null | null | spacy/cli/download.py | null | null | null | null | null | null | Python | 2026-05-04T02:24:01.321430 | import importlib.util
import shutil
import sys
from typing import Optional, Sequence
from urllib.parse import urljoin
import requests
import typer
from wasabi import msg
from .. import about
from ..errors import OLD_MODEL_SHORTCUTS
from ..util import (
get_minor_version,
is_in_interactive,
is_in_jupyter,
... |
explosion/spaCy | https://github.com/explosion/spaCy | null | null | null | null | 33,539 | null | null | mit | null | null | null | null | null | null | null | spacy/cli/find_threshold.py | null | null | null | null | null | null | Python | 2026-05-04T02:24:01.340983 | import functools
import logging
import operator
from pathlib import Path
from typing import Any, Dict, List, Optional, Tuple
import numpy
import wasabi.tables
from .. import util
from ..errors import Errors
from ..pipeline import MultiLabel_TextCategorizer, TextCategorizer
from ..training import Corpus
from ._util im... |
explosion/spaCy | https://github.com/explosion/spaCy | null | null | null | null | 33,539 | null | null | mit | null | null | null | null | null | null | null | spacy/cli/init_pipeline.py | null | null | null | null | null | null | Python | 2026-05-04T02:24:01.381577 | import logging
from pathlib import Path
from typing import Optional
import srsly
import typer
from wasabi import msg
from .. import util
from ..language import Language
from ..training.initialize import convert_vectors, init_nlp
from ._util import (
Arg,
Opt,
import_code,
init_cli,
parse_config_ov... |
explosion/spaCy | https://github.com/explosion/spaCy | null | null | null | null | 33,539 | null | null | mit | null | null | null | null | null | null | null | spacy/cli/init_config.py | null | null | null | null | null | null | Python | 2026-05-04T02:24:01.383171 | import re
from enum import Enum
from pathlib import Path
from typing import List, Optional, Tuple
import srsly
from jinja2 import Template
from thinc.api import Config
from wasabi import Printer, diff_strings
from .. import util
from ..language import DEFAULT_CONFIG_PRETRAIN_PATH
from ..schemas import RecommendationS... |
explosion/spaCy | https://github.com/explosion/spaCy | null | null | null | null | 33,539 | null | null | mit | null | null | null | null | null | null | null | spacy/cli/package.py | null | null | null | null | null | null | Python | 2026-05-04T02:24:01.433833 | import os
import re
import shutil
import subprocess
import sys
from collections import defaultdict
from pathlib import Path
from typing import Any, Dict, List, Optional, Tuple, Union, cast
import srsly
from catalogue import RegistryError
from thinc.api import Config
from wasabi import MarkdownRenderer, Printer, get_ra... |
explosion/spaCy | https://github.com/explosion/spaCy | null | null | null | null | 33,539 | null | null | mit | null | null | null | null | null | null | null | spacy/cli/info.py | null | null | null | null | null | null | Python | 2026-05-04T02:24:01.438107 | import json
import platform
from pathlib import Path
from typing import Any, Dict, List, Optional, Union
import srsly
from wasabi import MarkdownRenderer, Printer
from .. import about, util
from ..compat import importlib_metadata
from ._util import Arg, Opt, app, string_to_list
from .download import get_latest_versio... |
explosion/spaCy | https://github.com/explosion/spaCy | null | null | null | null | 33,539 | null | null | mit | null | null | null | null | null | null | null | spacy/cli/pretrain.py | null | null | null | null | null | null | Python | 2026-05-04T02:24:01.446915 | import re
from pathlib import Path
from typing import Optional
import typer
from wasabi import msg
from ..training.pretrain import pretrain
from ..util import load_config
from ._util import (
Arg,
Opt,
app,
import_code,
parse_config_overrides,
setup_gpu,
show_validation_error,
)
@app.com... |
explosion/spaCy | https://github.com/explosion/spaCy | null | null | null | null | 33,539 | null | null | mit | null | null | null | null | null | null | null | spacy/cli/profile.py | null | null | null | null | null | null | Python | 2026-05-04T02:24:01.475022 | import cProfile
import itertools
import pstats
import sys
from pathlib import Path
from typing import Iterator, Optional, Sequence, Union
import srsly
import tqdm
import typer
from wasabi import Printer, msg
from ..language import Language
from ..util import load_model
from ._util import NAME, Arg, Opt, app, debug_cl... |
explosion/spaCy | https://github.com/explosion/spaCy | null | null | null | null | 33,539 | null | null | mit | null | null | null | null | null | null | null | spacy/cli/train.py | null | null | null | null | null | null | Python | 2026-05-04T02:24:02.070088 | import logging
import sys
from pathlib import Path
from typing import Any, Dict, Optional, Union
import typer
from wasabi import msg
from .. import util
from ..training.initialize import init_nlp
from ..training.loop import train as train_nlp
from ._util import (
Arg,
Opt,
app,
import_code,
parse_... |
explosion/spaCy | https://github.com/explosion/spaCy | null | null | null | null | 33,539 | null | null | mit | null | null | null | null | null | null | null | spacy/cli/validate.py | null | null | null | null | null | null | Python | 2026-05-04T02:24:02.111784 | import sys
import warnings
from pathlib import Path
from typing import Tuple
import requests
from wasabi import Printer, msg
from .. import about
from ..util import (
get_installed_models,
get_minor_version,
get_model_meta,
get_package_path,
get_package_version,
is_compatible_version,
)
from .... |
explosion/spaCy | https://github.com/explosion/spaCy | null | null | null | null | 33,539 | null | null | mit | null | null | null | null | null | null | null | spacy/compat.py | null | null | null | null | null | null | Python | 2026-05-04T02:24:02.143512 | """Helpers for Python and platform compatibility."""
import sys
from thinc.util import copy_array
try:
import cPickle as pickle
except ImportError:
import pickle # type: ignore[no-redef]
try:
import copy_reg
except ImportError:
import copyreg as copy_reg # type: ignore[no-redef]
try:
from cup... |
explosion/spaCy | https://github.com/explosion/spaCy | null | null | null | null | 33,539 | null | null | mit | null | null | null | null | null | null | null | spacy/displacy/__init__.py | null | null | null | null | null | null | Python | 2026-05-04T02:24:02.580953 | """
spaCy's built in visualization suite for dependencies and named entities.
DOCS: https://spacy.io/api/top-level#displacy
USAGE: https://spacy.io/usage/visualizers
"""
import warnings
from typing import Any, Callable, Dict, Iterable, Optional, Union
from ..errors import Errors, Warnings
from ..tokens import Doc, S... |
explosion/spaCy | https://github.com/explosion/spaCy | null | null | null | null | 33,539 | null | null | mit | null | null | null | null | null | null | null | spacy/displacy/templates.py | null | null | null | null | null | null | Python | 2026-05-04T02:24:02.582662 | # Setting explicit height and max-width: none on the SVG is required for
# Jupyter to render it properly in a cell
TPL_DEP_SVG = """
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" xml:lang="{lang}" id="{id}" class="displacy" width="{width}" height="{height}" direction="{dir}" style=... |
explosion/spaCy | https://github.com/explosion/spaCy | null | null | null | null | 33,539 | null | null | mit | null | null | null | null | null | null | null | spacy/displacy/render.py | null | null | null | null | null | null | Python | 2026-05-04T02:24:02.583748 | import uuid
from typing import Any, Dict, List, Optional, Tuple, Union
from ..errors import Errors
from ..util import escape_html, minify_html, registry
from .templates import (
TPL_DEP_ARCS,
TPL_DEP_SVG,
TPL_DEP_WORDS,
TPL_DEP_WORDS_LEMMA,
TPL_ENT,
TPL_ENT_RTL,
TPL_ENTS,
TPL_FIGURE,
... |
explosion/spaCy | https://github.com/explosion/spaCy | null | null | null | null | 33,539 | null | null | mit | null | null | null | null | null | null | null | spacy/glossary.py | null | null | null | null | null | null | Python | 2026-05-04T02:24:02.632940 | import warnings
from .errors import Warnings
def explain(term):
"""Get a description for a given POS tag, dependency label or entity type.
term (str): The term to explain.
RETURNS (str): The explanation, or `None` if not found in the glossary.
EXAMPLE:
>>> spacy.explain(u'NORP')
>>>... |
explosion/spaCy | https://github.com/explosion/spaCy | null | null | null | null | 33,539 | null | null | mit | null | null | null | null | null | null | null | spacy/errors.py | null | null | null | null | null | null | Python | 2026-05-04T02:24:02.657449 | import warnings
from .compat import Literal
class ErrorsWithCodes(type):
def __getattribute__(self, code):
msg = super().__getattribute__(code)
if code.startswith("__"): # python system attributes like __class__
return msg
else:
return "[{code}] {msg}".format(code... |
explosion/spaCy | https://github.com/explosion/spaCy | null | null | null | null | 33,539 | null | null | mit | null | null | null | null | null | null | null | spacy/kb/__init__.py | null | null | null | null | null | null | Python | 2026-05-04T02:24:02.681771 | from .candidate import Candidate, get_candidates, get_candidates_batch
from .kb import KnowledgeBase
from .kb_in_memory import InMemoryLookupKB
__all__ = [
"Candidate",
"KnowledgeBase",
"InMemoryLookupKB",
"get_candidates",
"get_candidates_batch",
]
|
explosion/spaCy | https://github.com/explosion/spaCy | null | null | null | null | 33,539 | null | null | mit | null | null | null | null | null | null | null | spacy/lang/af/stop_words.py | null | null | null | null | null | null | Python | 2026-05-04T02:24:02.756675 | # Source: https://github.com/stopwords-iso/stopwords-af
STOP_WORDS = set(
"""
'n
aan
af
al
as
baie
by
daar
dag
dat
die
dit
een
ek
en
gaan
gesê
haar
het
hom
hulle
hy
in
is
jou
jy
kan
kom
ma
maar
met
my
na
nie
om
ons
op
saam
sal
se
sien
so
sy
te
toe
uit
van
vir
was
wat
ʼn
""".split()
)
|
explosion/spaCy | https://github.com/explosion/spaCy | null | null | null | null | 33,539 | null | null | mit | null | null | null | null | null | null | null | spacy/lang/am/__init__.py | null | null | null | null | null | null | Python | 2026-05-04T02:24:02.770634 | from ...attrs import LANG
from ...language import BaseDefaults, Language
from ...util import update_exc
from ..tokenizer_exceptions import BASE_EXCEPTIONS
from .lex_attrs import LEX_ATTRS
from .punctuation import TOKENIZER_SUFFIXES
from .stop_words import STOP_WORDS
from .tokenizer_exceptions import TOKENIZER_EXCEPTION... |
explosion/spaCy | https://github.com/explosion/spaCy | null | null | null | null | 33,539 | null | null | mit | null | null | null | null | null | null | null | spacy/lang/af/__init__.py | null | null | null | null | null | null | Python | 2026-05-04T02:24:02.849712 | from ...language import BaseDefaults, Language
from .stop_words import STOP_WORDS
class AfrikaansDefaults(BaseDefaults):
stop_words = STOP_WORDS
class Afrikaans(Language):
lang = "af"
Defaults = AfrikaansDefaults
__all__ = ["Afrikaans"]
|
explosion/spaCy | https://github.com/explosion/spaCy | null | null | null | null | 33,539 | null | null | mit | null | null | null | null | null | null | null | spacy/lang/am/examples.py | null | null | null | null | null | null | Python | 2026-05-04T02:24:04.517339 | """
Example sentences to test spaCy and its language models.
>>> from spacy.lang.am.examples import sentences
>>> docs = nlp.pipe(sentences)
"""
sentences = [
"አፕል የዩኬን ጅምር ድርጅት በ 1 ቢሊዮን ዶላር ለመግዛት አስቧል።",
"የራስ ገዝ መኪኖች የኢንሹራንስ ኃላፊነትን ወደ አምራቾች ያዛውራሉ",
"ሳን ፍራንሲስኮ የእግረኛ መንገድ አቅርቦት ሮቦቶችን ማገድን ይመለከታል",
"ለንደ... |
microsoft/graphrag | https://github.com/microsoft/graphrag | null | null | null | null | 32,744 | null | null | mit | null | null | null | null | null | null | null | packages/graphrag-chunking/graphrag_chunking/__init__.py | null | null | null | null | null | null | Python | 2026-05-04T02:24:07.528508 | # Copyright (c) 2024 Microsoft Corporation.
# Licensed under the MIT License
"""System-level chunking package."""
|
microsoft/graphrag | https://github.com/microsoft/graphrag | null | null | null | null | 32,744 | null | null | mit | null | null | null | null | null | null | null | packages/graphrag-cache/graphrag_cache/cache_type.py | null | null | null | null | null | null | Python | 2026-05-04T02:24:07.536688 | # Copyright (c) 2024 Microsoft Corporation.
# Licensed under the MIT License
"""Builtin cache implementation types."""
from enum import StrEnum
class CacheType(StrEnum):
"""Enum for cache types."""
Json = "json"
Memory = "memory"
Noop = "none"
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.