Module Inspector
A simple utility to inspect the currently imported packages, aliases, and members in the Python global namespace.
Installation
Install from pip
pip install module-inspector
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
import json
import os
import ibis
import pandas as pd
import numpy as np
from dotenv import load_dotenv
from IPython.display import Markdown, display
from openai import OpenAI
from tqdm import tqdm
import bs4
# Inspect imported modules
packages_imported = inspector.extract_imported_packages(as_json=True)
print(packages_imported)
Example Output
[
{
"module": "IPython",
"alias": null,
"members": ["Markdown", "display", "exit", "get_ipython", "quit"]
},
{ "module": "bs4", "alias": null, "members": [] },
{ "module": "dotenv", "alias": null, "members": ["load_dotenv"] },
{ "module": "ibis", "alias": null, "members": [] },
{ "module": "json", "alias": null, "members": [] },
{ "module": "module_inspector", "alias": "inspector", "members": [] },
{ "module": "numpy", "alias": "np", "members": [] },
{ "module": "openai", "alias": null, "members": ["OpenAI"] },
{ "module": "os", "alias": null, "members": [] },
{ "module": "pandas", "alias": "pd", "members": [] },
{ "module": "positron", "alias": null, "members": ["help"] },
{ "module": "tqdm", "alias": null, "members": ["tqdm"] }
]
Metadata
Release files for module-inspector 0.2.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| module_inspector-0.2.0.tar.gz | 4.3 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| module_inspector-0.2.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 8.5 kB
Release files / module_inspector-0.2.0.tar.gz
| Download URL | module_inspector-0.2.0.tar.gz |
|---|---|
| Size | 4.3 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
a92e2d6d9023bb86b85fb5e3bd5c9f719ab604426387d15bb05f93d33b5ac7e0
|
|
BLAKE2b-256 checksum How to use checksums |
9119d820878fcbe7a4ad6281c9d8c2a80d44643dec99c64676469d256eaf9188
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.12.9
|
Release files / module_inspector-0.2.0-py3-none-any.whl
| Download URL | module_inspector-0.2.0-py3-none-any.whl |
|---|---|
| Size | 4.2 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
7f2aa12d6c9d3bedbb53d84a1aa11490e31c8b76083083d09332b4c74c8c888d
|
|
BLAKE2b-256 checksum How to use checksums |
643a247abba0c34c87d1265cb33aea9a101d0e1aca0a264002fcb113db46994b
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.12.9
|