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
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"] }
]
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file module_inspector-0.2.0.tar.gz.
File metadata
- Download URL: module_inspector-0.2.0.tar.gz
- Upload date:
- Size: 4.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
a92e2d6d9023bb86b85fb5e3bd5c9f719ab604426387d15bb05f93d33b5ac7e0
|
|
| MD5 |
76d958d7c71339cfec2e3425e75c6eb2
|
|
| BLAKE2b-256 |
9119d820878fcbe7a4ad6281c9d8c2a80d44643dec99c64676469d256eaf9188
|
File details
Details for the file module_inspector-0.2.0-py3-none-any.whl.
File metadata
- Download URL: module_inspector-0.2.0-py3-none-any.whl
- Upload date:
- Size: 4.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
7f2aa12d6c9d3bedbb53d84a1aa11490e31c8b76083083d09332b4c74c8c888d
|
|
| MD5 |
0258cca05425da11892e1fe7426e3e47
|
|
| BLAKE2b-256 |
643a247abba0c34c87d1265cb33aea9a101d0e1aca0a264002fcb113db46994b
|