A flake8 plugin that helps you write tidier imports.
Project description
Flake8 Tidy Imports
A flake8 plugin that helps you write tidier imports.
Free software: ISC license
Installation
Install from pip with:
pip install flake8-tidy-imports
It will then automatically be run as part of flake8; you can check it has been picked up with:
$ flake8 --version
2.4.1 (pep8: 1.7.0, pyflakes: 0.8.1, flake8-tidy-imports: 1.0.0, mccabe: 0.3.1) CPython 2.7.11 on Darwin
Rules
Currently only one rule is implemented.
I200: Unnecessary import alias
Complains about unnecessary import aliasing of three forms:
import foo as foo -> import foo
import foo.bar as bar -> from foo import bar
from foo import bar as bar -> from foo import bar
The message includes the suggested rewrite (which may not be correct at current), for example:
$ flake8 file.py
file.py:1:1: I200 Unnecessary import alias - rewrite as 'from foo import bar'.
History
Pending Release
New release notes here
1.0.0 (2016-01-23)
First release on PyPI.
I200 rule that complains about unnecessary import aliasing, e.g. from foo import bar as bar.
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 Distributions
Built Distribution
Hashes for flake8_tidy_imports-1.0.0.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 1a897d08c78410fc10346aaa08e6fd5517919a3c8e0474fdde6bae91de46c802 |
|
MD5 | a49a73989859918b2f8aaa9b1cad4dbe |
|
BLAKE2b-256 | dbb628e9bf15690ab8616782b6954c34d39947bd88c63ace341e6895e9a7e039 |
Hashes for flake8-tidy-imports-1.0.0.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | a2525053852fa5fc36f00c128d3007f2fc8b3eca9615b21cdaca539cdd9f5619 |
|
MD5 | 260b0d42e2e485cf1b3bfcd650a9b424 |
|
BLAKE2b-256 | 4fa3c38a6b3ade90955715d563c59d0b5408500625380c9539c8b232412ce713 |
Hashes for flake8_tidy_imports-1.0.0-py2.py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 5fa77864c164fdadf55be55d446c4a03b8c93ba5835ea947675cef0d570c9800 |
|
MD5 | 2c7c11961a6f53b7d058e46aa3041ae1 |
|
BLAKE2b-256 | 9df38b887f0a033e6dc5408948d4b0f6320dfbef9189ea579cd2ec1ebe35525e |