Reorder import statements in Python files
Project description
Python Fix Imports is a Python executable that can automatically reorganize the import statements of your Python script, by splitting single import statement importing several package into as many import statement as imported module (“one import, one line” principle), and sorting these import statements respecting position of group of them.
The main advantage for this method is to strictly restrict the forms of import statement and facilitate multiple code branch merges and rebase, while still allowing to specify a given order if it is the wish of the developer.
Please read the full rational online documenation for more information.
Sublime Text 3 users can use my Python Fix Imports plugin.
Example
Fix imports allows you to automatically turn:
from any_module import d, f
from other_module import z, x
from any_module import (b,
e)
from any_module import a, \
c
from a_module_that_should_be import at, after, all_others
into:
from any_module import a
from any_module import b
from any_module import c
from any_module import d
from any_module import e
from any_module import f
from other_module import x
from other_module import z
from a_module_that_should_be import after
from a_module_that_should_be import all_others
from a_module_that_should_be import at
Fiximport installation
$ pip install fiximports
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Hashes for fiximports-0.1.18-py2.py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | dafb83f981b430530bef61baf516e1e84d8cb1e202ecadb7d7988a3d0fddb875 |
|
MD5 | bd26d818874cd4a0e88aee383120a5b6 |
|
BLAKE2b-256 | 0b271e34151c88cef3bfe607e1b4b40b5f21b4513f21f4708a016e5c6061f905 |