asottile/pyupgrade

A tool (and pre-commit hook) to automatically upgrade syntax for newer versions of the language.

View on GitHub ↗Jump to charts ↓Open shareable report

Summary Information

Updated 35 minutes ago
Added to GitGenius on September 16th, 2026
Created on February 28th, 2017
Open Issues & Pull Requests: 23 (+0)
GitHub issues: Enabled
Number of forks: 219
Total Stargazers: 4,110 (+0)
Total Subscribers: 32 (+0)

Repository Insights (GitGenius)

Median issue/PR response: 0.4 hours
Mean response time: 19.3 days
90th percentile: 26.7 days
Tracked items: 58

Most active contributors

Sign in to see contributor activity.

Charts & Analytics

Fetching additional details & charts...

Issue Activity (beta)

Open issues: 8
New in 7 days: 0
Closed in 7 days: 0
Avg open age: 1,072 days
Stale 30+ days: 4
Stale 90+ days: 4

Recent activity

Opened in 7 days: 0
Closed in 7 days: 0
Comments in 7 days: 0
Events in 7 days: 0

Top labels

  • enhancement (5)
  • help wanted (4)
  • bug (1)

Most active issues this week

Sign in to see which issues are moving.

Detailed Description

pyupgrade is a tool that automatically upgrades Python syntax to match newer language versions.

The tool addresses the friction of manually updating codebases to take advantage of modern Python features. It works by parsing Python source files and rewriting them to use contemporary syntax and idioms, eliminating patterns that have been superseded by language improvements. This allows developers to adopt newer Python versions without the tedious work of identifying and refactoring each outdated construct individually. The tool integrates with pre-commit frameworks, making it straightforward to apply these upgrades as part of standard development workflows.

The tool suits projects that want to maintain compatibility with a specific minimum Python version while progressively modernizing their codebase. It is particularly valuable for libraries and frameworks that need to support multiple Python versions, as it can be configured to target a particular version floor and automatically upgrade everything that version supports. Teams should adopt it when they are ready to drop support for older Python versions and want an automated way to surface and apply the corresponding syntax improvements across their entire codebase.

The project shows consistent, focused development activity with regular updates that expand the set of syntax patterns it can upgrade. Maintenance is responsive to issues and pull requests, indicating active stewardship. The tool has accumulated a stable set of features rather than pursuing rapid expansion, suggesting the maintainer prioritizes reliability and correctness over adding marginal capabilities. Development remains concentrated on the core mission of syntax modernization without scope creep into adjacent linting or formatting concerns.