data-advisor 0.1.0__tar.gz → 0.2.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.
Files changed (152) hide show
  1. data_advisor-0.2.0/PKG-INFO +147 -0
  2. data_advisor-0.2.0/README.md +116 -0
  3. {data_advisor-0.1.0 → data_advisor-0.2.0}/pyproject.toml +5 -1
  4. data_advisor-0.2.0/src/data_advisor/code_bank/01_dht22_serial/README.md +17 -0
  5. data_advisor-0.2.0/src/data_advisor/code_bank/01_dht22_serial/diagram.json +17 -0
  6. data_advisor-0.2.0/src/data_advisor/code_bank/01_dht22_serial/libraries.txt +2 -0
  7. data_advisor-0.2.0/src/data_advisor/code_bank/01_dht22_serial/sketch.ino +31 -0
  8. data_advisor-0.2.0/src/data_advisor/code_bank/02_ldr_serial/README.md +15 -0
  9. data_advisor-0.2.0/src/data_advisor/code_bank/02_ldr_serial/diagram.json +17 -0
  10. data_advisor-0.2.0/src/data_advisor/code_bank/02_ldr_serial/sketch.ino +21 -0
  11. data_advisor-0.2.0/src/data_advisor/code_bank/03_pir_serial/README.md +14 -0
  12. data_advisor-0.2.0/src/data_advisor/code_bank/03_pir_serial/diagram.json +17 -0
  13. data_advisor-0.2.0/src/data_advisor/code_bank/03_pir_serial/sketch.ino +20 -0
  14. data_advisor-0.2.0/src/data_advisor/code_bank/04_mqtt_esp32_python/README.md +19 -0
  15. data_advisor-0.2.0/src/data_advisor/code_bank/04_mqtt_esp32_python/diagram.json +17 -0
  16. data_advisor-0.2.0/src/data_advisor/code_bank/04_mqtt_esp32_python/libraries.txt +3 -0
  17. data_advisor-0.2.0/src/data_advisor/code_bank/04_mqtt_esp32_python/sketch.ino +87 -0
  18. data_advisor-0.2.0/src/data_advisor/code_bank/04_mqtt_esp32_python/subscriber.py +30 -0
  19. data_advisor-0.2.0/src/data_advisor/code_bank/05_http_rest_supabase/README.md +30 -0
  20. data_advisor-0.2.0/src/data_advisor/code_bank/05_http_rest_supabase/app_http.py +63 -0
  21. data_advisor-0.2.0/src/data_advisor/code_bank/05_http_rest_supabase/send_http_data.py +54 -0
  22. data_advisor-0.2.0/src/data_advisor/code_bank/06_mqtt_cloud_dashboard/README.md +19 -0
  23. data_advisor-0.2.0/src/data_advisor/code_bank/06_mqtt_cloud_dashboard/app.py +66 -0
  24. data_advisor-0.2.0/src/data_advisor/code_bank/06_mqtt_cloud_dashboard/mqtt_bridge.py +74 -0
  25. data_advisor-0.2.0/src/data_advisor/code_bank/06_mqtt_cloud_dashboard/publisher.py +30 -0
  26. data_advisor-0.2.0/src/data_advisor/code_bank/07_thingsboard_simulation/README.md +20 -0
  27. data_advisor-0.2.0/src/data_advisor/code_bank/07_thingsboard_simulation/environmental_dashboard.json +190 -0
  28. data_advisor-0.2.0/src/data_advisor/code_bank/07_thingsboard_simulation/simulate_thingsboard.py +32 -0
  29. data_advisor-0.2.0/src/data_advisor/code_bank/08_coap_server_client_dashboard/README.md +20 -0
  30. data_advisor-0.2.0/src/data_advisor/code_bank/08_coap_server_client_dashboard/client.py +24 -0
  31. data_advisor-0.2.0/src/data_advisor/code_bank/08_coap_server_client_dashboard/server.py +25 -0
  32. data_advisor-0.2.0/src/data_advisor/code_bank/09_mqtt_hivemq_mosquitto_dual/README.md +13 -0
  33. data_advisor-0.2.0/src/data_advisor/code_bank/09_mqtt_hivemq_mosquitto_dual/dual_broker.py +60 -0
  34. data_advisor-0.2.0/src/data_advisor/code_bank/10_coap_openmeteo_cloud/README.md +19 -0
  35. data_advisor-0.2.0/src/data_advisor/code_bank/10_coap_openmeteo_cloud/app.py +69 -0
  36. data_advisor-0.2.0/src/data_advisor/code_bank/10_coap_openmeteo_cloud/server.py +49 -0
  37. data_advisor-0.2.0/src/data_advisor/code_bank/11_iss_tracker/README.md +15 -0
  38. data_advisor-0.2.0/src/data_advisor/code_bank/11_iss_tracker/iss_location.csv +101 -0
  39. data_advisor-0.2.0/src/data_advisor/code_bank/11_iss_tracker/iss_tracker.py +76 -0
  40. data_advisor-0.2.0/src/data_advisor/code_bank/11_iss_tracker/iss_trajectory.png +0 -0
  41. data_advisor-0.2.0/src/data_advisor/code_bank/12_earthquake_dashboard/README.md +14 -0
  42. data_advisor-0.2.0/src/data_advisor/code_bank/12_earthquake_dashboard/app.py +67 -0
  43. data_advisor-0.2.0/src/data_advisor/code_bank/13_weather_analysis/README.md +14 -0
  44. data_advisor-0.2.0/src/data_advisor/code_bank/13_weather_analysis/weather_analysis.py +46 -0
  45. data_advisor-0.2.0/src/data_advisor/code_bank/13_weather_analysis/weather_trends.png +0 -0
  46. data_advisor-0.2.0/src/data_advisor/code_bank/14_air_quality_kochi/README.md +14 -0
  47. data_advisor-0.2.0/src/data_advisor/code_bank/14_air_quality_kochi/app.py +60 -0
  48. data_advisor-0.2.0/src/data_advisor/code_bank/15_decision_tree_occupancy/README.md +22 -0
  49. data_advisor-0.2.0/src/data_advisor/code_bank/15_decision_tree_occupancy/datatraining.txt +8144 -0
  50. data_advisor-0.2.0/src/data_advisor/code_bank/15_decision_tree_occupancy/occupancy_app.py +74 -0
  51. data_advisor-0.2.0/src/data_advisor/code_bank/15_decision_tree_occupancy/occupancy_cli.py +64 -0
  52. data_advisor-0.2.0/src/data_advisor/code_bank/16_linear_regression_beijing/PRSA_Data_Aotizhongxin_20130301-20170228.csv +35065 -0
  53. data_advisor-0.2.0/src/data_advisor/code_bank/16_linear_regression_beijing/README.md +22 -0
  54. data_advisor-0.2.0/src/data_advisor/code_bank/16_linear_regression_beijing/temperature_app.py +71 -0
  55. data_advisor-0.2.0/src/data_advisor/code_bank/16_linear_regression_beijing/temperature_cli.py +70 -0
  56. data_advisor-0.2.0/src/data_advisor/code_bank/17_random_forest_air_quality/README.md +22 -0
  57. data_advisor-0.2.0/src/data_advisor/code_bank/17_random_forest_air_quality/air_quality_app.py +79 -0
  58. data_advisor-0.2.0/src/data_advisor/code_bank/17_random_forest_air_quality/air_quality_cli.py +78 -0
  59. data_advisor-0.2.0/src/data_advisor/code_bank/17_random_forest_air_quality/city_day.csv +29532 -0
  60. data_advisor-0.2.0/src/data_advisor/code_bank/Data.csv +11 -0
  61. data_advisor-0.2.0/src/data_advisor/code_bank/IoT_Lab_Cycle.docx +0 -0
  62. data_advisor-0.2.0/src/data_advisor/code_bank/Lab Questions.docx +0 -0
  63. data_advisor-0.2.0/src/data_advisor/code_bank/alphabet_stock_data.csv +263 -0
  64. data_advisor-0.2.0/src/data_advisor/code_bank/company.db +0 -0
  65. data_advisor-0.2.0/src/data_advisor/code_bank/dirtydata.csv +16 -0
  66. data_advisor-0.2.0/src/data_advisor/code_bank/groceries.csv +9835 -0
  67. data_advisor-0.2.0/src/data_advisor/code_bank/library.db +0 -0
  68. data_advisor-0.2.0/src/data_advisor/code_bank/main_analyzer.py +46 -0
  69. data_advisor-0.2.0/src/data_advisor/code_bank/msc_admissions.db +0 -0
  70. data_advisor-0.2.0/src/data_advisor/code_bank/question_01.py +54 -0
  71. data_advisor-0.2.0/src/data_advisor/code_bank/question_02.py +50 -0
  72. data_advisor-0.2.0/src/data_advisor/code_bank/question_03.py +47 -0
  73. data_advisor-0.2.0/src/data_advisor/code_bank/question_04.py +78 -0
  74. data_advisor-0.2.0/src/data_advisor/code_bank/question_05.py +92 -0
  75. data_advisor-0.2.0/src/data_advisor/code_bank/question_06.py +66 -0
  76. data_advisor-0.2.0/src/data_advisor/code_bank/question_07.py +63 -0
  77. data_advisor-0.2.0/src/data_advisor/code_bank/question_08.py +101 -0
  78. data_advisor-0.2.0/src/data_advisor/code_bank/question_09.py +58 -0
  79. data_advisor-0.2.0/src/data_advisor/code_bank/question_10.py +83 -0
  80. data_advisor-0.2.0/src/data_advisor/code_bank/question_11.py +49 -0
  81. data_advisor-0.2.0/src/data_advisor/code_bank/question_12.py +81 -0
  82. data_advisor-0.2.0/src/data_advisor/code_bank/question_13.py +81 -0
  83. data_advisor-0.2.0/src/data_advisor/code_bank/question_14.py +52 -0
  84. data_advisor-0.2.0/src/data_advisor/code_bank/question_15.py +72 -0
  85. data_advisor-0.2.0/src/data_advisor/code_bank/question_16.py +73 -0
  86. data_advisor-0.2.0/src/data_advisor/code_bank/question_17.py +60 -0
  87. data_advisor-0.2.0/src/data_advisor/code_bank/question_18.py +51 -0
  88. data_advisor-0.2.0/src/data_advisor/code_bank/question_19.py +80 -0
  89. data_advisor-0.2.0/src/data_advisor/code_bank/question_20.py +60 -0
  90. data_advisor-0.2.0/src/data_advisor/code_bank/question_21.py +52 -0
  91. data_advisor-0.2.0/src/data_advisor/code_bank/question_22.py +41 -0
  92. data_advisor-0.2.0/src/data_advisor/code_bank/question_23.py +101 -0
  93. data_advisor-0.2.0/src/data_advisor/code_bank/question_24.py +84 -0
  94. data_advisor-0.2.0/src/data_advisor/code_bank/question_25.py +167 -0
  95. data_advisor-0.2.0/src/data_advisor/code_bank/question_26.py +229 -0
  96. data_advisor-0.2.0/src/data_advisor/code_bank/question_27.py +148 -0
  97. data_advisor-0.2.0/src/data_advisor/code_bank/question_28.py +81 -0
  98. data_advisor-0.2.0/src/data_advisor/code_bank/question_29.py +112 -0
  99. data_advisor-0.2.0/src/data_advisor/code_bank/question_30.py +165 -0
  100. data_advisor-0.2.0/src/data_advisor/code_bank/question_31.py +73 -0
  101. data_advisor-0.2.0/src/data_advisor/code_bank/question_32.py +59 -0
  102. data_advisor-0.2.0/src/data_advisor/code_bank/question_33.py +60 -0
  103. data_advisor-0.2.0/src/data_advisor/code_bank/question_34.py +60 -0
  104. data_advisor-0.2.0/src/data_advisor/code_bank/question_35.py +67 -0
  105. data_advisor-0.2.0/src/data_advisor/code_bank/question_36.py +65 -0
  106. data_advisor-0.2.0/src/data_advisor/code_bank/question_37.py +61 -0
  107. data_advisor-0.2.0/src/data_advisor/code_bank/question_38.py +70 -0
  108. data_advisor-0.2.0/src/data_advisor/code_bank/question_39.py +65 -0
  109. data_advisor-0.2.0/src/data_advisor/code_bank/question_40.py +86 -0
  110. data_advisor-0.2.0/src/data_advisor/code_bank/question_41.py +71 -0
  111. data_advisor-0.2.0/src/data_advisor/code_bank/question_42.py +72 -0
  112. data_advisor-0.2.0/src/data_advisor/code_bank/question_43.py +63 -0
  113. data_advisor-0.2.0/src/data_advisor/code_bank/question_44.py +107 -0
  114. data_advisor-0.2.0/src/data_advisor/code_bank/question_45.py +74 -0
  115. data_advisor-0.2.0/src/data_advisor/code_bank/question_46.py +65 -0
  116. data_advisor-0.2.0/src/data_advisor/code_bank/question_47.py +112 -0
  117. data_advisor-0.2.0/src/data_advisor/code_bank/question_48.py +86 -0
  118. data_advisor-0.2.0/src/data_advisor/code_bank/question_49.py +128 -0
  119. data_advisor-0.2.0/src/data_advisor/code_bank/question_50.py +104 -0
  120. data_advisor-0.2.0/src/data_advisor/code_bank/question_51.py +81 -0
  121. data_advisor-0.2.0/src/data_advisor/code_bank/question_52.py +100 -0
  122. data_advisor-0.2.0/src/data_advisor/code_bank/rainfall_data.csv +10 -0
  123. data_advisor-0.2.0/src/data_advisor/code_bank/rainfall_summary.csv +8 -0
  124. data_advisor-0.2.0/src/data_advisor/code_bank/sample.txt +4 -0
  125. data_advisor-0.2.0/src/data_advisor/code_bank/students.csv +7 -0
  126. data_advisor-0.2.0/src/data_advisor/code_bank/temperature_vs_day.png +0 -0
  127. data_advisor-0.2.0/src/data_advisor/code_bank/text_analyzer.py +18 -0
  128. data_advisor-0.2.0/src/data_advisor/code_bank/text_preprocessor.py +16 -0
  129. data_advisor-0.2.0/src/data_advisor/code_bank/weather_trends.png +0 -0
  130. data_advisor-0.2.0/src/data_advisor/code_bank/winequality-red.csv +1600 -0
  131. data_advisor-0.2.0/src/data_advisor/code_bank/winequality-white.csv +4899 -0
  132. {data_advisor-0.1.0 → data_advisor-0.2.0}/src/data_advisor/search.py +22 -11
  133. data_advisor-0.2.0/src/data_advisor.egg-info/PKG-INFO +147 -0
  134. data_advisor-0.2.0/src/data_advisor.egg-info/SOURCES.txt +146 -0
  135. {data_advisor-0.1.0 → data_advisor-0.2.0}/tests/test_advisor.py +30 -0
  136. data_advisor-0.1.0/PKG-INFO +0 -303
  137. data_advisor-0.1.0/README.md +0 -272
  138. data_advisor-0.1.0/src/data_advisor.egg-info/PKG-INFO +0 -303
  139. data_advisor-0.1.0/src/data_advisor.egg-info/SOURCES.txt +0 -18
  140. {data_advisor-0.1.0 → data_advisor-0.2.0}/setup.cfg +0 -0
  141. {data_advisor-0.1.0 → data_advisor-0.2.0}/src/data_advisor/__init__.py +0 -0
  142. {data_advisor-0.1.0 → data_advisor-0.2.0}/src/data_advisor/__main__.py +0 -0
  143. {data_advisor-0.1.0 → data_advisor-0.2.0}/src/data_advisor/advisor.py +0 -0
  144. {data_advisor-0.1.0 → data_advisor-0.2.0}/src/data_advisor/cli.py +0 -0
  145. {data_advisor-0.1.0 → data_advisor-0.2.0}/src/data_advisor/codegen.py +0 -0
  146. {data_advisor-0.1.0 → data_advisor-0.2.0}/src/data_advisor/rules.py +0 -0
  147. {data_advisor-0.1.0 → data_advisor-0.2.0}/src/data_advisor/scanner.py +0 -0
  148. {data_advisor-0.1.0 → data_advisor-0.2.0}/src/data_advisor/visualizer.py +0 -0
  149. {data_advisor-0.1.0 → data_advisor-0.2.0}/src/data_advisor.egg-info/dependency_links.txt +0 -0
  150. {data_advisor-0.1.0 → data_advisor-0.2.0}/src/data_advisor.egg-info/entry_points.txt +0 -0
  151. {data_advisor-0.1.0 → data_advisor-0.2.0}/src/data_advisor.egg-info/requires.txt +0 -0
  152. {data_advisor-0.1.0 → data_advisor-0.2.0}/src/data_advisor.egg-info/top_level.txt +0 -0
