pytoch-dl 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.
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Antigravity Team
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,113 @@
1
+ Metadata-Version: 2.4
2
+ Name: pytoch-dl
3
+ Version: 1.0.0
4
+ Summary: Deep Learning Practicals, Customization Recipes, Theory Explainers & Bundled Datasets
5
+ Author: Antigravity Team
6
+ License: MIT
7
+ Keywords: deep-learning,pytorch,tensorflow,keras,neural-networks,mnist,imdb,recipes
8
+ Requires-Python: >=3.6
9
+ Description-Content-Type: text/markdown
10
+ License-File: LICENSE
11
+ Requires-Dist: pandas
12
+ Dynamic: license-file
13
+ Dynamic: requires-python
14
+
15
+ # pytoch
16
+
17
+ > **Deep Learning Practicals, Customization Recipes, Mathematical Theory Explainers & Bundled Datasets**
18
+
19
+ `pytoch` is a self-contained, discrete, and modular Deep Learning reference library. It bundles complete implementations for 9 foundational deep learning practicals across NumPy, TensorFlow/Keras, and PyTorch, complete with customization recipes, mathematical theory explainers with viva Q&A, and offline datasets (`mnist.csv` and `imdb.csv`).
20
+
21
+ ---
22
+
23
+ ## Key Features
24
+
25
+ 1. **All 9 Deep Learning Practicals**:
26
+ - Discrete, modular implementations free of academic markers, student names, or roll numbers.
27
+ - Clean cell-by-cell inspection or complete script views.
28
+ 2. **Built-in Customization Recipes**:
29
+ - Detailed guides on dataset swapping (Pandas CSV, torchvision/keras datasets, custom folders).
30
+ - Optimizer switching (Adam, SGD + Nesterov momentum, RMSprop, AdamW).
31
+ - Learning rate schedules, regularizers (L1, L2, Dropout), and modern activation functions.
32
+ 3. **Comprehensive Theory & Viva Explainers**:
33
+ - Mathematical formulations, forward/backward derivations, loss functions, and gradient mechanics.
34
+ - Top viva questions and definitive technical answers.
35
+ 4. **Bundled Datasets & Pull Utility**:
36
+ - Bundles `mnist.csv` (20,000 tabular digit pixels, 35MB) and `imdb.csv` (10,000 movie reviews, 12MB) directly in package data.
37
+ - One-command extraction to any folder on your machine (`pytoch.pull_datasets("./data")`).
38
+ - Direct pandas loader without copying: `pytoch.load_mnist()`.
39
+
40
+ ---
41
+
42
+ ## Catalog of Practicals
43
+
44
+ | # | Practical Title | Framework | Dataset |
45
+ |---|----------------|-----------|---------|
46
+ | 1 | Single-Layer Perceptron (AND / OR Gates) | NumPy / Matplotlib | Logic Tables |
47
+ | 2 | 3-Layer Multi-Layer Perceptron (MLP) | TensorFlow / Keras + Pandas | `mnist.csv` |
48
+ | 3 | Neural Network Regularization (L2 Decay vs Dropout) | TensorFlow / Keras + Pandas | `mnist.csv` |
49
+ | 4 | Activation Functions (Sigmoid vs Tanh vs ReLU) | TensorFlow / Keras + Pandas | `mnist.csv` |
50
+ | 5 | CNN vs. MLP with Data Augmentation | TensorFlow / Keras + Pandas | `mnist.csv` |
51
+ | 6 | Sequential LSTM for Sentiment Analysis | TensorFlow / Keras + Pandas | `imdb.csv` |
52
+ | 7 | Transfer Learning & Fine-Tuning (MobileNetV2) | TensorFlow / Keras + Pandas | `mnist.csv` |
53
+ | 8 | Dynamic PyTorch MLP & Hyperparameter Grid Search | PyTorch + Pandas + TensorBoard | `mnist.csv` |
54
+ | 9 | Deep CNN Micro-Project with Dynamic Callbacks | TensorFlow / Keras + Pandas | `mnist.csv` |
55
+
56
+ ---
57
+
58
+ ## Python API Usage
59
+
60
+ ```python
61
+ import pytoch
62
+
63
+ # 1. Dataset Management
64
+ pytoch.list_datasets()
65
+ pytoch.pull_datasets(target_dir="./data") # Extracts mnist.csv & imdb.csv
66
+ X, y = pytoch.load_mnist() # Load directly into memory
67
+
68
+ # 2. View Code & Practicals
69
+ pytoch.list_practicals()
70
+ pytoch.show(2) # Full Practical 2 code
71
+ pytoch.show(2, cell=1) # View specific cell
72
+
73
+ # 3. Customization Recipes
74
+ pytoch.recipes(2) # How to swap datasets, optimizers, loss functions
75
+
76
+ # 4. Theory & Viva Explainer
77
+ pytoch.theory(2) # Mathematical derivations, equations, and viva Q&A
78
+
79
+ # 5. Combined View
80
+ pytoch.show(2, recipes=True, theory=True)
81
+ ```
82
+
83
+ ---
84
+
85
+ ## CLI Usage
86
+
87
+ ```bash
88
+ # View help and cheat sheet
89
+ pytoch guide
90
+
91
+ # List all practicals
92
+ pytoch list
93
+
94
+ # Display code
95
+ pytoch show 2
96
+ pytoch show 2 --cell 1
97
+
98
+ # Display recipes and theory
99
+ pytoch recipes 2
100
+ pytoch theory 2
101
+
102
+ # Extract bundled datasets to ./data
103
+ pytoch pull-data --out-dir ./data
104
+
105
+ # View bundled datasets catalog
106
+ pytoch datasets
107
+ ```
108
+
109
+ ---
110
+
111
+ ## License
112
+
113
+ MIT License.
@@ -0,0 +1,99 @@
1
+ # pytoch
2
+
3
+ > **Deep Learning Practicals, Customization Recipes, Mathematical Theory Explainers & Bundled Datasets**
4
+
5
+ `pytoch` is a self-contained, discrete, and modular Deep Learning reference library. It bundles complete implementations for 9 foundational deep learning practicals across NumPy, TensorFlow/Keras, and PyTorch, complete with customization recipes, mathematical theory explainers with viva Q&A, and offline datasets (`mnist.csv` and `imdb.csv`).
6
+
7
+ ---
8
+
9
+ ## Key Features
10
+
11
+ 1. **All 9 Deep Learning Practicals**:
12
+ - Discrete, modular implementations free of academic markers, student names, or roll numbers.
13
+ - Clean cell-by-cell inspection or complete script views.
14
+ 2. **Built-in Customization Recipes**:
15
+ - Detailed guides on dataset swapping (Pandas CSV, torchvision/keras datasets, custom folders).
16
+ - Optimizer switching (Adam, SGD + Nesterov momentum, RMSprop, AdamW).
17
+ - Learning rate schedules, regularizers (L1, L2, Dropout), and modern activation functions.
18
+ 3. **Comprehensive Theory & Viva Explainers**:
19
+ - Mathematical formulations, forward/backward derivations, loss functions, and gradient mechanics.
20
+ - Top viva questions and definitive technical answers.
21
+ 4. **Bundled Datasets & Pull Utility**:
22
+ - Bundles `mnist.csv` (20,000 tabular digit pixels, 35MB) and `imdb.csv` (10,000 movie reviews, 12MB) directly in package data.
23
+ - One-command extraction to any folder on your machine (`pytoch.pull_datasets("./data")`).
24
+ - Direct pandas loader without copying: `pytoch.load_mnist()`.
25
+
26
+ ---
27
+
28
+ ## Catalog of Practicals
29
+
30
+ | # | Practical Title | Framework | Dataset |
31
+ |---|----------------|-----------|---------|
32
+ | 1 | Single-Layer Perceptron (AND / OR Gates) | NumPy / Matplotlib | Logic Tables |
33
+ | 2 | 3-Layer Multi-Layer Perceptron (MLP) | TensorFlow / Keras + Pandas | `mnist.csv` |
34
+ | 3 | Neural Network Regularization (L2 Decay vs Dropout) | TensorFlow / Keras + Pandas | `mnist.csv` |
35
+ | 4 | Activation Functions (Sigmoid vs Tanh vs ReLU) | TensorFlow / Keras + Pandas | `mnist.csv` |
36
+ | 5 | CNN vs. MLP with Data Augmentation | TensorFlow / Keras + Pandas | `mnist.csv` |
37
+ | 6 | Sequential LSTM for Sentiment Analysis | TensorFlow / Keras + Pandas | `imdb.csv` |
38
+ | 7 | Transfer Learning & Fine-Tuning (MobileNetV2) | TensorFlow / Keras + Pandas | `mnist.csv` |
39
+ | 8 | Dynamic PyTorch MLP & Hyperparameter Grid Search | PyTorch + Pandas + TensorBoard | `mnist.csv` |
40
+ | 9 | Deep CNN Micro-Project with Dynamic Callbacks | TensorFlow / Keras + Pandas | `mnist.csv` |
41
+
42
+ ---
43
+
44
+ ## Python API Usage
45
+
46
+ ```python
47
+ import pytoch
48
+
49
+ # 1. Dataset Management
50
+ pytoch.list_datasets()
51
+ pytoch.pull_datasets(target_dir="./data") # Extracts mnist.csv & imdb.csv
52
+ X, y = pytoch.load_mnist() # Load directly into memory
53
+
54
+ # 2. View Code & Practicals
55
+ pytoch.list_practicals()
56
+ pytoch.show(2) # Full Practical 2 code
57
+ pytoch.show(2, cell=1) # View specific cell
58
+
59
+ # 3. Customization Recipes
60
+ pytoch.recipes(2) # How to swap datasets, optimizers, loss functions
61
+
62
+ # 4. Theory & Viva Explainer
63
+ pytoch.theory(2) # Mathematical derivations, equations, and viva Q&A
64
+
65
+ # 5. Combined View
66
+ pytoch.show(2, recipes=True, theory=True)
67
+ ```
68
+
69
+ ---
70
+
71
+ ## CLI Usage
72
+
73
+ ```bash
74
+ # View help and cheat sheet
75
+ pytoch guide
76
+
77
+ # List all practicals
78
+ pytoch list
79
+
80
+ # Display code
81
+ pytoch show 2
82
+ pytoch show 2 --cell 1
83
+
84
+ # Display recipes and theory
85
+ pytoch recipes 2
86
+ pytoch theory 2
87
+
88
+ # Extract bundled datasets to ./data
89
+ pytoch pull-data --out-dir ./data
90
+
91
+ # View bundled datasets catalog
92
+ pytoch datasets
93
+ ```
94
+
95
+ ---
96
+
97
+ ## License
98
+
99
+ MIT License.
@@ -0,0 +1,27 @@
1
+ [build-system]
2
+ requires = ["setuptools>=61.0", "wheel"]
3
+ build-backend = "setuptools.build_meta"
4
+
5
+ [project]
6
+ name = "pytoch-dl"
7
+ version = "1.0.0"
8
+ description = "Deep Learning Practicals, Customization Recipes, Theory Explainers & Bundled Datasets"
9
+ readme = "README.md"
10
+ requires-python = ">=3.6"
11
+ license = {text = "MIT"}
12
+ authors = [
13
+ {name = "Antigravity Team"}
14
+ ]
15
+ keywords = ["deep-learning", "pytorch", "tensorflow", "keras", "neural-networks", "mnist", "imdb", "recipes"]
16
+ dependencies = [
17
+ "pandas"
18
+ ]
19
+
20
+ [project.scripts]
21
+ pytoch = "pytoch.cli:main"
22
+
23
+ [tool.setuptools.packages.find]
24
+ where = ["src"]
25
+
26
+ [tool.setuptools.package-data]
27
+ pytoch = ["data/*", "data/*/*"]
@@ -0,0 +1,4 @@
1
+ [egg_info]
2
+ tag_build =
3
+ tag_date = 0
4
+
@@ -0,0 +1,31 @@
1
+ from setuptools import setup, find_packages
2
+
3
+ setup(
4
+ name="pytoch-dl",
5
+ version="1.0.0",
6
+ description="Deep Learning Practicals, Customization Recipes, Theory Explainers & Bundled Datasets",
7
+ long_description=open("README.md", encoding="utf-8").read(),
8
+ long_description_content_type="text/markdown",
9
+ author="Antigravity Team",
10
+ package_dir={"": "src"},
11
+ packages=find_packages(where="src"),
12
+ package_data={
13
+ "pytoch": ["data/*", "data/*/*"]
14
+ },
15
+ include_package_data=True,
16
+ python_requires=">=3.6",
17
+ install_requires=[
18
+ "pandas",
19
+ ],
20
+ entry_points={
21
+ "console_scripts": [
22
+ "pytoch=pytoch.cli:main",
23
+ ],
24
+ },
25
+ classifiers=[
26
+ "Programming Language :: Python :: 3",
27
+ "License :: OSI Approved :: MIT License",
28
+ "Operating System :: OS Independent",
29
+ "Topic :: Scientific/Engineering :: Artificial Intelligence",
30
+ ],
31
+ )
@@ -0,0 +1,167 @@
1
+ """
2
+ pytoch: Deep Learning Practicals, Customization Recipes, Theory Explainers & Bundled Datasets.
3
+ """
4
+
5
+ from .core import Pytoch
6
+ from .datasets import (
7
+ pull_datasets,
8
+ get_dataset,
9
+ get_dataset_path,
10
+ list_datasets,
11
+ load_mnist,
12
+ load_imdb,
13
+ )
14
+ from .recipes import get_recipe, print_recipe, list_recipes
15
+ from .theory import get_theory, print_theory, list_theory
16
+
17
+ _default_instance = Pytoch()
18
+
19
+ # Core Navigation & Guide
20
+ def guide():
21
+ """Display the pytoch quickstart guide and cheatsheet."""
22
+ _default_instance.guide()
23
+
24
+ help = guide
25
+ quickstart = guide
26
+
27
+ def list_practicals():
28
+ """List all available deep learning practicals."""
29
+ _default_instance.list_practicals()
30
+
31
+ list_codes = list_practicals
32
+ list_architectures = list_practicals
33
+ entries = list_practicals
34
+ list_entries = list_practicals
35
+
36
+ def show(num, cell=None, recipes=False, theory=False):
37
+ """Display practical code, optional recipes, and optional theory."""
38
+ _default_instance.show(num, cell=cell, recipes=recipes, theory=theory)
39
+
40
+ practical = show
41
+ code = show
42
+ architecture = show
43
+
44
+ def recipes(num):
45
+ """View customization recipes for practical num."""
46
+ _default_instance.recipes(num)
47
+
48
+ tweaks = recipes
49
+
50
+ def theory(num):
51
+ """View theoretical foundation, equations, and viva explainer for practical num."""
52
+ _default_instance.theory(num)
53
+
54
+ explain = theory
55
+
56
+ def viva(num=None):
57
+ """View Viva Examination questions and answers for practical num (or all if None)."""
58
+ _default_instance.viva(num)
59
+
60
+ def get_viva(num=None):
61
+ """Retrieve Viva Examination questions and answers string for practical num."""
62
+ return _default_instance.get_viva(num)
63
+
64
+ # Getter functions (returns string / dict)
65
+ def get_practical(num, cell=None, recipes=False, theory=False):
66
+ """Retrieve practical code string."""
67
+ return _default_instance.get_practical(num, cell=cell, recipes=recipes, theory=theory)
68
+
69
+ get_code = get_practical
70
+ get_architecture = get_practical
71
+
72
+ def get_recipes(num):
73
+ """Retrieve customization recipes string."""
74
+ return _default_instance.get_recipes(num)
75
+
76
+ get_tweaks = get_recipes
77
+
78
+ def get_theory(num):
79
+ """Retrieve theoretical explainer string."""
80
+ return _default_instance.get_theory(num)
81
+
82
+ def get_cells(num):
83
+ """Retrieve list of cell dicts for practical num."""
84
+ return _default_instance.get_cells(num)
85
+
86
+ # Practical-specific Shortcuts
87
+ def perceptron(cell=None, recipes=False, theory=False):
88
+ """Practical 1: Single-Layer Perceptron (AND & OR Gates)."""
89
+ _default_instance.perceptron(cell=cell, recipes=recipes, theory=theory)
90
+
91
+ def mlp(cell=None, recipes=False, theory=False):
92
+ """Practical 2: 3-Layer Multi-Layer Perceptron on Local MNIST."""
93
+ _default_instance.mlp(cell=cell, recipes=recipes, theory=theory)
94
+
95
+ def regularization(cell=None, recipes=False, theory=False):
96
+ """Practical 3: Neural Network Regularization (L2 Decay vs. Dropout)."""
97
+ _default_instance.regularization(cell=cell, recipes=recipes, theory=theory)
98
+
99
+ def activations(cell=None, recipes=False, theory=False):
100
+ """Practical 4: Non-Linear Activation Functions (Sigmoid vs Tanh vs ReLU)."""
101
+ _default_instance.activations(cell=cell, recipes=recipes, theory=theory)
102
+
103
+ def cnn(cell=None, recipes=False, theory=False):
104
+ """Practical 5: CNN vs. MLP with Data Augmentation for Vision."""
105
+ _default_instance.cnn(cell=cell, recipes=recipes, theory=theory)
106
+
107
+ def lstm(cell=None, recipes=False, theory=False):
108
+ """Practical 6: Sequential LSTM Network for Sentiment Analysis."""
109
+ _default_instance.lstm(cell=cell, recipes=recipes, theory=theory)
110
+
111
+ def transfer_learning(cell=None, recipes=False, theory=False):
112
+ """Practical 7: Transfer Learning & Fine-Tuning with MobileNetV2."""
113
+ _default_instance.transfer_learning(cell=cell, recipes=recipes, theory=theory)
114
+
115
+ def hparam_tuning(cell=None, recipes=False, theory=False):
116
+ """Practical 8: Dynamic PyTorch MLP & Hyperparameter Grid Search."""
117
+ _default_instance.hparam_tuning(cell=cell, recipes=recipes, theory=theory)
118
+
119
+ def deep_cnn(cell=None, recipes=False, theory=False):
120
+ """Practical 9: Deep CNN Micro-Project with Dynamic Callbacks."""
121
+ _default_instance.deep_cnn(cell=cell, recipes=recipes, theory=theory)
122
+
123
+ __all__ = [
124
+ "Pytoch",
125
+ "guide",
126
+ "help",
127
+ "quickstart",
128
+ "list_practicals",
129
+ "list_codes",
130
+ "list_architectures",
131
+ "entries",
132
+ "list_entries",
133
+ "show",
134
+ "practical",
135
+ "code",
136
+ "architecture",
137
+ "recipes",
138
+ "tweaks",
139
+ "theory",
140
+ "explain",
141
+ "viva",
142
+ "get_viva",
143
+ "get_practical",
144
+ "get_code",
145
+ "get_architecture",
146
+ "get_recipes",
147
+ "get_tweaks",
148
+ "get_theory",
149
+ "get_cells",
150
+ "pull_datasets",
151
+ "get_dataset",
152
+ "get_dataset_path",
153
+ "list_datasets",
154
+ "load_mnist",
155
+ "load_imdb",
156
+ "perceptron",
157
+ "mlp",
158
+ "regularization",
159
+ "activations",
160
+ "cnn",
161
+ "lstm",
162
+ "transfer_learning",
163
+ "hparam_tuning",
164
+ "deep_cnn",
165
+ ]
166
+
167
+ __version__ = "1.0.0"
@@ -0,0 +1,115 @@
1
+ """
2
+ pytoch.cli: Command-line interface for the pytoch deep learning suite.
3
+ """
4
+
5
+ import argparse
6
+ import sys
7
+ from .core import Pytoch
8
+ from .datasets import pull_datasets, get_dataset, list_datasets
9
+ from .recipes import print_recipe, list_recipes
10
+ from .theory import print_theory, list_theory, print_viva
11
+
12
+
13
+ def main():
14
+ parser = argparse.ArgumentParser(
15
+ prog="pytoch",
16
+ description="pytoch: Deep Learning Practicals, Customization Recipes, Theory Explainers & Bundled Datasets"
17
+ )
18
+ subparsers = parser.add_subparsers(dest="command", help="Available subcommands")
19
+
20
+ # guide
21
+ subparsers.add_parser("guide", help="Display quickstart cheatsheet")
22
+
23
+ # list / entries
24
+ subparsers.add_parser("list", help="List all 9 practicals")
25
+ subparsers.add_parser("entries", help="List all 9 practical entries")
26
+
27
+ # show
28
+ show_parser = subparsers.add_parser("show", help="Display practical code")
29
+ show_parser.add_argument("num", type=int, help="Practical number (1-9)")
30
+ show_parser.add_argument("--cell", "-c", type=int, default=None, help="Specific cell number")
31
+ show_parser.add_argument("--recipes", "-r", action="store_true", help="Include customization recipes")
32
+ show_parser.add_argument("--theory", "-t", action="store_true", help="Include theory & viva explainer")
33
+
34
+ # practical (alias for show)
35
+ p_parser = subparsers.add_parser("practical", help="Display practical code (alias for show)")
36
+ p_parser.add_argument("num", type=int, help="Practical number (1-9)")
37
+ p_parser.add_argument("--cell", "-c", type=int, default=None, help="Specific cell number")
38
+ p_parser.add_argument("--recipes", "-r", action="store_true", help="Include customization recipes")
39
+ p_parser.add_argument("--theory", "-t", action="store_true", help="Include theory & viva explainer")
40
+
41
+ # recipes
42
+ rec_parser = subparsers.add_parser("recipes", help="Display customization recipes for a practical")
43
+ rec_parser.add_argument("num", type=int, nargs="?", default=None, help="Practical number (1-9)")
44
+
45
+ # theory
46
+ th_parser = subparsers.add_parser("theory", help="Display theory foundations & viva Q&A for a practical")
47
+ th_parser.add_argument("num", type=int, nargs="?", default=None, help="Practical number (1-9)")
48
+
49
+ # viva
50
+ viva_parser = subparsers.add_parser("viva", help="Display Viva exam Q&A for a practical")
51
+ viva_parser.add_argument("num", type=int, nargs="?", default=None, help="Practical number (1-9)")
52
+
53
+ # datasets
54
+ subparsers.add_parser("datasets", help="List bundled datasets and details")
55
+
56
+ # pull-data
57
+ pull_parser = subparsers.add_parser("pull-data", help="Pull bundled datasets into a local directory")
58
+ pull_parser.add_argument("--out-dir", "-o", default="./data", help="Output directory (default: ./data)")
59
+ pull_parser.add_argument("--name", "-n", default=None, help="Specific dataset name ('mnist' or 'imdb')")
60
+ pull_parser.add_argument("--overwrite", action="store_true", help="Overwrite existing files")
61
+
62
+ # Parse arguments
63
+ args = parser.parse_args()
64
+
65
+ app = Pytoch()
66
+
67
+ if args.command in ("guide", None):
68
+ app.guide()
69
+ elif args.command in ("list", "entries"):
70
+ app.list_practicals()
71
+ elif args.command in ("show", "practical"):
72
+ try:
73
+ app.show(args.num, cell=args.cell, recipes=args.recipes, theory=args.theory)
74
+ except Exception as e:
75
+ print(f"[!] Error: {e}", file=sys.stderr)
76
+ sys.exit(1)
77
+ elif args.command == "recipes":
78
+ if args.num is not None:
79
+ try:
80
+ print_recipe(args.num)
81
+ except Exception as e:
82
+ print(f"[!] Error: {e}", file=sys.stderr)
83
+ sys.exit(1)
84
+ else:
85
+ list_recipes()
86
+ elif args.command == "theory":
87
+ if args.num is not None:
88
+ try:
89
+ print_theory(args.num)
90
+ except Exception as e:
91
+ print(f"[!] Error: {e}", file=sys.stderr)
92
+ sys.exit(1)
93
+ else:
94
+ list_theory()
95
+ elif args.command == "viva":
96
+ try:
97
+ print_viva(args.num)
98
+ except Exception as e:
99
+ print(f"[!] Error: {e}", file=sys.stderr)
100
+ sys.exit(1)
101
+ elif args.command == "datasets":
102
+ list_datasets()
103
+ elif args.command == "pull-data":
104
+ if args.name:
105
+ try:
106
+ get_dataset(args.name, target_dir=args.out_dir, overwrite=args.overwrite)
107
+ except Exception as e:
108
+ print(f"[!] Error: {e}", file=sys.stderr)
109
+ sys.exit(1)
110
+ else:
111
+ pull_datasets(target_dir=args.out_dir, overwrite=args.overwrite)
112
+
113
+
114
+ if __name__ == "__main__":
115
+ main()