reorder-python-imports
« Back to VersTracker
Description:
Rewrites source to reorder python imports
Type: Formula  |  Tracked Since: Dec 28, 2025
Links: Homepage  |  formulae.brew.sh
Category: Developer tools
Tags: python linting code-quality formatter imports
Install: brew install reorder-python-imports
About:
ReorderPythonImports is a tool that rewrites Python source files to automatically sort and organize import statements according to PEP 8 standards. It groups imports by standard library, third-party packages, and local modules, while also removing unused imports. This enforces consistent import ordering across a codebase, improving readability and maintainability.
Key Features:
  • Automatically sorts imports by category (stdlib, third-party, local)
  • Removes unused imports and trailing whitespace
  • Configurable via command-line arguments and configuration files
  • Fast execution, suitable for pre-commit hooks
Use Cases:
  • Enforcing consistent import style in Python projects
  • Automated code cleanup in CI/CD pipelines
  • Pre-commit hook to maintain clean codebases
Alternatives:
  • isort – isort is a more configurable tool that offers extensive sorting options, whereas reorder-python-imports focuses on a stricter, PEP 8-compliant default behavior.
  • autoflake – autoflake primarily removes unused imports and code, while reorder-python-imports focuses on sorting and organizing the remaining imports.
Version History
Detected Version Rev Change Commit
Oct 9, 2025 10:39pm 0 VERSION_BUMP 85e2a53e
Oct 11, 2024 9:49pm 0 VERSION_BUMP 9e24c05e