Skip to main content

Importchecker finds unused imports in Python modules.

Project description

Importchecker

What is importchecker?

Importchecker is a commandline utility to find unused imports in Python modules.

Its output is “grep-like” (and thus “emacs-friendly”), reporting both the module’s filenames and line numbers where names are imported that are not acually used in the module.

Importchecker will not modify any of the source files. Whether the import needs to be removed is left to the judgement of the developer.

Installation

The importchecker commandline utility can be installed using the easy_install command:

$ sudo easy_install importchecker

The command can then be invoked with:

$ importchecker /path/to/a/source/tree

Buildout

Projects that make use of zc.buildout for development might find the following buildout.cfg. snippet useful for using the importchecker on the developed codebase:

[buildout]
...
parts = importchecker ...
...

[importchecker]
recipe = zc.recipe.egg
eggs = importchecker
arguments = "${buildout:directory}/src"

Known issues

  • One source tree path argument at the time can be passed to the command line utility.

  • Command line argument parsing is rather naive.

Changes

1.0 (2008-05-06)

  • Initial packaging

  • Make the importchecker work on python 2.5

Credits

  • Martijn Faassen (original developer)

  • Philipp von Weitershausen

  • Jan-Wijbrand Kolman (packaging)

  • various comitters on svn.zope.org.

Download

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

importchecker-1.0.tar.gz (6.6 kB view details)

Uploaded Source

File details

Details for the file importchecker-1.0.tar.gz.

File metadata

  • Download URL: importchecker-1.0.tar.gz
  • Upload date:
  • Size: 6.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for importchecker-1.0.tar.gz
Algorithm Hash digest
SHA256 ca6190b821659f6785f7c3aeed2be9862eee34f519dc7976866b1b20680f4f4c
MD5 75889242cf9c7a131dc1e92338c21b25
BLAKE2b-256 5b81ffae9577a5086941a8936eb49feb9b39e18a0f0463ffee1eec865c1dfee4

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page