skip to navigation
skip to content

autoflake 0.1.5

Removes unused imports.

Latest Version: 0.6.6


autoflake removes unused imports from Python code. It makes use of pyflakes to do this.

autoflake only removes unused imports for modules that are part of the standard library. (Other modules may have side effects that make them unsafe to remove automatically.)

autoflake also removes useless pass statements.


Running autoflake on the below example:

$ autoflake --in-place
import math
import re
import os
import random
import multiprocessing
import grp, pwd, platform

def foo():
    if True:
        import abc
        import subprocess
        import sys
    return math.pi

results in

import math

def foo():
    if True:
    return math.pi


$ pip install --upgrade autoflake
File Type Py Version Uploaded on Size
autoflake-0.1.5.tar.gz (md5) Source 2012-12-30 5KB
  • Downloads (All Versions):
  • 0 downloads in the last day
  • 10 downloads in the last week
  • 2269 downloads in the last month