Skip to content

ScanPyImports

ScanPyImports scans directories for import statements in Python scripts and Jupyter notebooks, providing tools to summarize and visualize the import statements across your projects.

Cloud plot Spiral plot
image_name png image_name png

Features

  • Directory Scanning:
    • Recursively scans directories to locate all Python files (.py) and Jupyter notebooks (.ipynb), collecting import statements from the code.
    • Employs a set of regular expressions to find and parse import statements within the scripts.
  • Import Statement Data:
    • Organizes import data using DataFrames and conducts basic analyses.
  • Data Visualization:
    • Provides tools to visualize import data with various plotting options.
    • Currently includes spiral plots and word clouds of the import statements.

Getting started

Dependencies

ScanPyImports requires the following packages:

  • pandas
  • matplotlib
  • numpy
  • wordcloud
  • pillow
  • nbformat

Clone or download ScanPyImports

You can either:

  • download the source code here.

  • or clone the repo: git clone https://github.com/lennon-c/ScanPyImports.git

Demos, Tutorials

API

ScanPyImports

ScanPyImports

ScanPyImports is a Python package designed to scan, track, and analyze import statements across Python files and Jupyter notebooks.

Modules:

  • scan

    Handles directory scanning and the parsing of Python scripts and notebooks.

  • analyzer

    Structures the parsed data into DataFrames and performs basic data cleaning and analysis.

  • plotter

    Manages visualization tools.

The core of the package uses a set of regular expressions to parse import statements.

Regular Expressions
Yep! super Re. Attribution: xkcd.com