11 Repos
Tools that assist in modifying, cleaning, or modernizing existing codebases.
Explore 11 awesome GitHub repositories matching part of an awesome list · Code Refactoring. Refine with filters or upvote what's useful.
This project is a comprehensive collection of software design patterns implemented in Python. It serves as a reference for architectural, behavioral, creational, and structural patterns to guide the organization of Python applications. The collection covers behavioral strategies for managing object communication and state, creational techniques for controlling object instantiation, and structural methods for composing classes and objects into flexible hierarchies. It also includes architectural references for system-wide structuring, such as multi-tier architectures and blackboard models. Th
Identifies architectural anti-patterns and provides clean, idiomatic Python refactoring alternatives.
Awesome autocompletion, static analysis and refactoring library for python
Library for autocompletion and static analysis during refactoring.
MonkeyType ist ein Laufzeit-Typ-Inferenz- und Analysetool für Python. Es sammelt tatsächliche Argument- und Rückgabetypen von Funktionsaufrufen während der Programmausführung, um die Erstellung statischer Typ-Annotationen und kompatibler Stub-Dateien zu automatisieren. Das System konvertiert erfasste Ausführungs-Traces in statische Typ-Hinweise, die direkt in Funktionsdefinitionen des Quellcodes eingefügt oder zur Generierung externer Typ-Stubs verwendet werden können. Dieser Prozess ermöglicht das Hinzufügen von Typsicherheit zu bestehenden Codebasen durch die Analyse realer Datentypen anstelle manueller Audits. Die Funktionen des Tools decken die Laufzeit-Typ-Sammlung, dynamische Typ-Inferenz und die Generierung statischer Typ-Definitionen ab. Es nutzt Quellcode-Modifikation und Call-Trace-Persistenz, um beobachtete Laufzeitmuster auf statische Signaturen abzubilden.
Generates type annotations by observing runtime execution.
Vulture ist ein statisches Analysetool und Linter, das entwickelt wurde, um ungenutzte Variablen, Funktionen und Klassen im Python-Quellcode zu finden. Es arbeitet als Dead-Code-Detektor und Finder für ungenutzten Code, der Quelldateien scannt, um nicht erreichbare Ausdrücke und Importe zu identifizieren, ohne den Code auszuführen. Das Tool verwendet ein konfidenzbasiertes heuristisches Bewertungssystem, um Erkennungen Wahrscheinlichkeitswerte zuzuweisen und so zwischen tatsächlich ungenutzten Symbolen und potenziellen False Positives zu unterscheiden. Es unterstützt zudem das Bereinigen von Dead-Code, indem erkannte ungenutzte Klassen und Funktionen nach Zeilenanzahl sortiert werden, um die Entfernung der größten Codeblöcke zu priorisieren. Die Analyseoberfläche umfasst Control-Flow-Reachability-Analyse, Symbol-Referenz-Tracking und die Möglichkeit, False Positives durch Namensmuster, Decorators oder Ignore-Kommentare zu unterdrücken. Vulture unterstützt zudem die Erstellung und Verwaltung von Whitelists über Mock-Module, um spezifische Elemente von nachfolgenden Scans auszuschließen. Projektweite Analyseregeln und Zielpfade können über Konfigurationsdateien verwaltet werden, einschließlich Unterstützung für das TOML-Format.
Identifies and removes unused or dead code.
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 const
Automatically updates syntax to use modern language features.
a python refactoring library
Comprehensive library for automated code refactoring tasks.
Removes unused imports and unused variables as reported by pyflakes
Removes unused imports and variables from source files.
add-trailing-comma
Automatically inserts trailing commas for cleaner diffs.
com2ann
Converts type comments into modern type annotations.
.. image:: https://img.shields.io/pypi/v/massedit.svg :target: https://pypi.python.org/pypi/massedit/ :alt: PyPi version
Enables programmatic text editing across multiple files.
🚀 The ultimate linter and formatter for removing unused import statements in your code.
Cleans up unused import statements in Python files.