skip to navigation
skip to content

Not Logged In

autoflake 0.1.7

Removes unused imports.

Latest Version: 0.6.4

Build status

Introduction

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.

Example

Running autoflake on the below example:

$ autoflake --in-place example.py
import math
import re
import os
import random
import multiprocessing
import grp, pwd, platform
import subprocess, sys

def foo():
    if True:
        from abc import ABCMeta, WeakSet
    else:
        print(sys.version)
    return math.pi

results in

import math
import sys

def foo():
    if True:
        pass
    else:
        print(sys.version)
    return math.pi

Installation

$ pip install --upgrade autoflake
 
File Type Py Version Uploaded on Size
autoflake-0.1.7.tar.gz (md5) Source 2012-12-31 5KB
  • Downloads (All Versions):
  • 85 downloads in the last day
  • 810 downloads in the last week
  • 3910 downloads in the last month