@@ -0,0 +1,147 @@
1
+ Metadata-Version: 2.4
2
+ Name: data_advisor
3
+ Version: 0.2.0
4
+ Summary: A production-grade diagnostic and code generation advisor for timed data analysis exams and rapid exploratory data science.
5
+ Author: Principal Data Science Architect
6
+ License-Expression: MIT
7
+ Keywords: data-analysis,eda,data-science,hypothesis-testing,code-generation,machine-learning,automated-eda,pandas,scipy,scikit-learn
8
+ Classifier: Development Status :: 4 - Beta
9
+ Classifier: Intended Audience :: Developers
10
+ Classifier: Intended Audience :: Education
11
+ Classifier: Intended Audience :: Science/Research
12
+ Classifier: Programming Language :: Python :: 3
13
+ Classifier: Programming Language :: Python :: 3.9
14
+ Classifier: Programming Language :: Python :: 3.10
15
+ Classifier: Programming Language :: Python :: 3.11
16
+ Classifier: Programming Language :: Python :: 3.12
17
+ Classifier: Programming Language :: Python :: 3.13
18
+ Classifier: Topic :: Scientific/Engineering :: Information Analysis
19
+ Classifier: Topic :: Software Development :: Code Generators
20
+ Requires-Python: >=3.9
21
+ Description-Content-Type: text/markdown
22
+ Requires-Dist: pandas>=2.0.0
23
+ Requires-Dist: numpy>=1.24.0
24
+ Requires-Dist: scipy>=1.10.0
25
+ Requires-Dist: scikit-learn>=1.2.0
26
+ Requires-Dist: matplotlib>=3.7.0
27
+ Requires-Dist: seaborn>=0.12.0
28
+ Provides-Extra: dev
29
+ Requires-Dist: pytest>=7.0.0; extra == "dev"
30
+ Requires-Dist: pytest-cov>=4.0.0; extra == "dev"
31
+
32
+ # DataAdvisor (`data-advisor`)
33
+
34
+ Quick guide on how to upload this package to PyPI and how to use it on any other system.
35
+
36
+ ---
37
+
38
+ ## 🚀 Part 1: How to Upload to PyPI (From This System)
39
+
40
+ Run these commands in PowerShell inside this directory:
41
+
42
+ ### 1. Build the Package
43
+ ```powershell
44
+ python -m build
45
+ ```
46
+ *(This bundles all 52 DAUP questions and 17 IoT lab solutions directly inside the package).*
47
+
48
+ ### 2. Upload to PyPI
49
+ ```powershell
50
+ python -m twine upload dist/*
51
+ ```
52
+ - **Username**: `__token__`
53
+ - **Password**: `<paste your PyPI API token starting with pypi-...>`
54
+
55
+ > If you don't have a token yet: Register at [pypi.org](https://pypi.org), enable 2FA in Account Settings, and create an API Token.
56
+
57
+ ---
58
+
59
+ ## 💻 Part 2: What to Do on Other Systems
60
+
61
+ Once uploaded, on **any other computer, VM, or lab machine** with Python installed:
62
+
63
+ ### 1. Install via `pip`
64
+ ```bash
65
+ pip install data-advisor
66
+ ```
67
+
68
+ ---
69
+
70
+ ### 2. How to Use on the Other System
71
+
72
+ #### A. View / Retrieve Complete Code Files
73
+ Directly from terminal:
74
+ ```bash
75
+ # View complete code with header & line count:
76
+ data-advisor --get q1
77
+ data-advisor --get q24 --line-numbers
78
+ data-advisor --get q52
79
+
80
+ # View IoT sketches and scripts:
81
+ data-advisor --get sketch.ino
82
+ data-advisor --get weather_analysis.py
83
+
84
+ # List all available 52 questions & 17 IoT projects:
85
+ data-advisor --list
86
+ ```
87
+
88
+ Or inside Python / Jupyter Notebook:
89
+ ```python
90
+ from data_advisor import get_file, read_file
91
+
92
+ # Print complete code directly:
93
+ get_file("q1")
94
+ get_file(24, line_numbers=True)
95
+
96
+ # Or get the code as a string to copy / save:
97
+ code = read_file("q24")
98
+ ```
99
+
100
+ ---
101
+
102
+ #### B. Run Any File Directly
103
+ Execute any question or project script directly:
104
+ ```bash
105
+ data-advisor --run q24
106
+ data-advisor --run 10
107
+ data-advisor --run iss
108
+ ```
109
+
110
+ Or inside Python:
111
+ ```python
112
+ from data_advisor import run_file
113
+ run_file("q24")
114
+ ```
115
+
116
+ ---
117
+
118
+ #### C. Search by Keyword
119
+ ```bash
120
+ data-advisor --search "linear regression"
121
+ data-advisor --search "dht22"
122
+ data-advisor --search "kmeans"
123
+ ```
124
+
125
+ Or inside Python:
126
+ ```python
127
+ from data_advisor import search
128
+ search("linear regression")
129
+ ```
130
+
131
+ ---
132
+
133
+ #### D. Audit Any Exam Dataset & Generate Python Code
134
+ When given an exam dataset (e.g. `exam_dataset.csv`):
135
+ ```bash
136
+ # Print diagnostic report + complete executable Python solution:
137
+ data-advisor exam_dataset.csv --target churn --code
138
+
139
+ # Save generated Python script directly to a file:
140
+ data-advisor exam_dataset.csv --target churn --output solution.py
141
+ ```
142
+
143
+ Or inside Python:
144
+ ```python
145
+ from data_advisor import data_advisor
146
+ data_advisor("exam_dataset.csv", target="churn")
147
+ ```
@@ -0,0 +1,116 @@
1
+ # DataAdvisor (`data-advisor`)
2
+
3
+ Quick guide on how to upload this package to PyPI and how to use it on any other system.
4
+
5
+ ---
6
+
7
+ ## 🚀 Part 1: How to Upload to PyPI (From This System)
8
+
9
+ Run these commands in PowerShell inside this directory:
10
+
11
+ ### 1. Build the Package
12
+ ```powershell
13
+ python -m build
14
+ ```
15
+ *(This bundles all 52 DAUP questions and 17 IoT lab solutions directly inside the package).*
16
+
17
+ ### 2. Upload to PyPI
18
+ ```powershell
19
+ python -m twine upload dist/*
20
+ ```
21
+ - **Username**: `__token__`
22
+ - **Password**: `<paste your PyPI API token starting with pypi-...>`
23
+
24
+ > If you don't have a token yet: Register at [pypi.org](https://pypi.org), enable 2FA in Account Settings, and create an API Token.
25
+
26
+ ---
27
+
28
+ ## 💻 Part 2: What to Do on Other Systems
29
+
30
+ Once uploaded, on **any other computer, VM, or lab machine** with Python installed:
31
+
32
+ ### 1. Install via `pip`
33
+ ```bash
34
+ pip install data-advisor
35
+ ```
36
+
37
+ ---
38
+
39
+ ### 2. How to Use on the Other System
40
+
41
+ #### A. View / Retrieve Complete Code Files
42
+ Directly from terminal:
43
+ ```bash
44
+ # View complete code with header & line count:
45
+ data-advisor --get q1
46
+ data-advisor --get q24 --line-numbers
47
+ data-advisor --get q52
48
+
49
+ # View IoT sketches and scripts:
50
+ data-advisor --get sketch.ino
51
+ data-advisor --get weather_analysis.py
52
+
53
+ # List all available 52 questions & 17 IoT projects:
54
+ data-advisor --list
55
+ ```
56
+
57
+ Or inside Python / Jupyter Notebook:
58
+ ```python
59
+ from data_advisor import get_file, read_file
60
+
61
+ # Print complete code directly:
62
+ get_file("q1")
63
+ get_file(24, line_numbers=True)
64
+
65
+ # Or get the code as a string to copy / save:
66
+ code = read_file("q24")
67
+ ```
68
+
69
+ ---
70
+
71
+ #### B. Run Any File Directly
72
+ Execute any question or project script directly:
73
+ ```bash
74
+ data-advisor --run q24
75
+ data-advisor --run 10
76
+ data-advisor --run iss
77
+ ```
78
+
79
+ Or inside Python:
80
+ ```python
81
+ from data_advisor import run_file
82
+ run_file("q24")
83
+ ```
84
+
85
+ ---
86
+
87
+ #### C. Search by Keyword
88
+ ```bash
89
+ data-advisor --search "linear regression"
90
+ data-advisor --search "dht22"
91
+ data-advisor --search "kmeans"
92
+ ```
93
+
94
+ Or inside Python:
95
+ ```python
96
+ from data_advisor import search
97
+ search("linear regression")
98
+ ```
99
+
100
+ ---
101
+
102
+ #### D. Audit Any Exam Dataset & Generate Python Code
103
+ When given an exam dataset (e.g. `exam_dataset.csv`):
104
+ ```bash
105
+ # Print diagnostic report + complete executable Python solution:
106
+ data-advisor exam_dataset.csv --target churn --code
107
+
108
+ # Save generated Python script directly to a file:
109
+ data-advisor exam_dataset.csv --target churn --output solution.py
110
+ ```
111
+
112
+ Or inside Python:
113
+ ```python
114
+ from data_advisor import data_advisor
115
+ data_advisor("exam_dataset.csv", target="churn")
116
+ ```
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
4
4
 
