py2py3-converter for Openclaw

A powerful automation skill for converting legacy Python 2 source code to modern Python 3 syntax with built-in test generation.

martinforsulu
v1.0.0
Feb 25, 2026
0
0
0

Install & Download

1. ClawHub CLI

The fastest way to install a skill directly from the registry.

npx clawhub@latest install neo-py2py3-converter

2. Manual Installation

Copy the skill folder to one of these locations

Global
~/.openclaw/skills/
Workspace
<project>/skills/

Priority: Workspace > Local > Bundled

3. Prompt Installation

Copy this prompt to OpenClaw to install it automatically.

Help me install neo-py2py3-converter using Clawhub. If Clawhub is not installed, install it first (npm i -g clawhub).

Prefer to download?

Get the raw skill files in a ZIP archive.

What is py2py3-converter?

The py2py3-converter is an essential Openclaw Skills extension designed to bridge the gap between legacy environments and modern development standards. Since Python 2 reached its official end-of-life, developers often face the daunting task of manual refactoring. This skill automates the most tedious aspects of migration, ensuring that syntax, type handling, and standard library imports are updated correctly to Python 3 standards.

By integrating this tool into your workflow, you can handle complex transformations such as print function conversions, integer division adjustments, and the removal of deprecated imports. It provides a robust framework for modernization, making it a cornerstone for teams maintaining long-term projects within the Openclaw Skills marketplace.

py2py3-converter Use Cases

  • Modernizing enterprise legacy applications from Python 2.7 to 3.x.
  • Automating the cleanup of technical debt in older scripts during cloud migration.
  • Generating automated unit tests to ensure functional parity after code conversion.
  • Auditing codebases for Python 3 compatibility issues before performing a full refactor.

How py2py3-converter Works

  1. The user provides legacy Python 2 code or identifies a source file for processing.
  2. The Openclaw Skills runner invokes the conversion logic to map deprecated syntax like xrange and raw_input to modern equivalents.
  3. The system performs a compatibility scan to identify edge cases that may require human intervention.
  4. If enabled, the skill generates a companion pytest file to validate the syntax and behavioral integrity of the converted code.
  5. A comprehensive report containing the modernized code and identified issues is returned to the user.

py2py3-converter Setup

To get started with this skill, ensure you have the necessary environment configured and run the following commands:

# Install the necessary dependencies
npm install

# Convert a specific file from Python 2 to Python 3
node scripts/cli.js convert --input path/to/legacy.py --output path/to/modern.py

# Run the converter with automated test generation
node scripts/cli.js convert --input file.py --output converted.py --generate-tests

py2py3-converter Data Schema & Taxonomy

The skill manages data through a structured pipeline that outputs both code and metadata. The following table describes the primary data components:

Component Description
convertedCode The final Python 3 compatible source code string.
issues A collection of objects detailing conversion info, warnings, and errors.
testFiles Automatically generated pytest files used for functional validation.
exitCodes Standardized return values (0 for success, 1 for warnings, 2 for errors).

py2py3-converter Advanced Features

  • Automated companion pytest generation to verify code correctness immediately.
  • Deep import resolution for standard library changes, such as moving urllib2 to urllib.request.
  • Granular compatibility reporting with specific line-by-line issue flagging.
  • Support for stdin piping, allowing for high-velocity automation in CI/CD pipelines.

SKILL.md


Loading

Related Openclaw Skills

METADATA

Github Stars: 0
forks: 0

Featured*