refurb
Refurb is a Python linting and modernization tool that identifies outdated code patterns and suggests modern alternatives. It runs static analysis on Python codebases (3.7+) to flag issues like inefficient list comprehensions, redundant type casts, and non-idiomatic patterns.
Key facts
Objective fields from the source. Values we can't verify are shown as “Unknown” rather than guessed.
| Field | Value |
|---|---|
| Repository | dosisod/refurb |
| Owner | dosisod |
| Primary language | Python |
| License | GPL-3.0 — OSI-approved |
| Stars | 2.5k |
| Forks | 58 |
| Open issues | 31 |
| Latest release | v2.3.1 (2026-04-03) |
| Last updated | 2026-04-03 |
| Source | https://github.com/dosisod/refurb |
What refurb is
Refurb is a CLI tool built on Mypy that performs semantic analysis of Python code to detect ~150+ refactoring opportunities across readability, performance, and idiomaticity categories. It supports configuration via pyproject.toml, inline noqa directives, per-file rule overrides, and a plugin architecture for custom checks.
Get the refurb source
Clone the repository and explore it locally.
git clone https://github.com/dosisod/refurb.gitcd refurb# follow the project's README for install & configurationNeed it deployed, integrated, or customized instead? DEV.co ships production installs.
Best use cases
Implementation considerations
- GPL-3.0 license: Verify compliance with your codebase licensing model; derivative works or distribution must also be GPL-3.0 unless legal exemption applies.
- Mypy integration: Refurb wraps Mypy for type analysis; configuration and performance are tightly coupled to Mypy's behavior and flags.
- Plugin architecture: Custom checks can be loaded dynamically; vetted and tested plugins should be managed as approved dependencies.
- Check granularity: ~150+ checks are available; many are disabled by default. Configure enable/disable rules per project to avoid alert fatigue.
- Python version targeting: Use --python-version flag to match your codebase version; mismatches may cause false positives or missed detections.
When to avoid it — and what to weigh
- Strict commercial/proprietary closed-source requirement — GPL-3.0 license obligates any derivative work or distribution to also be GPL-3.0, which may conflict with proprietary licensing models.
- Need for guaranteed long-term backward compatibility — Refurb actively evolves its checks (150+ rules) and disables some by default; check additions or behavior changes across releases may require configuration tuning.
- Python < 3.10 runtime requirement for the tool itself — Refurb requires Python 3.10+ to run, even though it can analyze Python 3.7+ code. Environments locked to older Python versions cannot execute the tool.
- Zero external dependencies or air-gapped deployment — Refurb depends on Mypy and other packages; deployment requires package manager access or pre-built wheels.
License & commercial use
GPL-3.0 (GNU General Public License v3.0): Strong copyleft license requiring any distributed derivative work, modifications, or linked code to also be licensed under GPL-3.0 or compatible.
Commercial use is legally permitted under GPL-3.0, but **requires review**: if your codebase or product is proprietary/closed-source, using or modifying Refurb may trigger obligation to open-source derivative works. Consult legal counsel before integrating into proprietary CI/CD pipelines or products. Using Refurb as-is via pip install carries fewer risks than fork/modification.
DEV.co evaluation signals
Editorial assessment — not user reviews. Directional, with an explicit confidence level.
| Signal | Assessment |
|---|---|
| Maintenance | Active |
| Documentation | Strong |
| License clarity | Clear |
| Deployment complexity | Low |
| DEV.co fit | Good |
| Assessment confidence | High |
Refurb is a static analysis tool and does not execute arbitrary code. Primary risks: (1) Dependency supply chain—validate Mypy and transitive deps. (2) GPL-3.0 licensing—audit compliance before using in proprietary builds. (3) Configuration injection—ensure pyproject.toml config is trusted. No security audit or CVE history data available in provided materials.
Alternatives to consider
Pylint + custom rules
More mature, broader rule library, GPL-2.0 licensed (simpler for proprietary use). Heavier and slower, requires manual rule configuration; less focused on modernization idioms.
Black + isort + Flake8
Lightweight, permissive licenses (MIT/Apache), industry-standard combination. Covers formatting and basic style but lacks deep semantic refactoring suggestions that Refurb provides.
Ruff
Fast Rust-based linter, MIT licensed, increasingly popular. Fewer refactoring checks than Refurb; focuses on style and correctness rather than modernization patterns.
Build on refurb with DEV.co software developers
Evaluate Refurb's fit for your project. Verify GPL-3.0 compliance with legal counsel, test on a sample branch, and integrate into your CI/CD pipeline via pre-commit or GitHub Actions.
Talk to DEV.coRelated on DEV.co
Explore the category and the services that help you build with it.
refurb FAQ
Can I use Refurb in a closed-source/proprietary codebase?
What Python versions does Refurb support?
How do I quiet down false positives or irrelevant checks?
Can Refurb automatically fix the code?
Work with a software development agency
Adopting refurb is usually one piece of a larger software development effort. As a software development agency, DEV.co provides software development services and web development expertise — pairing senior software developers and web developers with your team to design, build, and operate open-source testing software in production.
Ready to modernize your Python codebase?
Evaluate Refurb's fit for your project. Verify GPL-3.0 compliance with legal counsel, test on a sample branch, and integrate into your CI/CD pipeline via pre-commit or GitHub Actions.