5
5
  [project]
6
6
  name = "data_advisor"
7
- version = "0.1.0"
7
+ version = "0.2.0"
8
8
  description = "A production-grade diagnostic and code generation advisor for timed data analysis exams and rapid exploratory data science."
9
9
  readme = "README.md"
10
10
  requires-python = ">=3.9"
@@ -59,6 +59,10 @@ data-advisor = "data_advisor.cli:main"
59
59
  [tool.setuptools.packages.find]
60
60
  where = ["src"]
61
61
 
62
+ [tool.setuptools.package-data]
63
+ "*" = ["code_bank/**/*", "code_bank/*"]
64
+ data_advisor = ["code_bank/**/*", "code_bank/*"]
65
+
62
66
  [tool.pytest.ini_options]
63
67
  testpaths = ["tests"]
64
68
  python_files = ["test_*.py"]
@@ -0,0 +1,17 @@
1
+ # Experiment 1: ESP32 DHT22 Temperature & Humidity Sensor
2
+
3
+ ## Objective
4
+ Read ambient temperature and relative humidity using a DHT22 sensor with ESP32 and output values via Serial Communication.
5
+
6
+ ## Hardware Wiring (Wokwi / Physical)
7
+ - DHT22 VCC -> ESP32 3V3
8
+ - DHT22 SDA -> ESP32 GPIO 18
9
+ - DHT22 GND -> ESP32 GND
10
+
11
+ ## How to Run in Wokwi
12
+ 1. Open [wokwi.com](https://wokwi.com) and create an ESP32 project.
13
+ 2. Paste `sketch.ino` into the code tab.
14
+ 3. Paste `diagram.json` into the `diagram.json` tab.
15
+ 4. Ensure `libraries.txt` includes `DHT sensor library` and `Adafruit Unified Sensor`.
16
+ 5. Click **Start Simulation (Play)**.
17
+ 6. Open the **Serial Monitor** (115200 baud) to view sensor readings. Adjust sliders on DHT22 to see live updates.
@@ -0,0 +1,17 @@
1
+ {
2
+ "version": 1,
3
+ "author": "IoT Lab",
4
+ "editor": "wokwi",
5
+ "parts": [
6
+ { "type": "board-esp32-devkit-c-v4", "id": "esp", "top": 0, "left": 0, "attrs": {} },
7
+ { "type": "wokwi-dht22", "id": "dht1", "top": 0.3, "left": -159, "attrs": {} }
8
+ ],
9
+ "connections": [
10
+ [ "esp:TX", "$serialMonitor:RX", "", [] ],
11
+ [ "esp:RX", "$serialMonitor:TX", "", [] ],
12
+ [ "dht1:GND", "esp:GND.2", "black", [ "v0" ] ],
13
+ [ "dht1:VCC", "esp:3V3", "red", [ "v0" ] ],
14
+ [ "dht1:SDA", "esp:18", "green", [ "v0" ] ]
15
+ ],
16
+ "dependencies": {}
17
+ }
@@ -0,0 +1,2 @@
1
+ DHT sensor library
2
+ Adafruit Unified Sensor
@@ -0,0 +1,31 @@
1
+ #include <DHT.h>
2
+
3
+ #define DHT_PIN 18
4
+ #define DHT_TYPE DHT22
5
+
6
+ DHT dht(DHT_PIN, DHT_TYPE);
7
+
8
+ void setup() {
9
+ Serial.begin(115200);
10
+ delay(1000);
11
+ dht.begin();
12
+ Serial.println("System Initialized! Reading DHT22 data...");
13
+ }
14
+
15
+ void loop() {
16
+ float temperature = dht.readTemperature();
17
+ float humidity = dht.readHumidity();
18
+
19
+ if (isnan(temperature) || isnan(humidity)) {
20
+ Serial.println("Failed to read from DHT sensor!");
21
+ return;
22
+ }
23
+
24
+ Serial.print("Temperature: ");
25
+ Serial.print(temperature);
26
+ Serial.print(" °C | Humidity: ");
27
+ Serial.print(humidity);
28
+ Serial.println(" %");
29
+
30
+ delay(2000);
31
+ }
@@ -0,0 +1,15 @@
1
+ # Experiment 2: ESP32 LDR Light Intensity Monitoring
2
+
3
+ ## Objective
4
+ Read digital ambient light levels using an LDR sensor module and display the status via Serial Communication.
5
+
6
+ ## Hardware Wiring
7
+ - LDR VCC -> ESP32 3V3
8
+ - LDR GND -> ESP32 GND
9
+ - LDR DO (Digital Output) -> ESP32 GPIO 34
10
+
11
+ ## How to Run in Wokwi
12
+ 1. Load `sketch.ino` and `diagram.json` into Wokwi.
13
+ 2. Click **Start Simulation**.
14
+ 3. View the **Serial Monitor** (115200 baud).
15
+ 4. Click on the LDR sensor in Wokwi and adjust the Lux slider to toggle between BRIGHT and DARK.
@@ -0,0 +1,17 @@
1
+ {
2
+ "version": 1,
3
+ "author": "IoT Lab",
4
+ "editor": "wokwi",
5
+ "parts": [
6
+ { "type": "board-esp32-devkit-c-v4", "id": "esp", "top": 0, "left": 0, "attrs": {} },
7
+ { "type": "wokwi-photoresistor-sensor", "id": "ldr1", "top": 0.3, "left": -159, "attrs": {} }
8
+ ],
9
+ "connections": [
10
+ [ "esp:TX", "$serialMonitor:RX", "", [] ],
11
+ [ "esp:RX", "$serialMonitor:TX", "", [] ],
12
+ [ "ldr1:GND", "esp:GND.2", "black", [ "v0" ] ],
13
+ [ "ldr1:VCC", "esp:3V3", "red", [ "v0" ] ],
14
+ [ "ldr1:DO", "esp:34", "green", [ "v0" ] ]
15
+ ],
16
+ "dependencies": {}
17
+ }
@@ -0,0 +1,21 @@
1
+ #define LDR_PIN 34
2
+
3
+ void setup() {
4
+ Serial.begin(115200);
5
+ delay(1000);
6
+ pinMode(LDR_PIN, INPUT);
7
+ Serial.println("LDR Monitoring Initialized.");
8
+ }
9
+
10
+ void loop() {
11
+ int lightStatus = digitalRead(LDR_PIN);
12
+
13
+ Serial.print("Light Status: ");
14
+ if (lightStatus == LOW) {
15
+ Serial.println("BRIGHT (Light Detected)");
16
+ } else {
17
+ Serial.println("DARK (No Light)");
18
+ }
19
+
20
+ delay(1000);
21
+ }
@@ -0,0 +1,14 @@
1
+ # Experiment 3: ESP32 PIR Motion Detection
2
+
3
+ ## Objective
4
+ Detect human/infrared motion using a PIR sensor module and report motion events over Serial Communication.
5
+
6
+ ## Hardware Wiring
7
+ - PIR VCC -> ESP32 3V3
8
+ - PIR GND -> ESP32 GND
9
+ - PIR OUT -> ESP32 GPIO 27
10
+
11
+ ## How to Run in Wokwi
12
+ 1. Load `sketch.ino` and `diagram.json` into Wokwi.
13
+ 2. Start the simulation.
14
+ 3. In Wokwi, click on the PIR sensor and click "Simulate motion" to trigger `MOTION DETECTED!`.
@@ -0,0 +1,17 @@
1
+ {
2
+ "version": 1,
3
+ "author": "IoT Lab",
4
+ "editor": "wokwi",
5
+ "parts": [
6
+ { "type": "board-esp32-devkit-c-v4", "id": "esp", "top": 0, "left": 0, "attrs": {} },
7
+ { "type": "wokwi-pir-motion-sensor", "id": "pir1", "top": 0.3, "left": -159, "attrs": {} }
8
+ ],
9
+ "connections": [
10
+ [ "esp:TX", "$serialMonitor:RX", "", [] ],
11
+ [ "esp:RX", "$serialMonitor:TX", "", [] ],
12
+ [ "pir1:GND", "esp:GND.2", "black", [ "v0" ] ],
13
+ [ "pir1:VCC", "esp:3V3", "red", [ "v0" ] ],
14
+ [ "pir1:OUT", "esp:27", "green", [ "v0" ] ]
15
+ ],
16
+ "dependencies": {}
17
+ }
@@ -0,0 +1,20 @@
1
+ #define PIR_PIN 27
2
+
3
+ void setup() {
4
+ Serial.begin(115200);
5
+ delay(1000);
6
+ pinMode(PIR_PIN, INPUT);
7
+ Serial.println("PIR Motion Detection Initialized.");
8
+ }
9
+
10
+ void loop() {
11
+ int motionStatus = digitalRead(PIR_PIN);
12
+
13
+ if (motionStatus == HIGH) {
14
+ Serial.println("MOTION DETECTED!");
15
+ } else {
16
+ Serial.println("No motion.");
17
+ }
18
+
19
+ delay(500);
20
+ }
@@ -0,0 +1,19 @@
1
+ # Experiment 4: ESP32 MQTT Publisher & Python Subscriber
2
+
3
+ ## Objective
4
+ Read temperature and humidity with an ESP32 and publish the readings to HiveMQ public MQTT broker. A local Python script subscribes and displays incoming data in real time.
5
+
6
+ ## Requirements
7
+ - Python package: `pip install paho-mqtt`
8
+ - Wokwi libraries: `DHT sensor library`, `PubSubClient`, `Adafruit Unified Sensor`
9
+
10
+ ## Execution Steps
11
+ 1. **Run Python Subscriber:**
12
+ ```bash
13
+ python subscriber.py
14
+ ```
15
+ 2. **Run ESP32 Publisher in Wokwi:**
16
+ - Paste `sketch.ino`, `diagram.json`, and `libraries.txt`.
17
+ - Click Play in Wokwi.
18
+ - ESP32 connects to `Wokwi-GUEST` WiFi and publishes data to `broker.hivemq.com`.
19
+ 3. Observe live sensor data appearing in your terminal.
@@ -0,0 +1,17 @@
1
+ {
2
+ "version": 1,
3
+ "author": "IoT Lab",
4
+ "editor": "wokwi",
5
+ "parts": [
6
+ { "type": "board-esp32-devkit-c-v4", "id": "esp", "top": 0, "left": 0, "attrs": {} },
7
+ { "type": "wokwi-dht22", "id": "dht1", "top": 0.3, "left": -159, "attrs": {} }
8
+ ],
9
+ "connections": [
10
+ [ "esp:TX", "$serialMonitor:RX", "", [] ],
11
+ [ "esp:RX", "$serialMonitor:TX", "", [] ],
12
+ [ "dht1:GND", "esp:GND.2", "black", [ "v0" ] ],
13
+ [ "dht1:VCC", "esp:3V3", "red", [ "v0" ] ],
14
+ [ "dht1:SDA", "esp:4", "green", [ "v0" ] ]
15
+ ],
16
+ "dependencies": {}
17
+ }
@@ -0,0 +1,3 @@
1
+ DHT sensor library
2
+ PubSubClient
3
+ Adafruit Unified Sensor
@@ -0,0 +1,87 @@
1
+ #include <WiFi.h>
2
+ #include <PubSubClient.h>
3
+ #include <DHT.h>
4
+
5
+ const char* ssid = "Wokwi-GUEST";
6
+ const char* password = "";
7
+
8
+ const char* mqtt_server = "broker.hivemq.com";
9
+ const int mqtt_port = 1883;
10
+
11
+ const char* temp_topic = "iot_lab_test/temp";
12
+ const char* hum_topic = "iot_lab_test/humidity";
13
+
14
+ #define DHTPIN 4
15
+ #define DHTTYPE DHT22
16
+ DHT dht(DHTPIN, DHTTYPE);
17
+
18
+ WiFiClient espClient;
19
+ PubSubClient client(espClient);
20
+
21
+ void setup_wifi() {
22
+ delay(10);
23
+ Serial.print("Connecting to WiFi: ");
24
+ Serial.println(ssid);
25
+
26
+ WiFi.mode(WIFI_STA);
27
+ WiFi.begin(ssid, password);
28
+
29
+ while (WiFi.status() != WL_CONNECTED) {
30
+ delay(500);
31
+ Serial.print(".");
32
+ }
33
+
34
+ Serial.println("\nWiFi connected: ");
35
+ Serial.println(WiFi.localIP());
36
+ }
37
+
38
+ void reconnect() {
39
+ while (!client.connected()) {
40
+ Serial.print("Connecting to MQTT broker...");
41
+ String clientId = "ESP32-" + String(random(0xffff), HEX);
42
+ if (client.connect(clientId.c_str())) {
43
+ Serial.println("connected");
44
+ } else {
45
+ Serial.print("failed, rc=");
46
+ Serial.print(client.state());
47
+ Serial.println(" retrying in 5 seconds");
48
+ delay(5000);
49
+ }
50
+ }
51
+ }
52
+
53
+ void setup() {
54
+ Serial.begin(115200);
55
+ delay(1000);
56
+ dht.begin();
57
+ setup_wifi();
58
+ client.setServer(mqtt_server, mqtt_port);
59
+ }
60
+
61
+ void loop() {
62
+ if (!client.connected()) {
63
+ reconnect();
64
+ }
65
+ client.loop();
66
+
67
+ delay(2000);
68
+
69
+ float temperature = dht.readTemperature();
70
+ float humidity = dht.readHumidity();
71
+
72
+ if (isnan(temperature) || isnan(humidity)) {
73
+ Serial.println("Failed to read from DHT sensor!");
74
+ return;
75
+ }
76
+
77
+ String temp_str = String(temperature, 2);
78
+ String humidity_str = String(humidity, 2);
79
+
80
+ client.publish(temp_topic, temp_str.c_str());
81
+ client.publish(hum_topic, humidity_str.c_str());
82
+
83
+ Serial.print("Published: Temp=");
84
+ Serial.print(temp_str);
85
+ Serial.print(" C | Hum=");
86
+ Serial.println(humidity_str);
87
+ }
@@ -0,0 +1,30 @@
1
+ import paho.mqtt.client as mqtt
2
+
3
+ BROKER = "broker.hivemq.com"
4
+ PORT = 1883
5
+ TEMP_TOPIC = "iot_lab_test/temp"
6
+ HUMIDITY_TOPIC = "iot_lab_test/humidity"
7
+
8
+ def on_connect(client, userdata, flags, rc, *extra):
9
+ if rc == 0:
10
+ print("Connected to HiveMQ broker successfully.")
11
+ client.subscribe(TEMP_TOPIC)
12
+ client.subscribe(HUMIDITY_TOPIC)
13
+ print("Subscribed to:", TEMP_TOPIC, "and", HUMIDITY_TOPIC)
14
+ else:
15
+ print("Connection failed with return code:", rc)
16
+
17
+ def on_message(client, userdata, msg):
18
+ print(f"[{msg.topic}] : {msg.payload.decode()}")
19
+
20
+ try:
21
+ client = mqtt.Client(mqtt.CallbackAPIVersion.VERSION2)
22
+ except AttributeError:
23
+ client = mqtt.Client()
24
+
25
+ client.on_connect = on_connect
26
+ client.on_message = on_message
27
+
28
+ print("Connecting to MQTT Broker...")
29
+ client.connect(BROKER, PORT, 60)
30
+ client.loop_forever()
@@ -0,0 +1,30 @@
1
+ # Experiment 5: HTTP REST API Cloud Storage & Web Dashboard
2
+
3
+ ## Objective
4
+ Transmit sensor data to a cloud database via HTTP POST requests and render records on an interactive web dashboard.
5
+
6
+ ## Requirements
7
+ ```bash
8
+ pip install requests streamlit pandas
9
+ ```
10
+
11
+ ## Cloud DB Table Setup (Supabase SQL)
12
+ ```sql
13
+ create table sensor_readings (
14
+ id bigint generated by default as identity primary key,
15
+ created_at timestamp with time zone default timezone('utc'::text, now()) not null,
16
+ temperature float not null,
17
+ humidity float not null
18
+ );
19
+ ```
20
+
21
+ ## Execution
22
+ 1. Update `SUPABASE_URL` and `SUPABASE_KEY` in both scripts.
23
+ 2. In Terminal 1, run sender:
24
+ ```bash
25
+ python send_http_data.py
26
+ ```
27
+ 3. In Terminal 2, launch dashboard:
28
+ ```bash
29
+ streamlit run app_http.py
30
+ ```