A Tool for automatically reordering python imports
reorder_python_imports
Rewrites source to reorder python imports.
Tool for automatically reordering python imports. Similar to isort but uses static analysis more.
Installation
pip install reorder-python-imports
Console scripts
Consult reorder-python-imports --help
for the full set of options.
reorder-python-imports
takes filenames as positional arguments
Common options:
--py##-plus
: see below.--add-import
/--remove-import
: see below.--replace-import
: see below.--application-directories
: by default,reorder-python-imports
assumes
your project is rooted at.
. If this isn’t true, tell it where your
import roots live. For example, when using the popular./src
layout you’d
use--application-directories=.:src
(note: multiple paths are separated
using a:
).--unclassifiable-application-module
: (may be specified multiple times)
modules names that are considered application modules. this setting is
intended to be used for things like C modules which may not always appear on
the filesystem.
As