CLAUDE.md@by-language/python claudeA
CLAUDE.md@by-language/python is agent-read markdown (claude) from overseastelegramaliterateperson865/awesome-claude-md.
Indexed from public GitHub and served as immutable, content-addressed versions. Install it pinned to an exact SHA-256 with the mdr CLI, and every file is verified against the hash recorded here before it reaches your agent. The deterministic audit below grades the latest version, and the same file always earns the same grade.
What the file says
# Python 项目规范
## 环境与依赖
- Python >= 3.11,使用 `uv` 管理虚拟环境和依赖(优先),备选 poetry
- 激活环境:`uv venv && source .venv/bin/activate`
- 安装依赖:`uv pip install -e ".[dev]"`,不要用裸 `pip install`
- 锁文件 `uv.lock` 必须提交,手动修改 pyproject.toml 后执行 `uv lock`
## 类型标注(严格模式)
- 所有公开函数必须有完整的参数和返回值类型标注
- 禁止使用 `Any`,除非有注释说明原因
- 容器类型用 `list[str]` 而非 `List[str]`(Python 3.9+ 内置泛型)
- 可选参数用 `str | None = None`,不用 `Optional[str]`
- 运行 `mypy --strict src/` 零错误
## 测试
- 框架:pytest,配置写在 pyproject.toml 的 `[tool.pytest.ini_options]`
- 运行全部测试:`pytest -x -q`,单文件:`pytest tests/test_xxx.py -v`
- 测试文件与源码目录镜像:`src/app/services/user.py` -> `tests/services/test_user.py`
- fixture 放 `tests/conftest.py`,按模块拆分避免单文件过大
- 覆盖率:`pytest --cov=src --cov-report=term-missing`,目标 >= 80%
## Linting 与格式化
- 唯一工具:ruff(替代 flake8 + isort + black)
- 格式化:`ruff format src/ tests/`
- 检查:`ruff check src/ tests/ --fix`
- 提交前必须通过:`ruff check && ruff format --check && mypy --strict src/`
## 项目结构
```
src/
app/
__init__.py
models/ # 数据模型(dataclass / Pydantic)
services/ # 业务逻辑,不依赖框架
utils/ # 纯工具函数,无副作用
tests/
pyproject.toml
```
## 常见陷阱
- 默认可变参数:写 `def f(items: list[int] | None = None)` 而非 `def f(items: list[int] = [])`
…Read the whole file at its exact version.
How to install
mdr add overseastelegramaliterateperson865/awesome-claude-md/by-language/python/CLAUDE.md@git:20260320.fcf2609mdr add overseastelegramaliterateperson865/awesome-claude-md/by-language/python/CLAUDE.md@sha256:0b4d651677f053f7Pin to a label to follow the author's releases, or to a sha256 to freeze the exact bytes forever. Either way the resolved hash is written to mdr.lock, and mdr install reproduces it on any machine.
[](https://markdownregistry.com/a/art_vx6fuvvy7et545kr)
1 badge views in 30 days
Versions
Audit of the latest version
- pass: Size between 200 bytes and 200 KB (2021 bytes)
- pass: No zero-width or bidi control characters
- pass: No instruction hidden inside an HTML comment
- pass: No link to an exfiltration or paste host
- pass: No credential-shaped string
- pass: No instruction to send local credentials anywhere
- pass: No text hidden with inline styles
- pass: No prompt-injection phrasing
- pass: No curl or wget piped into a shell
- pass: No recursive delete of root, home or parent
- pass: No instruction to read or print local credentials
- pass: No base64 blob over 200 characters
- pass: No link to a raw IP address
- pass: No script tag
Source
overseastelegramaliterateperson865/awesome-claude-md · 3 stars · license MIT · pushed 2026-09-23 · branch main
API
GET https://markdownregistry.com/api/v1/artifacts/art_vx6fuvvy7et545kr GET https://markdownregistry.com/api/v1/resolve?ref=overseastelegramaliterateperson865/awesome-claude-md/by-language/python/CLAUDE.md GET https://markdownregistry.com/api/v1/blob/0b4d651677f053f77f949d9905af6e59b9b1baf9d26d2ca530f6eb316ad29ce6
Your agent does the legwork. You hear about the deals worth your word. Hand yours the standing instructions at modelranch.com and it joins the network that reads files like this one.
More from overseastelegramaliterateperson865/awesome-claude-md
Every file in overseastelegramaliterateperson865/awesome-claude-md