Skip to main content

CLI tool to list and classify Python imports in a project.

Project description

🧠 importscanner

A lightweight CLI tool to list and classify Python imports: standard library, pip-installed (third-party), and local modules.


🎞️ Features

  • 📚 Categorizes Python imports:

    • ✅ Standard Library modules
    • ✅ Third-party packages installed via pip
    • ✅ Your project's local modules
  • ✍️ Optionally generates a requirements.txt

  • 🦢 Works on any Python-based project or codebase

  • 🧫 Graceful handling of broken files, bad syntax, and missing packages

  • 📄 Optional logging to importscanner.log


🚀 Installation

From PyPI (recommended):

pip install importscanner

From source (GitHub):

git clone https://github.com/harshmeet-1029/importscanner.git
cd importscanner
pip install .

💻 Usage

Once installed, the CLI command is available as:

list-imports [directory] [--save] [--log]

🧪 Examples

▶️ Basic usage (scan current directory):

list-imports

📂 Scan a specific folder:

list-imports ./src

📆 Save third-party packages to requirements.txt:

list-imports ./project --save

�� Enable log file output to importscanner.log:

list-imports --log

📦 Combine all options:

list-imports ./backend --save --log

📂 Output Format

📦 Third-Party Packages (installed via pip):
  - requests
  - flask

📁 Local Modules (your own project's files/modules):
  - myutils
  - handlers

📚 Standard Library (built-in Python modules):
  - os
  - sys
  - json

📝 Notes

  • Uses the stdlib_list package to detect standard library modules.
  • Gracefully skips unreadable or invalid .py files.
  • Supports Python 3.8+

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

py_import_scanner-0.1.1.tar.gz (5.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

py_import_scanner-0.1.1-py3-none-any.whl (5.8 kB view details)

Uploaded Python 3

File details

Details for the file py_import_scanner-0.1.1.tar.gz.

File metadata

  • Download URL: py_import_scanner-0.1.1.tar.gz
  • Upload date:
  • Size: 5.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.3

File hashes

Hashes for py_import_scanner-0.1.1.tar.gz
Algorithm Hash digest
SHA256 756a07e8904e3c463062d494b4b85c6a8aa4e3052c86bcd20cfc52467653612b
MD5 214d229e202e07b0029bac99435d5e08
BLAKE2b-256 e1e09b09609013b1a45f7b34d320999be71f03c9434ab19a5d3827f9c616bd72

See more details on using hashes here.

File details

Details for the file py_import_scanner-0.1.1-py3-none-any.whl.

File metadata

File hashes

Hashes for py_import_scanner-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 6e65eb07d57d6ce8c7d11fd36c06d7605ab4bd277ff3ef91d6430338c6ad9aa6
MD5 4f14c9ea9a8f53dc5f2062559cde2231
BLAKE2b-256 f4626f69f49bcd7112c452df38c034c82b449a29cd76b0fb7131e59b7d8b8046

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