awesome-repositories.com
Blog
MCP
awesome-repositories.com

Entdecke die besten Open-Source-Repositories mit KI-gestützter Suche.

EntdeckenKuratierte SuchenOpen-Source-AlternativenSelf-hosted SoftwareBlogSitemap
ProjektÜber unsRanking-MethodikPresseMCP-Server
RechtlichesDatenschutzAGB
© 2026 Bringes Technology SRL·VAT RO45896025·hello@awesome-repositories.com
·
asottile avatar

asottile/pyupgrade

0
View on GitHub↗
4,097 Stars·213 Forks·Python·MIT·5 Aufrufe

Pyupgrade

pyupgrade is a static code modernizer and syntax upgrader for Python. It automatically rewrites source code to implement modern language features and syntax based on a specified target version.

The tool focuses on removing technical debt by deleting deprecated imports, compatibility shims, and obsolete version-specific conditional blocks. It also refactors type annotations to use current standards, such as simplified generic aliases and union operators.

Its capability surface includes updating standard library usage, optimizing built-in function calls, and converting verbose collection constructors or string formatting into concise modern equivalents. These transformations are performed via a target-versioned rule engine that preserves original formatting and comments.

Features

  • Python Syntax Modernizers - Automatically rewrites Python source code to implement modern language features and syntax based on a specified target version.
  • Python Code Modernizers - Removes technical debt by deleting deprecated imports, compatibility shims, and obsolete version-specific conditional blocks.
  • Dead Code Removal - Automatically deletes obsolete imports, encoding comments, and version-specific conditional blocks that are no longer needed.
  • Type Hint Refactoring - Refactors type annotations to use modern standards such as simplified generic aliases and union operators.
  • Language Version Targeting - Executes specific transformation rules based on a user-defined target Python version to ensure language compatibility.
  • Type Annotation Modernization - Updates Python type hinting syntax by removing quoted annotations and applying simplified generic aliases.
  • Type Annotation Refactoring - Updates Python typing syntax to use modern standards such as built-in collection types and union operators.
  • Python Refactoring Libraries - Provides automated refactoring of outdated type hinting syntax into modern generic aliases and union operators.
  • Structural Pattern Matching - Identifies outdated code sequences and replaces them with modern equivalents through precise tree-node substitution.
  • Compatibility Shim Removal - Deletes obsolete future imports, compatibility library calls, and version check blocks no longer required for the target version.
  • Python Code Modernization - Updates legacy Python source code to use newer language features and syntax based on a target version.
  • Python Syntax Optimization - Replaces verbose library calls and outdated string formatting with concise and efficient modern Python equivalents.
  • Python Technical Debt Reduction - Removes deprecated imports, version compatibility shims, and obsolete code blocks no longer needed in newer environments.
  • Concrete Syntax Tree Transformations - Implements transformations on concrete syntax trees to ensure that original source formatting and comments are preserved during rewriting.
  • AST Transformation Tools - Uses a concrete syntax tree to apply precise structural changes while preserving formatting and comments.
  • Multi-Pass Rewriting - Employs sequential transformation cycles to resolve complex, interdependent syntax upgrades in a single execution.
  • Deprecated Import Normalization - Updates outdated module imports and replaces deprecated aliases with current standard library paths.
  • Standard Library API Migration - Replaces deprecated function aliases and outdated argument patterns with current Python standard library equivalents.
  • Standard Library API Simplification - Cleans up common standard library API usage to reduce verbosity and improve code readability.
  • String Formatting Modernization - Transforms printf-style and method-based strings into modern formatted string literals or simplified specifiers.
  • Python Literal Syntax Enforcement - Enforces the use of idiomatic Python literal syntax over verbose constructor calls for sets and dictionaries.
  • Code Refactoring - Automatically updates syntax to use modern language features.

Star-Verlauf

Star-Verlauf für asottile/pyupgradeStar-Verlauf für asottile/pyupgrade

KI-Suche

Entdecke weitere awesome Repositories

