vtu-ml-lab 1.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.
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Pratham Balehosur
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.
@@ -0,0 +1,235 @@
1
+ Metadata-Version: 2.4
2
+ Name: vtu-ml-lab
3
+ Version: 1.1.0
4
+ Summary: VTU Machine Learning Lab programs — library, viewer, and exam assistant
5
+ Author-email: Pratham Balehosur <pratham.balehosur@example.com>
6
+ Project-URL: Homepage, https://github.com/prathamb/vtu-ml-lab
7
+ Classifier: Programming Language :: Python :: 3
8
+ Classifier: License :: OSI Approved :: MIT License
9
+ Classifier: Operating System :: OS Independent
10
+ Classifier: Intended Audience :: Education
11
+ Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
12
+ Classifier: Development Status :: 5 - Production/Stable
13
+ Requires-Python: >=3.10
14
+ Description-Content-Type: text/markdown
15
+ License-File: LICENSE
16
+ Requires-Dist: scikit-learn>=1.3
17
+ Requires-Dist: pandas>=2.0
18
+ Requires-Dist: matplotlib>=3.7
19
+ Requires-Dist: seaborn>=0.12
20
+ Requires-Dist: numpy>=1.24
21
+ Requires-Dist: statsmodels>=0.14
22
+ Dynamic: license-file
23
+
24
+ # vtu-ml-lab
25
+
26
+ [![PyPI version](https://img.shields.io/pypi/v/vtu-ml-lab.svg)](https://pypi.org/project/vtu-ml-lab/)
27
+ [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
28
+ [![Python Version](https://img.shields.io/badge/python-3.10%2B-blue.svg)](https://www.python.org/)
29
+
30
+ **vtu-ml-lab** is a comprehensive Python library, interactive viewer, and command-line examination assistant tailored for VTU Machine Learning Laboratory (21CS63 / 18CSL76 / similar schemes). It is designed to help students and educators view, save, execute, and prepare for exams with inline viva questions and memory tricks.
31
+
32
+ ---
33
+
34
+ ## Features
35
+
36
+ - **All 10 Lab Programs**: Ready-to-use, clean, and fully-commented implementations of standard VTU Machine Learning laboratory algorithms.
37
+ - **Dual Viewer Support**: Seamless rendering of code with syntax highlighting in Jupyter Notebooks (`IPython.display.Code`) and standard outputs in standard terminals.
38
+ - **Code Saver**: Export any lab script instantly to a file, automatically building any missing parent directories.
39
+ - **Isolated Execution**: Execute lab code locally in isolated namespaces, with options to prompt for confirmations or run non-interactively (Google Colab / script environments).
40
+ - **Exam Assistant / Viva Prep**: Embedded metadata including 6–8 inline Viva Q&As per lab, step-by-step logic, and specific memory mnemonics for memorization.
41
+ - **Interactive CLI**: Rich, argument-parsed command-line utility with shortcuts.
42
+
43
+ ---
44
+
45
+ ## Project Structure
46
+
47
+ | File / Folder | Description |
48
+ | :--- | :--- |
49
+ | `vtu_ml_lab/` | Core package folder |
50
+ | `├── __init__.py` | Package entry point, exposing standard APIs |
51
+ | `├── programs.py` | Central database containing code, titles, and metadata for all 10 programs |
52
+ | `├── viewer.py` | Code retrieval, listing, and Jupyter-sensitive code display helpers |
53
+ | `├── saver.py` | Disk storage helper with automatic directory creation |
54
+ | `├── runner.py` | Clean python execution engine using isolated dictionary scope namespaces |
55
+ | `├── metadata.py` | Query helpers for Viva lists, logic guides, memory tricks, and expected outputs |
56
+ | `└── cli.py` | Command line routing, supporting argument parsing and digit shortcuts |
57
+ | `tests/` | Unit testing suites |
58
+ | `├── test_vtu_ml_lab.py` | Complete `pytest` suites verifying API behavior and metadata sanity |
59
+ | `pyproject.toml` | Standard modern build setup, dependencies, and script routing |
60
+ | `setup.py` | Minimal legacy compatibility wrapper |
61
+ | `requirements.txt` | Clean development dependency lists |
62
+ | `LICENSE` | MIT License |
63
+
64
+ ---
65
+
66
+ ## Installation
67
+
68
+ Install directly from PyPI:
69
+ ```bash
70
+ pip install vtu-ml-lab
71
+ ```
72
+
73
+ For development or local setup:
74
+ ```bash
75
+ git clone https://github.com/prathamb/vtu-ml-lab.git
76
+ cd vtu-ml-lab
77
+ pip install -r requirements.txt
78
+ pip install -e .
79
+ ```
80
+
81
+ ### Dependencies
82
+ - `scikit-learn >= 1.3`
83
+ - `pandas >= 2.0`
84
+ - `matplotlib >= 3.7`
85
+ - `seaborn >= 0.12`
86
+ - `numpy >= 1.24`
87
+ - `statsmodels >= 0.14`
88
+
89
+ ---
90
+
91
+ ## Python API Usage
92
+
93
+ Here is how you can use `vtu-ml-lab` programmatically within your Python scripts or Jupyter Notebooks:
94
+
95
+ ```python
96
+ import vtu_ml_lab as ml
97
+
98
+ # 1. List all available lab programs
99
+ ml.list_programs()
100
+
101
+ # 2. Get program code as a string
102
+ code_str = ml.get_program(3)
103
+ print(code_str[:200])
104
+
105
+ # 3. View program inside terminal or Jupyter
106
+ ml.show_program(3)
107
+
108
+ # 4. Save program to disk (defaults to lab<N>.py if path not specified)
109
+ ml.save_program(3, "my_labs/lab3_pca.py")
110
+
111
+ # 5. Run the lab program (confirm=True prompts the user first)
112
+ ml.run_program(3, confirm=False)
113
+
114
+ # 6. Retrieve Exam Study Material
115
+ print("Viva Q&As:", ml.get_viva(3))
116
+ print("Memory Mnemonic:", ml.get_memory_trick(3))
117
+ print("Key Lines of Code:", ml.get_important_lines(3))
118
+ print("Program Logic:", ml.get_logic(3))
119
+ print("Expected Output:", ml.get_output(3))
120
+ ```
121
+
122
+ ---
123
+
124
+ ## CLI Usage
125
+
126
+ The package exposes a `vtu-ml-lab` CLI script when installed.
127
+
128
+ ### List available programs:
129
+ ```bash
130
+ vtu-ml-lab list
131
+ ```
132
+
133
+ ### Display code for a program:
134
+ ```bash
135
+ vtu-ml-lab show 3
136
+ ```
137
+ *Or use the bare integer shortcut:*
138
+ ```bash
139
+ vtu-ml-lab 3
140
+ ```
141
+
142
+ ### Save code to file:
143
+ ```bash
144
+ # Saves as lab3.py in current directory
145
+ vtu-ml-lab save 3
146
+
147
+ # Saves to custom path, automatically creating parent directories
148
+ vtu-ml-lab save 3 my_workspace/lab3_iris_pca.py
149
+ ```
150
+
151
+ ### Execute a program:
152
+ ```bash
153
+ # Prompts for confirmation before running
154
+ vtu-ml-lab run 3
155
+
156
+ # Runs directly without interactive confirmation (ideal for scripts/Colab)
157
+ vtu-ml-lab run 3 --yes
158
+ ```
159
+
160
+ ### Get Viva Q&As:
161
+ ```bash
162
+ vtu-ml-lab viva 3
163
+ ```
164
+
165
+ ### Get Memory Trick:
166
+ ```bash
167
+ vtu-ml-lab trick 3
168
+ ```
169
+
170
+ ### Get Step-by-step Logic:
171
+ ```bash
172
+ vtu-ml-lab logic 3
173
+ ```
174
+
175
+ ### Get Key Lines of Code:
176
+ ```bash
177
+ vtu-ml-lab lines 3
178
+ ```
179
+
180
+ ### Get Expected Output Details:
181
+ ```bash
182
+ vtu-ml-lab output 3
183
+ ```
184
+
185
+ ---
186
+
187
+ ## PyPI Publishing Steps
188
+
189
+ Follow these steps to build and upload the package to PyPI:
190
+
191
+ 1. **Verify Local Setup**:
192
+ Ensure you have `build` and `twine` installed:
193
+ ```bash
194
+ pip install --upgrade build twine
195
+ ```
196
+
197
+ 2. **Run Tests**:
198
+ Ensure all package tests are passing:
199
+ ```bash
200
+ pytest tests/ -v
201
+ ```
202
+
203
+ 3. **Build the Distribution Packages**:
204
+ Build the source distribution and wheel:
205
+ ```bash
206
+ python -m build
207
+ ```
208
+ This will create a `dist/` directory containing `.tar.gz` and `.whl` files.
209
+
210
+ 4. **Verify Build Contents**:
211
+ Verify that files are packaged correctly:
212
+ ```bash
213
+ twine check dist/*
214
+ ```
215
+
216
+ 5. **Upload to TestPyPI (Optional but Recommended)**:
217
+ Upload to the TestPyPI registry to verify packaging:
218
+ ```bash
219
+ python -m twine upload --repository testpypi dist/*
220
+ ```
221
+ Provide your TestPyPI API token when prompted.
222
+
223
+ 6. **Upload to PyPI**:
224
+ Upload the final package to the live PyPI registry:
225
+ ```bash
226
+ python -m twine upload dist/*
227
+ ```
228
+ Provide your PyPI API token when prompted.
229
+
230
+ ---
231
+
232
+ ## License
233
+
234
+ This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.
235
+ Author: **Pratham Balehosur**
@@ -0,0 +1,212 @@
1
+ # vtu-ml-lab
2
+
3
+ [![PyPI version](https://img.shields.io/pypi/v/vtu-ml-lab.svg)](https://pypi.org/project/vtu-ml-lab/)
4
+ [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
5
+ [![Python Version](https://img.shields.io/badge/python-3.10%2B-blue.svg)](https://www.python.org/)
6
+
7
+ **vtu-ml-lab** is a comprehensive Python library, interactive viewer, and command-line examination assistant tailored for VTU Machine Learning Laboratory (21CS63 / 18CSL76 / similar schemes). It is designed to help students and educators view, save, execute, and prepare for exams with inline viva questions and memory tricks.
8
+
9
+ ---
10
+
11
+ ## Features
12
+
13
+ - **All 10 Lab Programs**: Ready-to-use, clean, and fully-commented implementations of standard VTU Machine Learning laboratory algorithms.
14
+ - **Dual Viewer Support**: Seamless rendering of code with syntax highlighting in Jupyter Notebooks (`IPython.display.Code`) and standard outputs in standard terminals.
15
+ - **Code Saver**: Export any lab script instantly to a file, automatically building any missing parent directories.
16
+ - **Isolated Execution**: Execute lab code locally in isolated namespaces, with options to prompt for confirmations or run non-interactively (Google Colab / script environments).
17
+ - **Exam Assistant / Viva Prep**: Embedded metadata including 6–8 inline Viva Q&As per lab, step-by-step logic, and specific memory mnemonics for memorization.
18
+ - **Interactive CLI**: Rich, argument-parsed command-line utility with shortcuts.
19
+
20
+ ---
21
+
22
+ ## Project Structure
23
+
24
+ | File / Folder | Description |
25
+ | :--- | :--- |
26
+ | `vtu_ml_lab/` | Core package folder |
27
+ | `├── __init__.py` | Package entry point, exposing standard APIs |
28
+ | `├── programs.py` | Central database containing code, titles, and metadata for all 10 programs |
29
+ | `├── viewer.py` | Code retrieval, listing, and Jupyter-sensitive code display helpers |
30
+ | `├── saver.py` | Disk storage helper with automatic directory creation |
31
+ | `├── runner.py` | Clean python execution engine using isolated dictionary scope namespaces |
32
+ | `├── metadata.py` | Query helpers for Viva lists, logic guides, memory tricks, and expected outputs |
33
+ | `└── cli.py` | Command line routing, supporting argument parsing and digit shortcuts |
34
+ | `tests/` | Unit testing suites |
35
+ | `├── test_vtu_ml_lab.py` | Complete `pytest` suites verifying API behavior and metadata sanity |
36
+ | `pyproject.toml` | Standard modern build setup, dependencies, and script routing |
37
+ | `setup.py` | Minimal legacy compatibility wrapper |
38
+ | `requirements.txt` | Clean development dependency lists |
39
+ | `LICENSE` | MIT License |
40
+
41
+ ---
42
+
43
+ ## Installation
44
+
45
+ Install directly from PyPI:
46
+ ```bash
47
+ pip install vtu-ml-lab
48
+ ```
49
+
50
+ For development or local setup:
51
+ ```bash
52
+ git clone https://github.com/prathamb/vtu-ml-lab.git
53
+ cd vtu-ml-lab
54
+ pip install -r requirements.txt
55
+ pip install -e .
56
+ ```
57
+
58
+ ### Dependencies
59
+ - `scikit-learn >= 1.3`
60
+ - `pandas >= 2.0`
61
+ - `matplotlib >= 3.7`
62
+ - `seaborn >= 0.12`
63
+ - `numpy >= 1.24`
64
+ - `statsmodels >= 0.14`
65
+
66
+ ---
67
+
68
+ ## Python API Usage
69
+
70
+ Here is how you can use `vtu-ml-lab` programmatically within your Python scripts or Jupyter Notebooks:
71
+
72
+ ```python
73
+ import vtu_ml_lab as ml
74
+
75
+ # 1. List all available lab programs
76
+ ml.list_programs()
77
+
78
+ # 2. Get program code as a string
79
+ code_str = ml.get_program(3)
80
+ print(code_str[:200])
81
+
82
+ # 3. View program inside terminal or Jupyter
83
+ ml.show_program(3)
84
+
85
+ # 4. Save program to disk (defaults to lab<N>.py if path not specified)
86
+ ml.save_program(3, "my_labs/lab3_pca.py")
87
+
88
+ # 5. Run the lab program (confirm=True prompts the user first)
89
+ ml.run_program(3, confirm=False)
90
+
91
+ # 6. Retrieve Exam Study Material
92
+ print("Viva Q&As:", ml.get_viva(3))
93
+ print("Memory Mnemonic:", ml.get_memory_trick(3))
94
+ print("Key Lines of Code:", ml.get_important_lines(3))
95
+ print("Program Logic:", ml.get_logic(3))
96
+ print("Expected Output:", ml.get_output(3))
97
+ ```
98
+
99
+ ---
100
+
101
+ ## CLI Usage
102
+
103
+ The package exposes a `vtu-ml-lab` CLI script when installed.
104
+
105
+ ### List available programs:
106
+ ```bash
107
+ vtu-ml-lab list
108
+ ```
109
+
110
+ ### Display code for a program:
111
+ ```bash
112
+ vtu-ml-lab show 3
113
+ ```
114
+ *Or use the bare integer shortcut:*
115
+ ```bash
116
+ vtu-ml-lab 3
117
+ ```
118
+
119
+ ### Save code to file:
120
+ ```bash
121
+ # Saves as lab3.py in current directory
122
+ vtu-ml-lab save 3
123
+
124
+ # Saves to custom path, automatically creating parent directories
125
+ vtu-ml-lab save 3 my_workspace/lab3_iris_pca.py
126
+ ```
127
+
128
+ ### Execute a program:
129
+ ```bash
130
+ # Prompts for confirmation before running
131
+ vtu-ml-lab run 3
132
+
133
+ # Runs directly without interactive confirmation (ideal for scripts/Colab)
134
+ vtu-ml-lab run 3 --yes
135
+ ```
136
+
137
+ ### Get Viva Q&As:
138
+ ```bash
139
+ vtu-ml-lab viva 3
140
+ ```
141
+
142
+ ### Get Memory Trick:
143
+ ```bash
144
+ vtu-ml-lab trick 3
145
+ ```
146
+
147
+ ### Get Step-by-step Logic:
148
+ ```bash
149
+ vtu-ml-lab logic 3
150
+ ```
151
+
152
+ ### Get Key Lines of Code:
153
+ ```bash
154
+ vtu-ml-lab lines 3
155
+ ```
156
+
157
+ ### Get Expected Output Details:
158
+ ```bash
159
+ vtu-ml-lab output 3
160
+ ```
161
+
162
+ ---
163
+
164
+ ## PyPI Publishing Steps
165
+
166
+ Follow these steps to build and upload the package to PyPI:
167
+
168
+ 1. **Verify Local Setup**:
169
+ Ensure you have `build` and `twine` installed:
170
+ ```bash
171
+ pip install --upgrade build twine
172
+ ```
173
+
174
+ 2. **Run Tests**:
175
+ Ensure all package tests are passing:
176
+ ```bash
177
+ pytest tests/ -v
178
+ ```
179
+
180
+ 3. **Build the Distribution Packages**:
181
+ Build the source distribution and wheel:
182
+ ```bash
183
+ python -m build
184
+ ```
185
+ This will create a `dist/` directory containing `.tar.gz` and `.whl` files.
186
+
187
+ 4. **Verify Build Contents**:
188
+ Verify that files are packaged correctly:
189
+ ```bash
190
+ twine check dist/*
191
+ ```
192
+
193
+ 5. **Upload to TestPyPI (Optional but Recommended)**:
194
+ Upload to the TestPyPI registry to verify packaging:
195
+ ```bash
196
+ python -m twine upload --repository testpypi dist/*
197
+ ```
198
+ Provide your TestPyPI API token when prompted.
199
+
200
+ 6. **Upload to PyPI**:
201
+ Upload the final package to the live PyPI registry:
202
+ ```bash
203
+ python -m twine upload dist/*
204
+ ```
205
+ Provide your PyPI API token when prompted.
206
+
207
+ ---
208
+
209
+ ## License
210
+
211
+ This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.
212
+ Author: **Pratham Balehosur**
@@ -0,0 +1,38 @@
1
+ [build-system]
2
+ requires = ["setuptools>=61.0.0", "wheel"]
3
+ build-backend = "setuptools.build_meta"
4
+
5
+ [project]
6
+ name = "vtu-ml-lab"
7
+ version = "1.1.0"
8
+ authors = [
9
+ { name = "Pratham Balehosur", email = "pratham.balehosur@example.com" }
10
+ ]
11
+ description = "VTU Machine Learning Lab programs — library, viewer, and exam assistant"
12
+ readme = "README.md"
13
+ requires-python = ">=3.10"
14
+ classifiers = [
15
+ "Programming Language :: Python :: 3",
16
+ "License :: OSI Approved :: MIT License",
17
+ "Operating System :: OS Independent",
18
+ "Intended Audience :: Education",
19
+ "Topic :: Scientific/Engineering :: Artificial Intelligence",
20
+ "Development Status :: 5 - Production/Stable"
21
+ ]
22
+ dependencies = [
23
+ "scikit-learn>=1.3",
24
+ "pandas>=2.0",
25
+ "matplotlib>=3.7",
26
+ "seaborn>=0.12",
27
+ "numpy>=1.24",
28
+ "statsmodels>=0.14"
29
+ ]
30
+
31
+ [project.urls]
32
+ "Homepage" = "https://github.com/prathamb/vtu-ml-lab"
33
+
34
+ [project.scripts]
35
+ vtu-ml-lab = "vtu_ml_lab.cli:main"
36
+
37
+ [tool.setuptools]
38
+ packages = ["vtu_ml_lab"]
@@ -0,0 +1,4 @@
1
+ [egg_info]
2
+ tag_build =
3
+ tag_date = 0
4
+
@@ -0,0 +1,4 @@
1
+ from setuptools import setup
2
+
3
+ if __name__ == "__main__":
4
+ setup()