NXUI 0.1.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.
nxui-0.1.0/LICENSE.txt ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Paras Tech Industries
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
nxui-0.1.0/MANIFEST.in ADDED
@@ -0,0 +1,26 @@
1
+ Include documentation and licensing
2
+
3
+ include LICENSE
4
+ include README.md
5
+ include pyproject.toml
6
+ include setup.py
7
+
8
+
9
+ Include package core files
10
+
11
+ include Main.py
12
+ include init.py
13
+
14
+ Include all Python source files recursively if organized in subdirectories
15
+
16
+ recursive-include . *.py
17
+
18
+ Exclude generated UI files, temporary caches, and environment artifacts
19
+
20
+ global-exclude *.py[cod]
21
+ global-exclude pycache
22
+ global-exclude *.so
23
+ global-exclude .DS_Store
24
+ exclude App.py
25
+ exclude ResultApp.py
26
+ exclude Main.py.bak
@@ -0,0 +1,40 @@
1
+ Metadata-Version: 2.4
2
+ Name: NXUI
3
+ Version: 0.1.0
4
+ Summary: AI-powered declarative UI framework for Python by Paras Tech Industries.
5
+ Home-page: https://www.Parastechgroups,in
6
+ Author: Paras Tech Industries
7
+ Author-email: parastechindustrieshelp@Gmail.com
8
+ License: MIT
9
+ Requires-Python: >=3.9
10
+ Description-Content-Type: text/markdown
11
+ License-File: LICENSE.txt
12
+ Requires-Dist: requests>=2.28.0
13
+ Dynamic: author-email
14
+ Dynamic: home-page
15
+ Dynamic: license-file
16
+ Dynamic: requires-python
17
+
18
+ NXUI
19
+
20
+ Effortless, Prompt-Driven Python UI Generation
21
+
22
+ Developed & Maintained by Paras Tech Industries
23
+
24
+ NXUI simplifies Python desktop GUI creation by translating natural-language design prompts into complete, modern, executable applications (using CustomTkinter / Tkinter). It automatically resolves dependencies via pip and launches your newly created interface instantly.
25
+
26
+ Key Features
27
+
28
+ Prompt-Based UI Generation: Describe your desired layout, theme, widgets, and behavior in plain text inside <UI.start> and <UI.end> blocks.
29
+
30
+ Embedded Engine: Pre-wired with AI model integration—no mandatory manual API setup required for default usage.
31
+
32
+ Automatic Dependency Resolution: Inspects the generated script's imports using AST and installs missing packages via pip before running.
33
+
34
+ Instant Execution (Auto-Run): Directly launches the generated UI script upon generation.
35
+
36
+ Customizable Output: Choose target output files, window titles, and theme styling (dark/light).
37
+
38
+ Installation
39
+
40
+ Pip install NXui
@@ -0,0 +1,16 @@
1
+ LICENSE.txt
2
+ MANIFEST.in
3
+ README.md
4
+ Setup.py
5
+ pyproject.toml
6
+ setup.py
7
+ ./Setup.py
8
+ ./NXui/__init__.py
9
+ ./NXui/main.py
10
+ NXUI.egg-info/PKG-INFO
11
+ NXUI.egg-info/SOURCES.txt
12
+ NXUI.egg-info/dependency_links.txt
13
+ NXUI.egg-info/requires.txt
14
+ NXUI.egg-info/top_level.txt
15
+ NXui/__init__.py
16
+ NXui/main.py
@@ -0,0 +1 @@
1
+ requests>=2.28.0
@@ -0,0 +1,2 @@
1
+ Main
2
+ NXui
@@ -0,0 +1,9 @@
1
+ """
2
+ NXui - AI-Powered Declarative UI Framework
3
+ """
4
+
5
+ from .main import Set, AI, onlineUI
6
+
7
+ __author__ = "Paras Tech Industries"
8
+ __version__ = "0.1.0"
9
+ __all__ = ["Set", "AI", "onlineUI"]
@@ -0,0 +1,170 @@
1
+ """
2
+ NXui: AI-Powered UI Framework
3
+ Author: Paras Tech Industries
4
+ Main Engine File: Main.py
5
+ """
6
+
7
+ import ast
8
+ import os
9
+ import re
10
+ import subprocess
11
+ import sys
12
+ import requests
13
+
14
+
15
+ # Default OpenRouter configuration embedded in Main.py
16
+ DEFAULT_API_KEY = "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"
17
+ DEFAULT_MODEL = "openai/gpt-oss-120b"
18
+
19
+
20
+ class _WindowConfig:
21
+ def __init__(self):
22
+ self.Tittle = "NXUI App"
23
+ self.theme = "dark"
24
+
25
+
26
+ class Set:
27
+ Window = _WindowConfig()
28
+
29
+
30
+ class _GenConfig:
31
+ def __init__(self):
32
+ self.file = "App.py" # Output target for generated UI
33
+ self.autorun = True # Automatically launch when done
34
+
35
+
36
+ class _AIEngine:
37
+ def __init__(self):
38
+ self.prompt = ""
39
+ self.Gen = _GenConfig()
40
+ # Direct built-in defaults
41
+ self.model = DEFAULT_MODEL
42
+ self.api_key = DEFAULT_API_KEY
43
+
44
+ def UI(self, prompt_text: str):
45
+ """Captures prompt between <UI.start> and <UI.end> tags."""
46
+ cleaned = re.sub(r'<\/?UI\.(start|end)>', '', prompt_text).strip()
47
+ self.prompt = cleaned
48
+ return self
49
+
50
+ def _extract_imported_modules(self, code_str: str) -> set[str]:
51
+ """Scans code using AST to find all library imports."""
52
+ modules = set()
53
+ try:
54
+ tree = ast.parse(code_str)
55
+ for node in ast.walk(tree):
56
+ if isinstance(node, ast.Import):
57
+ for alias in node.names:
58
+ modules.add(alias.name.split('.')[0])
59
+ elif isinstance(node, ast.ImportFrom):
60
+ if node.module:
61
+ modules.add(node.module.split('.')[0])
62
+ except SyntaxError:
63
+ pass
64
+ return modules
65
+
66
+ def _auto_install_missing_modules(self, code_str: str):
67
+ """Detects and installs uninstalled non-standard libraries."""
68
+ imported = self._extract_imported_modules(code_str)
69
+
70
+ stdlib = getattr(sys, "stdlib_module_names", {
71
+ "tkinter", "math", "os", "sys", "json", "time", "random",
72
+ "datetime", "threading", "re", "functools", "typing"
73
+ })
74
+
75
+ package_map = {
76
+ "cv2": "opencv-python",
77
+ "PIL": "pillow",
78
+ "sklearn": "scikit-learn",
79
+ "yaml": "pyyaml"
80
+ }
81
+
82
+ packages_to_install = []
83
+ for mod in imported:
84
+ if mod not in stdlib:
85
+ try:
86
+ __import__(mod)
87
+ except ImportError:
88
+ pip_name = package_map.get(mod, mod)
89
+ packages_to_install.append(pip_name)
90
+
91
+ if packages_to_install:
92
+ print(f"[NXui] Installing required libraries: {', '.join(packages_to_install)}...")
93
+ for pkg in packages_to_install:
94
+ try:
95
+ subprocess.check_call([sys.executable, "-m", "pip", "install", pkg])
96
+ print(f"[NXui] Successfully installed {pkg}")
97
+ except subprocess.CalledProcessError:
98
+ print(f"[NXui] Warning: Could not install {pkg}. Manual install may be required.")
99
+ else:
100
+ print("[NXui] All dependencies are ready.")
101
+
102
+ def _run_script(self, target_file: str):
103
+ """Launches the generated UI script."""
104
+ print(f"[NXui] Launching '{target_file}'...\n" + "=" * 45)
105
+ try:
106
+ subprocess.run([sys.executable, target_file], check=True)
107
+ except subprocess.CalledProcessError as err:
108
+ print(f"[NXui] Process stopped with return code {err.returncode}")
109
+ except KeyboardInterrupt:
110
+ print("\n[NXui] Process terminated by user.")
111
+
112
+ def send(self):
113
+ """Processes prompt, communicates with OpenRouter API, auto-installs, and runs."""
114
+ if not self.api_key:
115
+ raise ValueError("API key is not configured in Main.py!")
116
+
117
+ system_prompt = (
118
+ f"You are an expert Python UI developer. Generate a complete, ready-to-run "
119
+ f"GUI script using modern Tkinter or CustomTkinter. "
120
+ f"Window Title: '{Set.Window.Tittle}', Theme: '{Set.Window.theme}'. "
121
+ f"Output ONLY executable Python code inside standard ```python ... ``` blocks. "
122
+ f"No conversational text."
123
+ )
124
+
125
+ headers = {
126
+ "Authorization": f"Bearer {self.api_key}",
127
+ "Content-Type": "application/json",
128
+ "HTTP-Referer": "https://parastechindustries.com",
129
+ "X-Title": "NXui by Paras Tech Industries"
130
+ }
131
+
132
+ payload = {
133
+ "model": self.model,
134
+ "messages": [
135
+ {"role": "system", "content": system_prompt},
136
+ {"role": "user", "content": self.prompt}
137
+ ],
138
+ "temperature": 0.2
139
+ }
140
+
141
+ print(f"[NXui] Requesting UI from AI model ({self.model})...")
142
+ response = requests.post(
143
+ "https://openrouter.ai/api/v1/chat/completions",
144
+ headers=headers,
145
+ json=payload,
146
+ timeout=60
147
+ )
148
+ response.raise_for_status()
149
+
150
+ raw_output = response.json()["choices"][0]["message"]["content"]
151
+ code_match = re.search(r"```(?:python)?(.*?)```", raw_output, re.DOTALL)
152
+ code = code_match.group(1).strip() if code_match else raw_output.strip()
153
+
154
+ # Step 1: Detect and install dependencies
155
+ self._auto_install_missing_modules(code)
156
+
157
+ # Step 2: Write out to file
158
+ target_file = self.Gen.file
159
+ with open(target_file, "w", encoding="utf-8") as f:
160
+ f.write(code)
161
+ print(f"[NXui] UI generated and saved to '{target_file}'.")
162
+
163
+ # Step 3: Run the generated script
164
+ if self.Gen.autorun:
165
+ self._run_script(target_file)
166
+
167
+
168
+ # Global instances for the package
169
+ AI = _AIEngine()
170
+ onlineUI = None
nxui-0.1.0/PKG-INFO ADDED
@@ -0,0 +1,40 @@
1
+ Metadata-Version: 2.4
2
+ Name: NXUI
3
+ Version: 0.1.0
4
+ Summary: AI-powered declarative UI framework for Python by Paras Tech Industries.
5
+ Home-page: https://www.Parastechgroups,in
6
+ Author: Paras Tech Industries
7
+ Author-email: parastechindustrieshelp@Gmail.com
8
+ License: MIT
9
+ Requires-Python: >=3.9
10
+ Description-Content-Type: text/markdown
11
+ License-File: LICENSE.txt
12
+ Requires-Dist: requests>=2.28.0
13
+ Dynamic: author-email
14
+ Dynamic: home-page
15
+ Dynamic: license-file
16
+ Dynamic: requires-python
17
+
18
+ NXUI
19
+
20
+ Effortless, Prompt-Driven Python UI Generation
21
+
22
+ Developed & Maintained by Paras Tech Industries
23
+
24
+ NXUI simplifies Python desktop GUI creation by translating natural-language design prompts into complete, modern, executable applications (using CustomTkinter / Tkinter). It automatically resolves dependencies via pip and launches your newly created interface instantly.
25
+
26
+ Key Features
27
+
28
+ Prompt-Based UI Generation: Describe your desired layout, theme, widgets, and behavior in plain text inside <UI.start> and <UI.end> blocks.
29
+
30
+ Embedded Engine: Pre-wired with AI model integration—no mandatory manual API setup required for default usage.
31
+
32
+ Automatic Dependency Resolution: Inspects the generated script's imports using AST and installs missing packages via pip before running.
33
+
34
+ Instant Execution (Auto-Run): Directly launches the generated UI script upon generation.
35
+
36
+ Customizable Output: Choose target output files, window titles, and theme styling (dark/light).
37
+
38
+ Installation
39
+
40
+ Pip install NXui
nxui-0.1.0/README.md ADDED
@@ -0,0 +1,23 @@
1
+ NXUI
2
+
3
+ Effortless, Prompt-Driven Python UI Generation
4
+
5
+ Developed & Maintained by Paras Tech Industries
6
+
7
+ NXUI simplifies Python desktop GUI creation by translating natural-language design prompts into complete, modern, executable applications (using CustomTkinter / Tkinter). It automatically resolves dependencies via pip and launches your newly created interface instantly.
8
+
9
+ Key Features
10
+
11
+ Prompt-Based UI Generation: Describe your desired layout, theme, widgets, and behavior in plain text inside <UI.start> and <UI.end> blocks.
12
+
13
+ Embedded Engine: Pre-wired with AI model integration—no mandatory manual API setup required for default usage.
14
+
15
+ Automatic Dependency Resolution: Inspects the generated script's imports using AST and installs missing packages via pip before running.
16
+
17
+ Instant Execution (Auto-Run): Directly launches the generated UI script upon generation.
18
+
19
+ Customizable Output: Choose target output files, window titles, and theme styling (dark/light).
20
+
21
+ Installation
22
+
23
+ Pip install NXui
nxui-0.1.0/Setup.py ADDED
@@ -0,0 +1,40 @@
1
+ import os
2
+ from setuptools import find_packages, setup
3
+
4
+ here = os.path.abspath(os.path.dirname(__file__))
5
+
6
+ long_description = ""
7
+ readme_path = os.path.join(here, "README.md")
8
+ if os.path.exists(readme_path):
9
+ with open(readme_path, encoding="utf-8") as f:
10
+ long_description = f.read()
11
+
12
+ setup(
13
+ name="NXUI",
14
+ version="0.1.0",
15
+ author="Paras Tech Industries",
16
+ author_email="parastechindustrieshelp@Gmail.com",
17
+ description="AI-powered declarative UI framework for Python by Paras Tech Industries.",
18
+ long_description=long_description,
19
+ long_description_content_type="text/markdown",
20
+ url="https://www.Parastechgroups,in",
21
+ packages=find_packages(),
22
+ py_modules=["Main"],
23
+ include_package_data=True,
24
+ install_requires=[
25
+ "requests>=2.28.0",
26
+ ],
27
+ classifiers=[
28
+ "Development Status :: 3 - Alpha",
29
+ "Intended Audience :: Developers",
30
+ "Topic :: Software Development :: User Interfaces",
31
+ "License :: OSI Approved :: MIT License",
32
+ "Programming Language :: Python :: 3",
33
+ "Programming Language :: Python :: 3.9",
34
+ "Programming Language :: Python :: 3.10",
35
+ "Programming Language :: Python :: 3.11",
36
+ "Programming Language :: Python :: 3.12",
37
+ "Operating System :: OS Independent",
38
+ ],
39
+ python_requires=">=3.9",
40
+ )
@@ -0,0 +1,17 @@
1
+ [build-system]
2
+ requires = ["setuptools>=61.0"]
3
+ build-backend = "setuptools.build_meta"
4
+
5
+ [project]
6
+ name = "NXUI"
7
+ version = "0.1.0"
8
+ authors = [
9
+ { name = "Paras Tech Industries" }
10
+ ]
11
+ description = "AI-powered declarative UI framework for Python by Paras Tech Industries."
12
+ readme = "README.md"
13
+ license = { text = "MIT" }
14
+ requires-python = ">=3.9"
15
+ dependencies = [
16
+ "requests>=2.28.0"
17
+ ]
nxui-0.1.0/setup.cfg ADDED
@@ -0,0 +1,4 @@
1
+ [egg_info]
2
+ tag_build =
3
+ tag_date = 0
4
+