Skip to main content

Python module import analysis tool

Project description

FindImports

FindImports extracts Python module dependencies by parsing source files. It can report names that are imported but not used, and it can generate module import graphs in ASCII or graphviz formats.

A distinguishing feature of findimports used to be that it could parse doctest code inside docstrings.

Note that not all cases are handled correctly, especially if you use ‘import foo.bar.baz’.

If you need to find unused imports in your codebase, I recommend Pyflakes instead – it’s better maintained and more reliable. For import graphs consider pydeps or snakefood.

Misc

Home page: https://github.com/mgedmin/findimports

Licence: GPL v2 or v3 (https://www.gnu.org/copyleft/gpl.html)

buildstatus appveyor coverage

Changes

2.2.0 (2021-12-16)

  • Add support for Python 3.10.

  • Add --ignore-stdlib flag to ignore modules from the Python standard library.

2.1.0 (2021-05-16)

  • Add --ignore flag to ignore files and directories, it can be used multiple times. See pull request #14.

2.0.0 (2021-05-09)

  • Add support for Python 3.9.

  • Drop support for Python 3.5 and 2.7

  • Fix a bug where the encoding of Python files was not determined in the same way as by Python itself. See issue 15. This requires the use of tokenize.open which is not in Python 2.7.

1.5.2 (2019-10-31)

  • Add support for Python 3.8.

  • Fix a bug where a package/module with a name that is a prefix of another package/module might accidentally be used instead of the other one (e.g. py instead of pylab). See issue 10.

1.5.1 (2019-04-23)

  • Drop support for Python 3.4.

1.5.0 (2019-03-18)

  • Support Python 3.6 and 3.7.

  • Drop support for Python 2.6 and 3.3.

  • Suppress duplicate import warnings if the line in question has a comment.

1.4.1 (2016-09-28)

  • Replace getopt with optparse. This changes the --help message as a side effect (#4).

1.4.0 (2015-06-04)

  • Python 3 support (3.3 and newer).

  • Use ast instead of compiler (#1).

1.3.2 (2015-04-13)

  • Fix “cannot find datetime” on Ubuntu 14.04 LTS (#3).

  • 100% test coverage.

1.3.1 (2014-04-16)

  • Added support for relative imports (e.g. from .. import foo).

1.3.0 (2013-04-10)

  • Moved to Github.

  • Drop Python 2.4 and 2.5 support.

  • Handle unicode docstrings with doctests.

1.2.14 (2012-02-12)

1.2.13 (2011-04-18)

  • Suppress “not a zipfile” warnings about *.egg-info files listed in sys.path.

1.2.12 (2011-04-08)

  • Handle zipfile errors when there are plain files that are not zip files on sys.path.

1.2.11 (2011-03-30)

  • Fix ‘could not find cPickle’ errors on Python 2.6 and newer.

1.2.10 (2010-02-05)

  • Ignore ‘from __future__ import …’.

1.2.9 (2009-07-07)

  • Fixed broken and uninstallable source distribution by adding a MANIFEST.in.

1.2.8 (2009-07-07)

  • Is able to find modules inside zip files (e.g. eggs).

  • Fixed deprecation warning on Python 2.6.

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

findimports-2.2.0.tar.gz (39.1 kB view details)

Uploaded Source

Built Distribution

findimports-2.2.0-py2.py3-none-any.whl (25.9 kB view details)

Uploaded Python 2 Python 3

File details

Details for the file findimports-2.2.0.tar.gz.

File metadata

  • Download URL: findimports-2.2.0.tar.gz
  • Upload date:
  • Size: 39.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.2 importlib_metadata/4.0.1 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.60.0 CPython/3.9.7

File hashes

Hashes for findimports-2.2.0.tar.gz
Algorithm Hash digest
SHA256 d47a1303e35095017c5e1da15305ae799510e72a1094101afed0c6f31a4e57cd
MD5 ad72a2ef8a5bb3004d47d85bf55bdaac
BLAKE2b-256 543dbcb5e0f8db3696b3e71a90e1e4cdad12bdc4804b49396d283864cbd8eba2

See more details on using hashes here.

File details

Details for the file findimports-2.2.0-py2.py3-none-any.whl.

File metadata

  • Download URL: findimports-2.2.0-py2.py3-none-any.whl
  • Upload date:
  • Size: 25.9 kB
  • Tags: Python 2, Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.2 importlib_metadata/4.0.1 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.60.0 CPython/3.9.7

File hashes

Hashes for findimports-2.2.0-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 446dbc64546efb46d778e789a61dc9d3e26e0eb04a5370a5f232225bbac30c76
MD5 79e71a23a1c5a16c0b8ef6b79403b5b4
BLAKE2b-256 64e393d795382761ce296029c8a368973852a5d282e6aca39061e9d7103047f4

See more details on using hashes here.

Supported by

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