用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
直接命令不会经过审查 Prompt;运行前请先检查来源。
npx skills add https://github.com/vamseeachanta/workspace-hub --skill xlsx-to-python-openpyxl-limitation命令会保持在同一行。复制前请横向滚动并检查完整内容。
想先保存到本地?可下载 SkillsMP 当前能够提供的文件。
Write outbound email and external messages in Vamsee Achanta's voice — a subtle offer to help, never bold or rash claims. Load before drafting ANY email, LinkedIn/Collide reply, proposal note, or outreach sent under his name.
Save/publish analysis or computation results from ANY ecosystem repo to Hugging Face as a queryable, viewer-renderable dataset. Use when the user wants to "save results to hugging face", "publish dataset to HF", "hugging face data saving", "save analysis results", "hf dataset", "make results queryable", or "render via datasets-server API". Reshapes nested results into flat parquet tables, writes a dataset card with a viewer `configs:` block and provenance, applies license/public-vs-private routing, enforces a domain data-quality gate (faithful-to-source != correct), publishes to `aceengineer/<repo>-<projection>`, and verifies via the datasets-server API.
Clone, create, fork, configure, and manage GitHub repositories. Manage remotes, secrets, releases, and workflows. Works with gh CLI or falls back to git + GitHub REST API via curl.
正在显示 SKILL.md
基于 SOC 职业分类
| name | xlsx-to-python-openpyxl-limitation |
| description | Sub-skill of xlsx-to-python: openpyxl Limitation (+3). |
| version | 1.0.0 |
| category | data |
| type | reference |
| scripts_exempt | true |
openpyxl can preserve VBA with keep_vba=True but treats vbaProject.bin as an
opaque binary blob — it cannot read the VBA source code.
from oletools.olevba import VBA_Parser
def extract_vba_code(filepath: str) -> list[dict]:
"""Extract VBA macro source code from .xlsm/.xls files."""
macros = []
try:
vba_parser = VBA_Parser(filepath)
if vba_parser.detect_vba_macros():
for filename, stream_path, vba_filename, vba_code in vba_parser.extract_macros():
macros.append({
"filename": vba_filename,
"stream_path": stream_path,
"code": vba_code,
"type": _classify_vba(vba_code),
})
vba_parser.close()
except Exception as exc:
macros.append({"error": str(exc)})
return macros
def _classify_vba(code: str) -> str:
"""Classify VBA code block type."""
code_lower = code.lower()
if "function " in code_lower:
return "function" # Custom functions called from cell formulas
elif "sub " in code_lower:
return "subroutine" # Macros / event handlers
elif "type " in code_lower:
return "type_definition" # User-defined types
return "module" # Module-level code
| VBA Pattern | Python Equivalent |
|---|---|
Function CalcStress(P, D, t) As Double | def calc_stress(p: float, d: float, t: float) -> float: |
Dim x As Double | x: float (type annotation) |
If ... Then ... ElseIf ... End If | if ... elif ... else: |
For i = 1 To N ... Next i | for i in range(1, n + 1): |
Do While ... Loop | while ...: |
Application.WorksheetFunction.VLookup(...) | np.interp(...) or dict lookup |
GoTo ErrorHandler | try/except |
ReDim arr(1 To N) | arr = [0.0] * n |
Cells(row, col).Value | Function parameter or return value |
1. Detect .xlsm → extract VBA via oletools
2. Parse VBA Function/Sub signatures → Python function stubs
3. Extract formulas via openpyxl dual-pass (values + formulas)
4. Cross-reference: cell formulas that call VBA functions
5. VBA function body → Python implementation
6. Cell values → pytest assertions (same as non-macro path)
VBA functions are often called from cell formulas as UDFs (User Defined Functions).
When a formula like =CalcStress(B2, B3, B4) is found, the VBA Function CalcStress
provides the implementation and the cell value provides the test assertion.