Skip to main content

A utility package to inspect imported packages and their aliases.

Project description

Module Inspector

A simple utility to inspect the currently imported packages, aliases, and members in the Python global namespace.

Installation

Clone the repository and install it:

git clone https://github.com/ntluong95/module-inspector.git
cd module-inspector
pip install .

Usage

from module_inspector import inspector

# Inspect imported modules
packages = inspector.extract_imported_packages()
print(packages)

# As JSON
packages_json = inspector.extract_imported_packages(as_json=True)
print(packages_json)

Example Output

[
    {"module": "numpy", "alias": "np", "members": []},
    {"module": "matplotlib", "alias": None, "members": ["plot"]}
]

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_inspector-0.1.0.tar.gz (3.2 kB view details)

Uploaded Source

Built Distribution

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

module_inspector-0.1.0-py3-none-any.whl (3.4 kB view details)

Uploaded Python 3

File details

Details for the file module_inspector-0.1.0.tar.gz.

File metadata

  • Download URL: module_inspector-0.1.0.tar.gz
  • Upload date:
  • Size: 3.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for module_inspector-0.1.0.tar.gz
Algorithm Hash digest
SHA256 71efcb179ac4edcd483bd44f369e21c6aefeafa883d201320a82d672136e2577
MD5 9241f8dcdff673d5fa30e33f0e99db88
BLAKE2b-256 df8e3845db66e740af15c337b3e044150ee42d76618ccfc7b2d056859dc755f2

See more details on using hashes here.

File details

Details for the file module_inspector-0.1.0-py3-none-any.whl.

File metadata

File hashes

Hashes for module_inspector-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 4ab1e6526755b202f15d52e05bd9eb128bf9b199e340f16b7036c52cf4a248d7
MD5 a0e992831f419237fda78a83800d2632
BLAKE2b-256 2e4d66fa05d876108a1a798bad2147ba33f3c88b3da6b0e432d7263e03a55118

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