[[https://pypi.python.org/pypi/isort|isort]] can re-order/check imports according to a predefined ruleset.
It looks like it doesnt support pywikibot's complex code 'correctly', but we may be able to develop a usable ruleset with some files excluded, in which case we can enable [[https://pypi.python.org/pypi/flake8-isort|flake8-isort]], and we can use that as the basis of documentation.
It might be necessary to improve `isort` to generate imports in the desired pep8 ordering.
And it may be beneficial to improve `isort` to better match our stylistic choices, however minor changes of our style would be acceptable **when** `flake8-isort` is enabled to ensure that the result style becomes a concrete enforced coding style.
Issues raised:
[x] https://github.com/timothycrosley/isort/issues/401 - local imports before standard library
[ ] https://github.com/timothycrosley/isort/issues/419 - Windows filenames
[ ] https://github.com/timothycrosley/isort/issues/421 - try except blocks (WONTFIX)