agentsclimarketplace

Python heredoc

Skill crypdick/pynchy/data/defaults/skills/python-heredoc

OpenClaw alternative with strict container isolation for security measures. Connects to WhatsApp, has memory, scheduled jobs, and runs directly on Anthropic's Agents SDK

Install
npx -y skills add crypdick/pynchy --skill python-heredoc

Assembled from the repository path, not quoted from the project. Check it against their README if it does not work.

One thing to look at

  • 10 stars10 stars. Stars are a popularity signal and not a quality one, but at this level it is likely that nobody has read this closely except its author, and you would be relying on your own review.

What its author says it does

Copied from the file, not written here

When running multi-line Python code or code with quotes, apostrophes, or f-strings via Bash, always use heredoc syntax instead of python -c to avoid shell quoting issues.

SKILL.md

1.1 KB, as published. Nobody here has run it

Python Heredoc Pattern

Run Python via Bash? Never python -c "..." beyond trivial one-liners. Shell quoting break on f-strings, apostrophes, nested quotes, escape sequences.

Use heredoc syntax instead

uv run python << 'PYTHON_CODE'
import json

data = {"name": "it's working", "value": f"{1 + 2}"}
print(json.dumps(data, indent=2))
PYTHON_CODE

Single quotes round 'PYTHON_CODE' block shell var expansion. $variables and backticks stay literal Python.

With dependencies

uv run --with requests python << 'PYTHON_CODE'
import requests

resp = requests.get("https://api.example.com/data")
print(resp.json())
PYTHON_CODE

Rules

  1. Always uv run python (not bare python or python3)
  2. Always quote delimiter: << 'PYTHON_CODE' (not << PYTHON_CODE)
  3. Closing PYTHON_CODE own line, no leading whitespace
  4. Never python -c for code with quotes, f-strings, multiple statements

Keep looking

Skills are one crate of 328,083. Ordering is by how many stacks a row turns up in, so the top of any crate is what has actually been picked rather than what has the most stars.