python-to-go-converter
Automatically converts Python code to optimized Go code for performance-critical applications.
- License 许可
- MIT
- 最近更新
- 2026-06-07
- Stars
- ★ 0
- Forks
- 1
01 前言 Front Matter
- name
- python-to-go-converter
- description
- Automatically converts Python code to optimized Go code for performance-critical applications.
03 SKILL.md 正文
SKILL.md — Python to Go Converter
Overview
This skill automatically converts Python source code to idiomatic, compilable Go code. It handles type mappings, import translations, and produces clean Go output suitable for performance-critical applications.
Capabilities
- Convert Python source files to Go with preserved functionality
- Intelligent Python-to-Go type mapping (int, str, list, dict, classes, etc.)
- Translate common Python standard library imports to Go equivalents
- Generate properly formatted Go code with comments
- Provide detailed error diagnostics for unsupported Python features
- CLI interface for batch conversion and agent integration
- Support for functions, classes, control flow, and basic data structures
Installation
The skill is installed as part of an OpenClaw skill package. Ensure dependencies are met (Python 3.8+, go compiler in PATH).
Usage
CLI Invocation
python-to-go-converter convert <input.py> [--output <output.go>]
Agent Integration
The skill exposes a single-turn execution model. Provide Python code as input, receive Go code as output.
Examples
# Convert a single file
python-to-go-converter convert examples/basic.py --output output.go
# Convert with diagnostics
python-to-go-converter convert myscript.py --verbose
Error Handling
The converter produces non-zero exit codes on failure and writes diagnostics to stderr. Common errors include:
- Unsupported Python syntax (decorators, metaclasses, async generators)
- Library dependencies without Go equivalents
- Type inference failures
See error_codes.json for the full error catalog.
Files
scripts/converter.py— Main CLI and conversion orchestrationscripts/ast_parser.py— Python AST parsing and analysisscripts/go_generator.py— Go code emission and formattingscripts/type_mapper.py— Type system translation rulesscripts/import_handler.py— Import resolution and library mappingreferences/python_to_go_mappings.json— Feature mapping tablereferences/stdlib_equivalents.json— Standard library translationsreferences/error_codes.json— Error code definitionsexamples/— Example conversions and test casestests/— Unit tests and validation suite
Limitations
- Does not convert GUI frameworks (Tkinter, PyQt)
- No support for dynamic metaprogramming (eval, exec, setattr magic)
- Machine learning libraries (NumPy, TensorFlow) require manual rewrite
- Perfect 1:1 runtime behavior is not guaranteed; testing required
Performance
Typical conversion times: small scripts (<100 LOC) < 1s; medium (500 LOC) ~2-3s; large codebases scale linearly. Conversion is CPU-bound on Python parsing and AST traversal.
Support
For issues, feature requests, or contributions, refer to the skill repository.
04 同仓库更多 Skills
crowd-prompting
A marketplace where AI agents improve prompts, system instructions, tool descriptions, and other text-based content with domain expertise from real-world operations — and earn tokens for valuable contributions.
ceaser
Interact with the Ceaser privacy protocol on Base L2 using the ceaser-mcp MCP tools. This skill uses the ceaser-mcp npm package for ALL operations -- shield, unshield, note management, and protocol queries. All ceaser tool calls use CLI subcommands (npx -y ceaser-mcp <subcommand>). Ceaser is a privacy-preserving ETH wrapper using Noir/UltraHonk zero-knowledge proofs on Base L2 (chain ID 8453).
ceaser-send
Fully automated private ETH transfer via Ceaser Protocol on Base L2 using the ceaser-mcp MCP tools. This skill uses the ceaser-mcp npm package for ALL operations -- all ceaser tool calls use CLI subcommands (npx -y ceaser-mcp <subcommand>). WARNING -- creates observable on-chain links between user wallet and hot wallet (see Privacy Warning). Generates an ephemeral hot wallet with BIP-39 mnemonic recovery, user funds it, agent signs and broadcasts the Shield TX automatically. Exactly one manual step required (funding the hot wallet with ETH). Uses Noir/UltraHonk zero-knowledge proofs.
dilemm-ai
Compete in DilemmAI, the prisoner's dilemma AI arena at dilemm.ai. Use when an OpenClaw agent wants to create an account, design and submit strategy prompts for their bot, enter matchmaking, analyze historical matches and leaderboards, and iterate on bot strategy. Requires headless browser automation (no API available yet).
moldium
Post and manage content on the Moldium blog platform. Triggered by "post to Moldium", "write a blog post", "publish an article", etc.
arxiv-paper-reviews
Interact with arXiv Crawler API to fetch papers, read reviews, submit comments, search papers, and import papers. Use when working with arXiv papers, fetching paper lists by date/category/interest, viewing paper details with comments, submitting paper reviews, searching papers by title, or importing papers from arXiv URLs via API at http://weakaccept.top:8000/.