Python Pyupgrade Syntax Modernizer

Upgrade Python code to modern syntax with pyupgrade.

Updated Jan 12, 2026
One-click install
npx skills add https://github.com/FlexNetOS/ripple-env --skill python-pyupgrade-syntax-modernizer
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: Python Pyupgrade Syntax Modernizer
Source: https://github.com/FlexNetOS/ripple-env/tree/main/.claude/skills/python-pyupgrade-tool
Command: npx skills add https://github.com/FlexNetOS/ripple-env --skill python-pyupgrade-syntax-modernizer

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

Upgrading Python projects to modern syntax is error-prone and time-consuming; pyupgrade automates the process, applying safe syntax enhancements automatically.

Core Features & Use Cases

  • Version-targeted upgrades: Configure minimum Python versions (3.6+ to 3.14+) to apply appropriate syntax changes.
  • Safe transformations: Conservative changes designed to preserve behavior while modernizing code.
  • Pre-commit integration: Easily run as a pre-commit hook to enforce modern syntax across a repository.
  • Comprehensive coverage: Handles strings, type hints, imports, class definitions, and common Python constructs.
  • Use Case: Migrate a mixed Python 2/3 codebase to a clean, modern subset that supports current runtimes.

Quick Start

Run pyupgrade on your Python files to apply the recommended syntax upgrades for your target Python version.

Frequently Asked Questions about Python Pyupgrade Syntax Modernizer

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I automatically upgrade Python syntax for a specific version?▼

To automatically upgrade Python syntax, you can run pyupgrade on your files and configure a minimum target Python version (3.6+ to 3.14+). This applies safe, non-destructive syntax transformations appropriate for your specified runtime.

What is the best way to migrate a mixed Python 2 and 3 codebase to modern syntax?▼

Migrating a mixed Python 2 and 3 codebase to modern syntax is best handled by batch processing with pyupgrade. It automatically removes deprecated constructs like class Foo(object), ensuring your codebase cleanly supports current Python runtimes.

Can I integrate automated Python code refactoring into a pre-commit hook?▼

Yes, you can integrate automated Python code refactoring into a pre-commit hook. Pyupgrade is designed for easy integration into pre-commit hooks and CI workflows, enforcing modern syntax and updated type hints across your repository automatically.

Does pyupgrade support updating type hints during Python migrations?▼

Yes, pyupgrade supports updating type hints during Python migrations. It provides comprehensive coverage that modernizes strings, imports, class definitions, and type hints while applying conservative changes designed to preserve original behavior.

Are pyupgrade syntax transformations safe for existing codebases?▼

Pyupgrade syntax transformations are safe for existing codebases because they are explicitly designed as conservative, non-destructive changes. They modernize common Python constructs while preserving the original runtime behavior of your code.