Skip to main content

Repository scanner for module imports

Project description

Module Scan

Scans Python project for all module imports that are NOT part of Python standard library regardless of whether the package is installed or not. Since this module does not consult pip installed modules, this scan can be performed on CI.

Features

  • Scans source code repository recursively for module imports
  • Finds packages even if they are not installed (useful in automated builds with no virtual environments)
  • Lightweight scanner

Installation

  • Clone repository and run the script
  • Install using pip
$ pip install module-scan

Scan repository

$ cd <repo root>
$ module-scan

Import in your code

from module_scan import ImportScan

s = ImportScan()

# scan repository in current working directory
s.scan() 

# OR scan repository in a different location
# s.scan(<path to repository to scan>)

# Print the modules discovered
print(s._imports_found)

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

module-scan-0.0.2.tar.gz (3.5 kB view hashes)

Uploaded Source

Built Distribution

module_scan-0.0.2-py3-none-any.whl (4.0 kB view hashes)

Uploaded Python 3

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