jupytext
БесплатноЗапускает вложенные скриптыНе проверенALWAYS use before touching a notebook as text or running one headlessly - "convert this notebook to a .py", "turn this script into a notebook", "get this…
Об этом скилле
What this skill carries — grep references/ for any subject the names below miss:
!d=${CLAUDE_SKILL_DIR}; command -v skill-toc >/dev/null 2>&1 && exec skill-toc "$d"; s=$HOME/.claude/skills/plugin-utils/bin/skill-toc; [ -x "$s" ] && exec "$s" "$d"; echo "(skill-toc unavailable: references and scripts are NOT listed here — install the plugin-utils plugin, or start a new session so its bin/ reaches PATH)"
Contents
- Execution Enforcement
- Core Concepts
- Multi-Kernel Data Sharing
- Workflow Integration
- Project Structure
- Kernel Specification
- Quick Troubleshooting
- Additional Resources
- Best Practices
Jupytext Skill
Jupytext converts Jupyter notebooks to/from text formats (.py, .R, .md), enabling version control and multi-kernel workflows.
Execution Enforcement
IRON LAW: NO EXECUTION CLAIM WITHOUT OUTPUT VERIFICATION
Before claiming ANY jupytext script executed successfully, follow this sequence:
- EXECUTE using the papermill pipeline:
jupytext --to notebook --output - script.py | papermill - output.ipynb - CHECK for execution errors (papermill exit code and stderr)
- VERIFY output.ipynb exists and is non-empty
- INSPECT outputs using notebook-debug skill verification
- CLAIM success only after verification passes
This is non-negotiable. Skipping papermill execution is NOT HELPFUL — the user gets a notebook that fails on first run.
Jupytext Facts
- Papermill can exit 0 while cells contain tracebacks. Claiming success from the exit code alone is an unverified claim presented as fact — check output.ipynb for tracebacks.
- Use the papermill pipeline, not
jupyter nbconvert --execute— papermill has better error handling, parameter injection, and logging, and the pipe form needs no intermediate.ipynbfiles.
Red Flags
- About to return a converted .ipynb without executing it → run the papermill pipeline first.
- About to claim success from conversion or exit code alone → verify output.ipynb.
Execution Verification Checklist
Before EVERY "notebook works" claim:
Conversion:
- Correct format specified (py:percent recommended)
- Conversion command succeeded
- No syntax errors in conversion
Execution (MANDATORY):
- Used recommended papermill pipeline:
jupytext --to notebook --output - script.py | papermill - output.ipynb - Papermill exit code is 0
- No errors in stderr
- output.ipynb file created
- output.ipynb is non-empty (>100 bytes)
Output Verification:
- Used notebook-debug skill's verification checklist
- No tracebacks in any cell
- All cells have execution_count (not null)
- Expected outputs present (plots, dataframes, metrics)
- No unexpected warnings or errors
Multi-Kernel Projects (if applicable):
- Correct kernel specified in header
- Interchange files created (parquet/DTA)
- Downstream notebooks can read interchange files
Only after ALL checks pass:
- Claim "notebook executed successfully"
Gate Function: Jupytext Execution
Follow this sequence for EVERY jupytext task involving execution:
1. CONVERT → jupytext --to notebook --output -
2. EXECUTE → papermill - output.ipynb (with params if needed)
3. CHECK → Verify exit code and stderr
4. INSPECT → Use notebook-debug verification
5. VERIFY → Outputs match expectations
6. CLAIM → "Notebook works" only after all gates passed
NEVER skip execution gate. Converting without executing proves nothing about correctness.
Core Concepts
Percent Format (Recommended)
Use percent format (py:percent) for all projects:
# %% [markdown]
# # Analysis Title
# %%
import pandas as pd
df = pd.read_csv("data.csv")
# %% tags=["parameters"]
input_file = "data.csv"
Cell markers: # %% for code, # %% [markdown] for markdown.
Markdown dollar signs: Always wrap $ in backticks to prevent LaTeX rendering - # Cost: $50`` not # Cost: $50
Project Configuration
Create jupytext.toml in project root:
formats = "ipynb,py:percent"
notebook_metadata_filter = "-all"
cell_metadata_filter = "-all"
Essential Commands
# Convert notebook to percent-format Python file
jupytext --to py:percent notebook.ipynb
# Convert Python script to Jupyter notebook format
jupytext --to notebook script.py
# Enable bidirectional pairing to keep formats synchronized
jupytext --set-formats ipynb,py:percent notebook.ipynb
# Synchronize paired notebook and text file
jupytext --sync notebook.ipynb
Execution (Recommended Pattern)
Always pipe to papermill for execution - no intermediate files:
# Convert script to notebook and execute in atomic operation
jupytext --to notebook --output - script.py | papermill - o
Установить jupytext в Claude Code и Claude Desktop
Зарегайся, чтобы установить скилл
Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.
- Открой команду установки в одну строку
- Сохраняй скиллы в синхронизируемую библиотеку
- Уведомления, когда скиллы обновляются
Разрешённые инструменты
Инструменты, которые скиллу разрешено вызывать.
Без ограничений — скилл может использовать любой инструмент.
Вложенные файлы
FAQ
Что делает скилл jupytext?
ALWAYS use before touching a notebook as text or running one headlessly - "convert this notebook to a .py", "turn this script into a notebook", "get this ipynb into git", "the notebook diffs are unreadable", "keep the .py and .ipynb in sync", "run this notebook end to end", "execute the notebook with these parameters", "papermill", "jupytext", "add an R/Stata/SAS kernel", "share data between kernels". Use even when the user only says "just run the notebook" - never claim a notebook ran without executing and inspecting it.
Как установить скилл jupytext?
Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.
Скилл jupytext запускает скрипты?
Да, скилл несёт исполняемые скрипты. Проверь исходник перед установкой.
Похожие скиллы
skill-creator
Create new skills, modify and improve existing skills, and measure skill performance. Use when users want to create a skill from scratch, edit, or optimize an…
от Anthropicdiscernment-nudge
After you give a substantive answer or draft that the user may act on — advice or recommendations, drafted artifacts such as goals, plans, pitches, proposals…
от Anthropicdata-consolidate
Joins the plant's scheduled exports and connector data into one working dataset — ERP items (NetSuite or Infor M3), sales orders, production work orders…
от Anthropicinspection-to-capa
Runs the quality chain end to end: writes the nonconformance against the requirement it violates, searches history at the moment of writing to say whether…
от Anthropic