modxpy 1.0.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- modxpy-1.0.0/PKG-INFO +115 -0
- modxpy-1.0.0/README.md +100 -0
- modxpy-1.0.0/modx/__init__.py +1 -0
- modxpy-1.0.0/modx/modx.py +297 -0
- modxpy-1.0.0/modxpy.egg-info/PKG-INFO +115 -0
- modxpy-1.0.0/modxpy.egg-info/SOURCES.txt +8 -0
- modxpy-1.0.0/modxpy.egg-info/dependency_links.txt +1 -0
- modxpy-1.0.0/modxpy.egg-info/top_level.txt +1 -0
- modxpy-1.0.0/setup.cfg +4 -0
- modxpy-1.0.0/setup.py +14 -0
modxpy-1.0.0/PKG-INFO
ADDED
|
@@ -0,0 +1,115 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: modxpy
|
|
3
|
+
Version: 1.0.0
|
|
4
|
+
Summary: ModX โ The Python Module Universe at Your Fingertips
|
|
5
|
+
Author: Austin Wang
|
|
6
|
+
Author-email: austinw87654@gmail.com
|
|
7
|
+
Requires-Python: >=3.8
|
|
8
|
+
Description-Content-Type: text/markdown
|
|
9
|
+
Dynamic: author
|
|
10
|
+
Dynamic: author-email
|
|
11
|
+
Dynamic: description
|
|
12
|
+
Dynamic: description-content-type
|
|
13
|
+
Dynamic: requires-python
|
|
14
|
+
Dynamic: summary
|
|
15
|
+
|
|
16
|
+
# ๐ ModXPy โ The Python Module Universe at Your Fingertips ๐
|
|
17
|
+
|
|
18
|
+
Welcome to **ModXPy**, the ultimate playground for Pythonโs modules.
|
|
19
|
+
With ModXPy you can instantly import, explore, and experiment with the entire Python standard library โ plus any installed third-party modules โ all from one simple interface.
|
|
20
|
+
|
|
21
|
+
---
|
|
22
|
+
|
|
23
|
+
## ๐ Installation
|
|
24
|
+
|
|
25
|
+
Install directly from PyPI:
|
|
26
|
+
|
|
27
|
+
```bash
|
|
28
|
+
pip install modxpy
|
|
29
|
+
|
|
30
|
+
In Python, import as import modx (not modxpy)
|
|
31
|
+
|
|
32
|
+
|
|
33
|
+
Functions:
|
|
34
|
+
|
|
35
|
+
|
|
36
|
+
import_all()
|
|
37
|
+
|
|
38
|
+
Imports about every standard library module at once.
|
|
39
|
+
|
|
40
|
+
๐น import_random(n)
|
|
41
|
+
|
|
42
|
+
Imports n random modules from the standard library.
|
|
43
|
+
|
|
44
|
+
๐น import_letter(letter)
|
|
45
|
+
|
|
46
|
+
Imports all standard library modules whose names start with the given letter.
|
|
47
|
+
|
|
48
|
+
๐น import_external()
|
|
49
|
+
|
|
50
|
+
Attempts to import every third-party module you currently have installed.
|
|
51
|
+
|
|
52
|
+
๐น import_screen()
|
|
53
|
+
|
|
54
|
+
Imports every module that uses a screen/GUI (like pygame or turtle).
|
|
55
|
+
|
|
56
|
+
๐น list_importall()
|
|
57
|
+
|
|
58
|
+
Returns a list of modules that would be imported by import_all().
|
|
59
|
+
|
|
60
|
+
๐น modules_loaded()
|
|
61
|
+
|
|
62
|
+
Shows how many modules you currently have downloaded on your device.
|
|
63
|
+
|
|
64
|
+
๐น imported()
|
|
65
|
+
|
|
66
|
+
Lists the modules imported since ModX loaded (user + ModX), including dependencies.
|
|
67
|
+
|
|
68
|
+
๐น modximported()
|
|
69
|
+
|
|
70
|
+
Lists the modules that were ONLY imported by ModX, NOT including user imports
|
|
71
|
+
and dependencies.
|
|
72
|
+
|
|
73
|
+
|
|
74
|
+
Example Code:
|
|
75
|
+
|
|
76
|
+
|
|
77
|
+
>>> import modx
|
|
78
|
+
>>> modx.imported()
|
|
79
|
+
Modules imported after ModX load (user + ModX):
|
|
80
|
+
Total modules imported after ModX load: 0
|
|
81
|
+
|
|
82
|
+
>>> modx.import_random(5)
|
|
83
|
+
['csv', 'wave', 'tarfile', 'turtle', 'contextlib']
|
|
84
|
+
|
|
85
|
+
>>> modx.imported()
|
|
86
|
+
Modules imported after ModX load (user + ModX):
|
|
87
|
+
- csv
|
|
88
|
+
- wave
|
|
89
|
+
- tarfile
|
|
90
|
+
- turtle
|
|
91
|
+
- contextlib
|
|
92
|
+
|
|
93
|
+
Total modules imported after ModX load: 5
|
|
94
|
+
|
|
95
|
+
|
|
96
|
+
|
|
97
|
+
๐ก Why Use ModX?
|
|
98
|
+
|
|
99
|
+
|
|
100
|
+
|
|
101
|
+
Explore the Python standard library in seconds
|
|
102
|
+
|
|
103
|
+
Stress-test your environment by bulk importing modules
|
|
104
|
+
|
|
105
|
+
See hidden dependencies that load behind the scenes
|
|
106
|
+
|
|
107
|
+
Experiment with random imports for fun or testing
|
|
108
|
+
|
|
109
|
+
Discover new modules you didnโt know existed
|
|
110
|
+
|
|
111
|
+
|
|
112
|
+
ModXPy turns Pythonโs module system into a playground โ
|
|
113
|
+
perfect for learning, testing, or just satisfying your curiosity.
|
|
114
|
+
Install it today with pip install modxpy, import it with import modx,
|
|
115
|
+
and start discovering how many modules Python already has waiting for you!
|
modxpy-1.0.0/README.md
ADDED
|
@@ -0,0 +1,100 @@
|
|
|
1
|
+
# ๐ ModXPy โ The Python Module Universe at Your Fingertips ๐
|
|
2
|
+
|
|
3
|
+
Welcome to **ModXPy**, the ultimate playground for Pythonโs modules.
|
|
4
|
+
With ModXPy you can instantly import, explore, and experiment with the entire Python standard library โ plus any installed third-party modules โ all from one simple interface.
|
|
5
|
+
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
## ๐ Installation
|
|
9
|
+
|
|
10
|
+
Install directly from PyPI:
|
|
11
|
+
|
|
12
|
+
```bash
|
|
13
|
+
pip install modxpy
|
|
14
|
+
|
|
15
|
+
In Python, import as import modx (not modxpy)
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
Functions:
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
import_all()
|
|
22
|
+
|
|
23
|
+
Imports about every standard library module at once.
|
|
24
|
+
|
|
25
|
+
๐น import_random(n)
|
|
26
|
+
|
|
27
|
+
Imports n random modules from the standard library.
|
|
28
|
+
|
|
29
|
+
๐น import_letter(letter)
|
|
30
|
+
|
|
31
|
+
Imports all standard library modules whose names start with the given letter.
|
|
32
|
+
|
|
33
|
+
๐น import_external()
|
|
34
|
+
|
|
35
|
+
Attempts to import every third-party module you currently have installed.
|
|
36
|
+
|
|
37
|
+
๐น import_screen()
|
|
38
|
+
|
|
39
|
+
Imports every module that uses a screen/GUI (like pygame or turtle).
|
|
40
|
+
|
|
41
|
+
๐น list_importall()
|
|
42
|
+
|
|
43
|
+
Returns a list of modules that would be imported by import_all().
|
|
44
|
+
|
|
45
|
+
๐น modules_loaded()
|
|
46
|
+
|
|
47
|
+
Shows how many modules you currently have downloaded on your device.
|
|
48
|
+
|
|
49
|
+
๐น imported()
|
|
50
|
+
|
|
51
|
+
Lists the modules imported since ModX loaded (user + ModX), including dependencies.
|
|
52
|
+
|
|
53
|
+
๐น modximported()
|
|
54
|
+
|
|
55
|
+
Lists the modules that were ONLY imported by ModX, NOT including user imports
|
|
56
|
+
and dependencies.
|
|
57
|
+
|
|
58
|
+
|
|
59
|
+
Example Code:
|
|
60
|
+
|
|
61
|
+
|
|
62
|
+
>>> import modx
|
|
63
|
+
>>> modx.imported()
|
|
64
|
+
Modules imported after ModX load (user + ModX):
|
|
65
|
+
Total modules imported after ModX load: 0
|
|
66
|
+
|
|
67
|
+
>>> modx.import_random(5)
|
|
68
|
+
['csv', 'wave', 'tarfile', 'turtle', 'contextlib']
|
|
69
|
+
|
|
70
|
+
>>> modx.imported()
|
|
71
|
+
Modules imported after ModX load (user + ModX):
|
|
72
|
+
- csv
|
|
73
|
+
- wave
|
|
74
|
+
- tarfile
|
|
75
|
+
- turtle
|
|
76
|
+
- contextlib
|
|
77
|
+
|
|
78
|
+
Total modules imported after ModX load: 5
|
|
79
|
+
|
|
80
|
+
|
|
81
|
+
|
|
82
|
+
๐ก Why Use ModX?
|
|
83
|
+
|
|
84
|
+
|
|
85
|
+
|
|
86
|
+
Explore the Python standard library in seconds
|
|
87
|
+
|
|
88
|
+
Stress-test your environment by bulk importing modules
|
|
89
|
+
|
|
90
|
+
See hidden dependencies that load behind the scenes
|
|
91
|
+
|
|
92
|
+
Experiment with random imports for fun or testing
|
|
93
|
+
|
|
94
|
+
Discover new modules you didnโt know existed
|
|
95
|
+
|
|
96
|
+
|
|
97
|
+
ModXPy turns Pythonโs module system into a playground โ
|
|
98
|
+
perfect for learning, testing, or just satisfying your curiosity.
|
|
99
|
+
Install it today with pip install modxpy, import it with import modx,
|
|
100
|
+
and start discovering how many modules Python already has waiting for you!
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
from .modx import *
|
|
@@ -0,0 +1,297 @@
|
|
|
1
|
+
'''modx.py: A module whose functions have to do with other modules.
|
|
2
|
+
For example: importall(), a
|
|
3
|
+
function used to import every single source-based module
|
|
4
|
+
(except for some modules, because it's popular like math, sys, etc.)
|
|
5
|
+
in Python that is supported on computer, does not print
|
|
6
|
+
out dialogue nor pop out a link when imported, and not required to be
|
|
7
|
+
downloaded seperatly with Python (such as Pygame, downloaded in Terminal).
|
|
8
|
+
|
|
9
|
+
Modules ios_support, pty, this, sre_compile, sre_parse,
|
|
10
|
+
sre_constants, tty and antigravity are left out,
|
|
11
|
+
due to ios_support not supporting computers,
|
|
12
|
+
pty and tty importing a non-existing module (termios),
|
|
13
|
+
sre_compile, sre_constants and sre_parse printing warnings,
|
|
14
|
+
this printing out "The Zen of Python" poem,
|
|
15
|
+
and antigravity popping out a web browser link.
|
|
16
|
+
|
|
17
|
+
Permission to use this module is granted to anyone wanting to use it,
|
|
18
|
+
under the following conditions: 1.) Any copies of this module must be clearly
|
|
19
|
+
marked as so. 2.) The original of this module must not be misrepresented;
|
|
20
|
+
you cannot claim this module is yours.
|
|
21
|
+
|
|
22
|
+
Note: for imported(), module idlelib will not show up as it is pre-imported
|
|
23
|
+
as soon as this module is run, leading to problems and bugs, thus idlelib
|
|
24
|
+
is not shown in imported().
|
|
25
|
+
|
|
26
|
+
Created by: Austin Wang. Created at: September 19, 2025. Version: 1.24.1'''
|
|
27
|
+
|
|
28
|
+
import sys, importlib, pkgutil, random
|
|
29
|
+
|
|
30
|
+
# Record what modules were loaded at the time modx itself was imported
|
|
31
|
+
_initial_modules = set(sys.modules.keys())
|
|
32
|
+
import builtins
|
|
33
|
+
|
|
34
|
+
# Capture original __import__ BEFORE overriding
|
|
35
|
+
_original_import = builtins.__import__
|
|
36
|
+
|
|
37
|
+
# Track modules imported manually by the user after ModX loaded
|
|
38
|
+
_user_imports = set()
|
|
39
|
+
|
|
40
|
+
def _tracking_import(name, globals=None, locals=None, fromlist=(), level=0):
|
|
41
|
+
"""
|
|
42
|
+
Non-public function: wrapper around Python's import to record user imports,
|
|
43
|
+
even if the module was already loaded.
|
|
44
|
+
"""
|
|
45
|
+
# Use the *original* import function to avoid recursion
|
|
46
|
+
mod = _original_import(name, globals, locals, fromlist, level)
|
|
47
|
+
top_name = name.split('.')[0]
|
|
48
|
+
if not name.startswith('idlelib'):
|
|
49
|
+
_user_imports.add(top_name)
|
|
50
|
+
return mod
|
|
51
|
+
|
|
52
|
+
# Install the hook immediately when ModX is imported
|
|
53
|
+
builtins.__import__ = _tracking_import
|
|
54
|
+
|
|
55
|
+
_imported_by_modx = set()
|
|
56
|
+
# Track modules at the last imported() call
|
|
57
|
+
_last_imported_snapshot = set(_initial_modules)
|
|
58
|
+
|
|
59
|
+
|
|
60
|
+
modules = [
|
|
61
|
+
'collections', 'sys', 'asyncio', 'concurrent', 'ctypes', 'dbm', 'email',
|
|
62
|
+
'encodings', 'ensurepip', 'html', 'http', 'idlelib', 'importlib', 'json', 'logging',
|
|
63
|
+
'multiprocessing', 'pathlib', 'pydoc_data', 're', 'sqlite3',
|
|
64
|
+
'sysconfig', 'test', 'tkinter', 'tomllib', 'turtledemo', 'unittest', 'urllib',
|
|
65
|
+
'venv', 'wsgiref', 'xml', 'xmlrpc', 'zipfile', 'zoneinfo', '_aix_support',
|
|
66
|
+
'_android_support', '_pyrepl', '_apple_support', '_collections_abc', '_colorize',
|
|
67
|
+
'_compat_pickle', '_compression', '_markupbase', '_opcode_metadata', '_osx_support',
|
|
68
|
+
'_py_abc', '_pydatetime', '_pydecimal', '_pyio', '_pylong', '_sitebuiltins', '_strptime',
|
|
69
|
+
'_threading_local', '_weakrefset', 'abc', 'argparse', 'ast', 'base64', 'bdb',
|
|
70
|
+
'bisect', 'bz2', 'calendar', 'cmd', 'codecs', 'codeop', 'colorsys', 'compileall', 'configparser',
|
|
71
|
+
'contextlib', 'contextvars', 'copy', 'copyreg', 'cProfile', 'csv', 'dataclasses', 'datetime',
|
|
72
|
+
'decimal', 'difflib', 'dis', 'doctest', 'enum', 'filecmp', 'fileinput', 'fnmatch', 'fractions',
|
|
73
|
+
'ftplib', 'functools', 'genericpath', 'getopt', 'getpass', 'gettext', 'glob', 'graphlib',
|
|
74
|
+
'gzip', 'hashlib', 'heapq', 'hmac', 'imaplib', 'inspect', 'io', 'ipaddress', 'keyword', 'linecache',
|
|
75
|
+
'locale', 'lzma', 'math', 'mailbox', 'mimetypes', 'modulefinder', 'netrc', 'ntpath', 'nturl2path',
|
|
76
|
+
'numbers', 'opcode', 'operator', 'optparse', 'os', 'pdb', 'pickle', 'pickletools', 'pkgutil',
|
|
77
|
+
'platform', 'plistlib', 'poplib', 'posixpath', 'pprint', 'profile', 'pstats', 'py_compile',
|
|
78
|
+
'pyclbr', 'pydoc', 'queue', 'quopri', 'random', 'reprlib', 'rlcompleter', 'runpy', 'sched', 'secrets',
|
|
79
|
+
'selectors', 'shelve', 'shlex', 'shutil', 'signal', 'site', 'smtplib', 'socket', 'socketserver',
|
|
80
|
+
'ssl', 'stat', 'statistics', 'string', 'stringprep',
|
|
81
|
+
'struct', 'subprocess', 'symtable', 'tabnanny', 'tarfile', 'tempfile', 'textwrap',
|
|
82
|
+
'threading', 'timeit', 'token', 'tokenize', 'trace', 'traceback', 'tracemalloc', 'turtle',
|
|
83
|
+
'types', 'typing', 'uuid', 'warnings', 'wave', 'weakref', 'webbrowser', 'zipapp', 'zipimport',
|
|
84
|
+
'__future__', '__hello__', '__phello__', "atexit", "mmap"
|
|
85
|
+
]
|
|
86
|
+
|
|
87
|
+
|
|
88
|
+
def import_all():
|
|
89
|
+
"""Import about every module in Python
|
|
90
|
+
that is given when downloading Python."""
|
|
91
|
+
for m in modules:
|
|
92
|
+
try:
|
|
93
|
+
globals()[m] = importlib.import_module(m)
|
|
94
|
+
_imported_by_modx.add(m.split('.')[0])
|
|
95
|
+
except Exception:
|
|
96
|
+
pass
|
|
97
|
+
|
|
98
|
+
def list_importall():
|
|
99
|
+
"""Return the list of modules that import_all() will """
|
|
100
|
+
return modules
|
|
101
|
+
|
|
102
|
+
def modules_loaded():
|
|
103
|
+
"""Shows how many modules are currently loaded in sys.modules."""
|
|
104
|
+
return len(sys.modules)
|
|
105
|
+
|
|
106
|
+
def import_random(n):
|
|
107
|
+
"""Import n random stdlib modules and track them."""
|
|
108
|
+
chosen = random.sample(modules, min(n, len(modules)))
|
|
109
|
+
for m in chosen:
|
|
110
|
+
try:
|
|
111
|
+
globals()[m] = importlib.import_module(m)
|
|
112
|
+
_imported_by_modx.add(m.split('.')[0]) # track top-level name
|
|
113
|
+
except Exception:
|
|
114
|
+
pass
|
|
115
|
+
return chosen
|
|
116
|
+
|
|
117
|
+
def import_external():
|
|
118
|
+
"""Import all installed third-party
|
|
119
|
+
modules (anything not in stdlib list)."""
|
|
120
|
+
stdlib_set = set(modules) | set(sys.builtin_module_names)
|
|
121
|
+
for finder, name, ispkg in pkgutil.iter_modules():
|
|
122
|
+
if name not in stdlib_set:
|
|
123
|
+
try:
|
|
124
|
+
globals()[name] = importlib.import_module(name)
|
|
125
|
+
_imported_by_modx.add(name.split('.')[0])
|
|
126
|
+
except Exception:
|
|
127
|
+
pass
|
|
128
|
+
|
|
129
|
+
def import_screen():
|
|
130
|
+
"""Import common screen/GUI/game
|
|
131
|
+
modules if available."""
|
|
132
|
+
screen_modules = ['pygame', 'pyglet', 'arcade', 'tkinter', 'turtle']
|
|
133
|
+
for m in screen_modules:
|
|
134
|
+
try:
|
|
135
|
+
globals()[m] = importlib.import_module(m)
|
|
136
|
+
_imported_by_modx.add(m.split('.')[0])
|
|
137
|
+
except ImportError:
|
|
138
|
+
pass
|
|
139
|
+
|
|
140
|
+
def imported():
|
|
141
|
+
"""
|
|
142
|
+
Show all modules imported since ModX loaded:
|
|
143
|
+
imported by user, modx or modules imported
|
|
144
|
+
by other imported modules. This counts imports
|
|
145
|
+
even if the module was already loaded before ModX started.
|
|
146
|
+
"""
|
|
147
|
+
# Union of user imports and ModX imports
|
|
148
|
+
all_new = _user_imports | _imported_by_modx
|
|
149
|
+
|
|
150
|
+
all_new_sorted = sorted(all_new)
|
|
151
|
+
print("Modules imported after ModX load (user, ModX and dependencies):")
|
|
152
|
+
for name in all_new_sorted:
|
|
153
|
+
print("-", name)
|
|
154
|
+
print(f"\nTotal modules imported after ModX load: {len(all_new_sorted)}")
|
|
155
|
+
|
|
156
|
+
def modximported():
|
|
157
|
+
"""
|
|
158
|
+
Show only the modules imported via ModX functions
|
|
159
|
+
(import_all, import_random, import_external, import_screen),
|
|
160
|
+
plus a total count.
|
|
161
|
+
"""
|
|
162
|
+
top_level_sorted = sorted(_imported_by_modx)
|
|
163
|
+
print("Modules imported via ModX:")
|
|
164
|
+
for name in top_level_sorted:
|
|
165
|
+
print("-", name)
|
|
166
|
+
print(f"\nTotal modules imported via ModX: {len(top_level_sorted)}")
|
|
167
|
+
|
|
168
|
+
def import_letter(letter):
|
|
169
|
+
"""
|
|
170
|
+
Import every standard library module from the ModX 'modules' list
|
|
171
|
+
whose name starts with the given letter (case-insensitive).
|
|
172
|
+
|
|
173
|
+
Example:
|
|
174
|
+
import_letter('t') # imports turtle, tkinter, tarfile, etc.
|
|
175
|
+
"""
|
|
176
|
+
letter = letter.lower()
|
|
177
|
+
imported_list = []
|
|
178
|
+
|
|
179
|
+
for m in modules:
|
|
180
|
+
if m.lower().startswith(letter):
|
|
181
|
+
try:
|
|
182
|
+
globals()[m] = importlib.import_module(m)
|
|
183
|
+
_imported_by_modx.add(m.split('.')[0]) # track it
|
|
184
|
+
imported_list.append(m)
|
|
185
|
+
except Exception:
|
|
186
|
+
pass # skip modules that can't be imported
|
|
187
|
+
|
|
188
|
+
return imported_list
|
|
189
|
+
|
|
190
|
+
def search_modules(keyword):
|
|
191
|
+
"""
|
|
192
|
+
Search for modules whose names or docstrings contain the keyword.
|
|
193
|
+
"""
|
|
194
|
+
keyword = keyword.lower()
|
|
195
|
+
matches = []
|
|
196
|
+
for m in modules:
|
|
197
|
+
if keyword in m.lower():
|
|
198
|
+
matches.append(m)
|
|
199
|
+
else:
|
|
200
|
+
try:
|
|
201
|
+
mod = importlib.import_module(m)
|
|
202
|
+
if mod.__doc__ and keyword in mod.__doc__.lower():
|
|
203
|
+
matches.append(m)
|
|
204
|
+
except Exception:
|
|
205
|
+
pass
|
|
206
|
+
return matches
|
|
207
|
+
|
|
208
|
+
|
|
209
|
+
def info(module_name):
|
|
210
|
+
"""
|
|
211
|
+
Show basic info about a module: file path, built-in status, docstring.
|
|
212
|
+
"""
|
|
213
|
+
import sys, inspect
|
|
214
|
+
if module_name in sys.modules:
|
|
215
|
+
mod = sys.modules[module_name]
|
|
216
|
+
else:
|
|
217
|
+
try:
|
|
218
|
+
mod = importlib.import_module(module_name)
|
|
219
|
+
except ImportError:
|
|
220
|
+
print(f"Module '{module_name}' not found.")
|
|
221
|
+
return
|
|
222
|
+
path = getattr(mod, '__file__', '(built-in)')
|
|
223
|
+
doc = (inspect.getdoc(mod) or '').splitlines()[0:3]
|
|
224
|
+
print(f"Module: {module_name}")
|
|
225
|
+
print(f"Path: {path}")
|
|
226
|
+
print("Docstring:")
|
|
227
|
+
for line in doc:
|
|
228
|
+
print(line)
|
|
229
|
+
|
|
230
|
+
|
|
231
|
+
|
|
232
|
+
def modxhelp():
|
|
233
|
+
"""
|
|
234
|
+
Show full ModX help including all functions and example usage.
|
|
235
|
+
"""
|
|
236
|
+
help_text = """
|
|
237
|
+
ModX โ The Python Module Universe
|
|
238
|
+
=================================
|
|
239
|
+
|
|
240
|
+
Functions:
|
|
241
|
+
----------
|
|
242
|
+
|
|
243
|
+
import_all()
|
|
244
|
+
Import almost every standard library module at once.
|
|
245
|
+
Example: modx.import_all()
|
|
246
|
+
|
|
247
|
+
import_external()
|
|
248
|
+
Import all installed third-party modules.
|
|
249
|
+
Example: modx.import_external()
|
|
250
|
+
|
|
251
|
+
import_screen()
|
|
252
|
+
Import common screen/GUI/game modules if available (pygame, turtle, tkinter, etc.).
|
|
253
|
+
Example: modx.import_screen()
|
|
254
|
+
|
|
255
|
+
import_letter(letter)
|
|
256
|
+
Import every standard library module starting with a given letter.
|
|
257
|
+
Example: modx.import_letter('t')
|
|
258
|
+
|
|
259
|
+
import_random(n)
|
|
260
|
+
Import n random standard library modules.
|
|
261
|
+
Example: modx.import_random(5)
|
|
262
|
+
|
|
263
|
+
list_importall()
|
|
264
|
+
Return a list of modules that import_all() would load.
|
|
265
|
+
Example: modx.list_importall()
|
|
266
|
+
|
|
267
|
+
modules_loaded()
|
|
268
|
+
Show how many top-level modules are currently loaded.
|
|
269
|
+
Example: modx.modules_loaded()
|
|
270
|
+
|
|
271
|
+
imported()
|
|
272
|
+
Show ALL modules currently loaded in Python (top-level only).
|
|
273
|
+
Example: modx.imported()
|
|
274
|
+
|
|
275
|
+
modximported()
|
|
276
|
+
Show only the modules imported via ModX functions.
|
|
277
|
+
Example: modx.modximported()
|
|
278
|
+
|
|
279
|
+
info(module_name)
|
|
280
|
+
Show information (path + docstring snippet) about a module.
|
|
281
|
+
Example: modx.info('random')
|
|
282
|
+
|
|
283
|
+
search_modules(keyword)
|
|
284
|
+
Search the stdlib modules list for names or docstrings containing a keyword.
|
|
285
|
+
Example: modx.search_modules('html')
|
|
286
|
+
|
|
287
|
+
modxhelp()
|
|
288
|
+
Show this help screen.
|
|
289
|
+
Example: modx.modxhelp()
|
|
290
|
+
|
|
291
|
+
Tips:
|
|
292
|
+
-----
|
|
293
|
+
- Use imported() to see *everything* loaded after Python started.
|
|
294
|
+
- Use modximported() to see only what ModX loaded.
|
|
295
|
+
- You can combine functions, e.g. modx.import_all() then modx.imported().
|
|
296
|
+
"""
|
|
297
|
+
print(help_text)
|
|
@@ -0,0 +1,115 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: modxpy
|
|
3
|
+
Version: 1.0.0
|
|
4
|
+
Summary: ModX โ The Python Module Universe at Your Fingertips
|
|
5
|
+
Author: Austin Wang
|
|
6
|
+
Author-email: austinw87654@gmail.com
|
|
7
|
+
Requires-Python: >=3.8
|
|
8
|
+
Description-Content-Type: text/markdown
|
|
9
|
+
Dynamic: author
|
|
10
|
+
Dynamic: author-email
|
|
11
|
+
Dynamic: description
|
|
12
|
+
Dynamic: description-content-type
|
|
13
|
+
Dynamic: requires-python
|
|
14
|
+
Dynamic: summary
|
|
15
|
+
|
|
16
|
+
# ๐ ModXPy โ The Python Module Universe at Your Fingertips ๐
|
|
17
|
+
|
|
18
|
+
Welcome to **ModXPy**, the ultimate playground for Pythonโs modules.
|
|
19
|
+
With ModXPy you can instantly import, explore, and experiment with the entire Python standard library โ plus any installed third-party modules โ all from one simple interface.
|
|
20
|
+
|
|
21
|
+
---
|
|
22
|
+
|
|
23
|
+
## ๐ Installation
|
|
24
|
+
|
|
25
|
+
Install directly from PyPI:
|
|
26
|
+
|
|
27
|
+
```bash
|
|
28
|
+
pip install modxpy
|
|
29
|
+
|
|
30
|
+
In Python, import as import modx (not modxpy)
|
|
31
|
+
|
|
32
|
+
|
|
33
|
+
Functions:
|
|
34
|
+
|
|
35
|
+
|
|
36
|
+
import_all()
|
|
37
|
+
|
|
38
|
+
Imports about every standard library module at once.
|
|
39
|
+
|
|
40
|
+
๐น import_random(n)
|
|
41
|
+
|
|
42
|
+
Imports n random modules from the standard library.
|
|
43
|
+
|
|
44
|
+
๐น import_letter(letter)
|
|
45
|
+
|
|
46
|
+
Imports all standard library modules whose names start with the given letter.
|
|
47
|
+
|
|
48
|
+
๐น import_external()
|
|
49
|
+
|
|
50
|
+
Attempts to import every third-party module you currently have installed.
|
|
51
|
+
|
|
52
|
+
๐น import_screen()
|
|
53
|
+
|
|
54
|
+
Imports every module that uses a screen/GUI (like pygame or turtle).
|
|
55
|
+
|
|
56
|
+
๐น list_importall()
|
|
57
|
+
|
|
58
|
+
Returns a list of modules that would be imported by import_all().
|
|
59
|
+
|
|
60
|
+
๐น modules_loaded()
|
|
61
|
+
|
|
62
|
+
Shows how many modules you currently have downloaded on your device.
|
|
63
|
+
|
|
64
|
+
๐น imported()
|
|
65
|
+
|
|
66
|
+
Lists the modules imported since ModX loaded (user + ModX), including dependencies.
|
|
67
|
+
|
|
68
|
+
๐น modximported()
|
|
69
|
+
|
|
70
|
+
Lists the modules that were ONLY imported by ModX, NOT including user imports
|
|
71
|
+
and dependencies.
|
|
72
|
+
|
|
73
|
+
|
|
74
|
+
Example Code:
|
|
75
|
+
|
|
76
|
+
|
|
77
|
+
>>> import modx
|
|
78
|
+
>>> modx.imported()
|
|
79
|
+
Modules imported after ModX load (user + ModX):
|
|
80
|
+
Total modules imported after ModX load: 0
|
|
81
|
+
|
|
82
|
+
>>> modx.import_random(5)
|
|
83
|
+
['csv', 'wave', 'tarfile', 'turtle', 'contextlib']
|
|
84
|
+
|
|
85
|
+
>>> modx.imported()
|
|
86
|
+
Modules imported after ModX load (user + ModX):
|
|
87
|
+
- csv
|
|
88
|
+
- wave
|
|
89
|
+
- tarfile
|
|
90
|
+
- turtle
|
|
91
|
+
- contextlib
|
|
92
|
+
|
|
93
|
+
Total modules imported after ModX load: 5
|
|
94
|
+
|
|
95
|
+
|
|
96
|
+
|
|
97
|
+
๐ก Why Use ModX?
|
|
98
|
+
|
|
99
|
+
|
|
100
|
+
|
|
101
|
+
Explore the Python standard library in seconds
|
|
102
|
+
|
|
103
|
+
Stress-test your environment by bulk importing modules
|
|
104
|
+
|
|
105
|
+
See hidden dependencies that load behind the scenes
|
|
106
|
+
|
|
107
|
+
Experiment with random imports for fun or testing
|
|
108
|
+
|
|
109
|
+
Discover new modules you didnโt know existed
|
|
110
|
+
|
|
111
|
+
|
|
112
|
+
ModXPy turns Pythonโs module system into a playground โ
|
|
113
|
+
perfect for learning, testing, or just satisfying your curiosity.
|
|
114
|
+
Install it today with pip install modxpy, import it with import modx,
|
|
115
|
+
and start discovering how many modules Python already has waiting for you!
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
modx
|
modxpy-1.0.0/setup.cfg
ADDED
modxpy-1.0.0/setup.py
ADDED
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
from setuptools import setup, find_packages
|
|
2
|
+
|
|
3
|
+
setup(
|
|
4
|
+
name='modxpy',
|
|
5
|
+
version='1.0.0',
|
|
6
|
+
description='ModX โ The Python Module Universe at Your Fingertips',
|
|
7
|
+
long_description=open('README.md', encoding='utf-8').read(),
|
|
8
|
+
long_description_content_type='text/markdown',
|
|
9
|
+
author='Austin Wang',
|
|
10
|
+
author_email='austinw87654@gmail.com',
|
|
11
|
+
packages=find_packages(),
|
|
12
|
+
include_package_data=True,
|
|
13
|
+
python_requires='>=3.8',
|
|
14
|
+
)
|