Jobo16/ielts-buddy / skills/ielts-writing-review
ielts-writing-review
Verified批改雅思 Task 1 或 Task 2 作文,进行写前规划、原文证据批注和二改对照;需要可下载 Word 时生成并验证文档。用户提供作文即可使用,网站连接可选。
scripts/ielts-task1-review/extract_docx_images.py
View on GitHub#!/usr/bin/env python3
"""Extract embedded images from a Task 1 DOCX to a temporary directory."""
from __future__ import annotations
import argparse
import shutil
import tempfile
from pathlib import Path
from zipfile import ZipFile
def main() -> None:
parser = argparse.ArgumentParser(description=__doc__)
parser.add_argument("docx", type=Path)
parser.add_argument(
"--out",
type=Path,
default=None,
help="Output directory. Defaults to a unique system temporary directory.",
)
parser.add_argument(
"--clean",
action="store_true",
help="Delete an existing output directory before extracting. Use only for scratch directories.",
)
args = parser.parse_args()
out = args.out or Path(tempfile.mkdtemp(prefix="ielts_task1_images_"))
if args.clean and out.exists():
shutil.rmtree(out)
out.mkdir(parents=True, exist_ok=True)
output_paths = []
with ZipFile(args.docx) as zf:
for name in sorted(n for n in zf.namelist() if n.startswith("word/media/")):
suffix = Path(name).suffix.lower() or ".bin"
output = out / f"{args.docx.stem.replace(' ', '_')}_{Path(name).stem}{suffix}"
output.write_bytes(zf.read(name))
output_paths.append(output)
if not output_paths:
raise SystemExit(f"No embedded images found in {args.docx}")
for path in output_paths:
print(path)
if __name__ == "__main__":
main()
Related skills
| Skill | Stars | Updated | Works with | Status | Install |
|---|---|---|---|---|---|
| receiving-code-reviewobra/superpowersUse when receiving code review feedback, before implementing suggestions, especially if feedback seems unclear or technically questionable - requires technical rigor and verification, not performative agreement or blind implementation | Stars: 323k | Updated | Claude CodeCodex | Verified | Install |
| requesting-code-reviewobra/superpowersUse when completing tasks, implementing major features, or before merging to verify work meets requirements | Stars: 323k | Updated | Claude CodeCodex | Verified | Install |
| using-git-worktreesobra/superpowersUse when starting feature work that needs isolation from current workspace or before executing implementation plans - ensures an isolated workspace exists via native tools or git worktree fallback | Stars: 323k | Updated | Claude CodeCodex | Verified | Install |
| verification-before-completionobra/superpowersUse when about to claim work is complete, fixed, or passing, before committing or creating PRs - requires running verification commands and confirming output before making any success claims; evidence before assertions always | Stars: 323k | Updated | Claude CodeCodex | Verified | Install |