Beschreibe in einfachen Worten, was du brauchst — die KI bewertet tausende kuratierte Open-Source-Projekte nach Relevanz.

Start searching with AI

Open-Source-Alternativen zu Pyupgrade

Ähnliche Open-Source-Projekte, sortiert nach der Anzahl der gemeinsamen Funktionen mit Pyupgrade.
  • adamchainz/django-upgradeAvatar von adamchainz

    adamchainz/django-upgrade

    1,214Auf GitHub ansehen↗

    Django-upgrade is a command-line tool that automatically modernizes legacy Python and Django codebases by rewriting outdated syntax patterns into current idioms. It operates as a static analysis linter and source code transformation engine, parsing files to identify deprecated constructs and replacing them in place while preserving project integrity. The software uses a rule-based transformation architecture driven by abstract syntax tree parsing to execute modular refactoring tasks. Developers can configure target version settings to ensure the tooling only applies updates appropriate for th

    Pythondjango
    Auf GitHub ansehen↗1,214
  • davidhalter/jediAvatar von davidhalter

    davidhalter/jedi

    6,157Auf GitHub ansehen↗

    Awesome autocompletion, static analysis and refactoring library for python

    Python
    Auf GitHub ansehen↗6,157
  • google/yapfAvatar von google

    google/yapf

    13,978Auf GitHub ansehen↗

    YAPF is a Python code formatter and style compliance tool. It operates as an AST-based reformatter that uses concrete syntax trees to ensure structural consistency and a uniform visual presentation across source files. The engine utilizes a penalty-based layout optimizer to determine the best line breaks by calculating numerical costs for different formatting choices. It employs a multi-process code processor to distribute the formatting of multiple files across several CPU cores. The tool covers source code reformatting through in-place file modifications, difference analysis, and the proce

    Python
    Auf GitHub ansehen↗13,978
  • python-mode/python-modeAvatar von python-mode

    python-mode/python-mode

    5,465Auf GitHub ansehen↗

    python-mode is a Vim IDE plugin that provides an integrated toolset for Python development. It incorporates a debugging interface for managing execution breakpoints and inspecting program state, a documentation browser for retrieving official language symbols, and a system for static analysis and automated structural refactoring. The project features a dedicated environment manager that detects and utilizes project-specific virtual environments to ensure correct library and interpreter resolution. It integrates external tools such as PyLint and Rope to identify code errors and perform project

    Vim Script
    Auf GitHub ansehen↗5,465
Alle 30 Alternativen zu Pyupgrade anzeigen→

Häufig gestellte Fragen

Was macht asottile/pyupgrade?

pyupgrade is a static code modernizer and syntax upgrader for Python. It automatically rewrites source code to implement modern language features and syntax based on a specified target version.

Was sind die Hauptfunktionen von asottile/pyupgrade?

Die Hauptfunktionen von asottile/pyupgrade sind: Python Syntax Modernizers, Python Code Modernizers, Dead Code Removal, Type Hint Refactoring, Language Version Targeting, Type Annotation Modernization, Type Annotation Refactoring, Python Refactoring Libraries.

Welche Open-Source-Alternativen gibt es zu asottile/pyupgrade?

Open-Source-Alternativen zu asottile/pyupgrade sind unter anderem: adamchainz/django-upgrade — Django-upgrade is a command-line tool that automatically modernizes legacy Python and Django codebases by rewriting… davidhalter/jedi — Awesome autocompletion, static analysis and refactoring library for python. python-mode/python-mode — python-mode is a Vim IDE plugin that provides an integrated toolset for Python development. It incorporates a… google/yapf — YAPF is a Python code formatter and style compliance tool. It operates as an AST-based reformatter that uses concrete… postcss/postcss — PostCSS is a CSS post-processor and abstract syntax tree transformation tool that parses stylesheets into a structured… facebook/jscodeshift — jscodeshift is a JavaScript AST transformation toolkit and codemod engine designed for large-scale code refactoring…