murthylytics 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.
- murthylytics-0.1.0/.gitignore +41 -0
- murthylytics-0.1.0/LICENSE +21 -0
- murthylytics-0.1.0/PKG-INFO +168 -0
- murthylytics-0.1.0/README.md +104 -0
- murthylytics-0.1.0/examples/quickstart.py +63 -0
- murthylytics-0.1.0/pyproject.toml +102 -0
- murthylytics-0.1.0/src/murthylytics/__init__.py +274 -0
- murthylytics-0.1.0/src/murthylytics/_version.py +3 -0
- murthylytics-0.1.0/src/murthylytics/cleaning/__init__.py +1 -0
- murthylytics-0.1.0/src/murthylytics/core/__init__.py +48 -0
- murthylytics-0.1.0/src/murthylytics/core/config.py +88 -0
- murthylytics-0.1.0/src/murthylytics/core/context.py +125 -0
- murthylytics-0.1.0/src/murthylytics/core/exceptions.py +54 -0
- murthylytics-0.1.0/src/murthylytics/core/logging.py +75 -0
- murthylytics-0.1.0/src/murthylytics/core/optional.py +32 -0
- murthylytics-0.1.0/src/murthylytics/core/types.py +50 -0
- murthylytics-0.1.0/src/murthylytics/eda/__init__.py +1 -0
- murthylytics-0.1.0/src/murthylytics/exploration/__init__.py +36 -0
- murthylytics-0.1.0/src/murthylytics/exploration/display.py +99 -0
- murthylytics-0.1.0/src/murthylytics/exploration/inspect.py +337 -0
- murthylytics-0.1.0/src/murthylytics/features/__init__.py +1 -0
- murthylytics-0.1.0/src/murthylytics/io/__init__.py +28 -0
- murthylytics-0.1.0/src/murthylytics/io/detect.py +125 -0
- murthylytics-0.1.0/src/murthylytics/io/optimize.py +84 -0
- murthylytics-0.1.0/src/murthylytics/io/readers.py +160 -0
- murthylytics-0.1.0/src/murthylytics/modeling/__init__.py +1 -0
- murthylytics-0.1.0/src/murthylytics/pipeline/__init__.py +1 -0
- murthylytics-0.1.0/src/murthylytics/plugins/__init__.py +1 -0
- murthylytics-0.1.0/src/murthylytics/preprocess/__init__.py +1 -0
- murthylytics-0.1.0/src/murthylytics/py.typed +0 -0
- murthylytics-0.1.0/src/murthylytics/viz/__init__.py +1 -0
- murthylytics-0.1.0/tests/conftest.py +57 -0
- murthylytics-0.1.0/tests/test_core.py +55 -0
- murthylytics-0.1.0/tests/test_exploration.py +53 -0
- murthylytics-0.1.0/tests/test_inspect.py +57 -0
- murthylytics-0.1.0/tests/test_io.py +59 -0
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
# Byte-compiled / optimized
|
|
2
|
+
__pycache__/
|
|
3
|
+
*.py[cod]
|
|
4
|
+
*$py.class
|
|
5
|
+
*.so
|
|
6
|
+
|
|
7
|
+
# Distribution / packaging
|
|
8
|
+
.Python
|
|
9
|
+
build/
|
|
10
|
+
dist/
|
|
11
|
+
*.egg-info/
|
|
12
|
+
.eggs/
|
|
13
|
+
wheels/
|
|
14
|
+
|
|
15
|
+
# Testing / coverage
|
|
16
|
+
.pytest_cache/
|
|
17
|
+
.coverage
|
|
18
|
+
.coverage.*
|
|
19
|
+
htmlcov/
|
|
20
|
+
.mypy_cache/
|
|
21
|
+
.ruff_cache/
|
|
22
|
+
|
|
23
|
+
# Environments
|
|
24
|
+
.venv/
|
|
25
|
+
venv/
|
|
26
|
+
env/
|
|
27
|
+
ENV/
|
|
28
|
+
|
|
29
|
+
# IDE / OS
|
|
30
|
+
.vscode/
|
|
31
|
+
.idea/
|
|
32
|
+
.DS_Store
|
|
33
|
+
|
|
34
|
+
# Murthylytics artifacts
|
|
35
|
+
*.mlt
|
|
36
|
+
reports/
|
|
37
|
+
*.log
|
|
38
|
+
|
|
39
|
+
# Local tooling / self-hosted index (not part of the package)
|
|
40
|
+
.claude/
|
|
41
|
+
public/
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Pranav Murthy
|
|
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,168 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: murthylytics
|
|
3
|
+
Version: 0.1.0
|
|
4
|
+
Summary: Production-grade, AI-powered machine learning data-analysis and preparation library.
|
|
5
|
+
Project-URL: Homepage, https://github.com/pranavmurthy/murthylytics
|
|
6
|
+
Project-URL: Repository, https://github.com/pranavmurthy/murthylytics
|
|
7
|
+
Project-URL: Issues, https://github.com/pranavmurthy/murthylytics/issues
|
|
8
|
+
Author: Pranav Murthy
|
|
9
|
+
License: MIT
|
|
10
|
+
License-File: LICENSE
|
|
11
|
+
Keywords: autoeda,automl,data-cleaning,data-science,eda,feature-engineering,feature-selection,machine-learning,preprocessing
|
|
12
|
+
Classifier: Development Status :: 3 - Alpha
|
|
13
|
+
Classifier: Intended Audience :: Developers
|
|
14
|
+
Classifier: Intended Audience :: Science/Research
|
|
15
|
+
Classifier: License :: OSI Approved :: MIT License
|
|
16
|
+
Classifier: Programming Language :: Python :: 3
|
|
17
|
+
Classifier: Programming Language :: Python :: 3.9
|
|
18
|
+
Classifier: Programming Language :: Python :: 3.10
|
|
19
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
20
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
21
|
+
Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
|
|
22
|
+
Classifier: Typing :: Typed
|
|
23
|
+
Requires-Python: >=3.9
|
|
24
|
+
Requires-Dist: numpy>=1.23
|
|
25
|
+
Requires-Dist: pandas>=1.5
|
|
26
|
+
Provides-Extra: all
|
|
27
|
+
Requires-Dist: charset-normalizer>=3.0; extra == 'all'
|
|
28
|
+
Requires-Dist: jinja2>=3.1; extra == 'all'
|
|
29
|
+
Requires-Dist: lightgbm>=3.3; extra == 'all'
|
|
30
|
+
Requires-Dist: matplotlib>=3.6; extra == 'all'
|
|
31
|
+
Requires-Dist: openpyxl>=3.1; extra == 'all'
|
|
32
|
+
Requires-Dist: pyarrow>=10.0; extra == 'all'
|
|
33
|
+
Requires-Dist: scikit-learn>=1.1; extra == 'all'
|
|
34
|
+
Requires-Dist: scipy>=1.9; extra == 'all'
|
|
35
|
+
Requires-Dist: seaborn>=0.12; extra == 'all'
|
|
36
|
+
Requires-Dist: sqlalchemy>=2.0; extra == 'all'
|
|
37
|
+
Requires-Dist: xgboost>=1.7; extra == 'all'
|
|
38
|
+
Provides-Extra: dev
|
|
39
|
+
Requires-Dist: black>=23.0; extra == 'dev'
|
|
40
|
+
Requires-Dist: mypy>=1.5; extra == 'dev'
|
|
41
|
+
Requires-Dist: pre-commit>=3.4; extra == 'dev'
|
|
42
|
+
Requires-Dist: pytest-cov>=4.1; extra == 'dev'
|
|
43
|
+
Requires-Dist: pytest>=7.4; extra == 'dev'
|
|
44
|
+
Requires-Dist: ruff>=0.1; extra == 'dev'
|
|
45
|
+
Provides-Extra: io
|
|
46
|
+
Requires-Dist: charset-normalizer>=3.0; extra == 'io'
|
|
47
|
+
Requires-Dist: openpyxl>=3.1; extra == 'io'
|
|
48
|
+
Requires-Dist: pyarrow>=10.0; extra == 'io'
|
|
49
|
+
Requires-Dist: sqlalchemy>=2.0; extra == 'io'
|
|
50
|
+
Provides-Extra: ml
|
|
51
|
+
Requires-Dist: lightgbm>=3.3; extra == 'ml'
|
|
52
|
+
Requires-Dist: xgboost>=1.7; extra == 'ml'
|
|
53
|
+
Provides-Extra: polars
|
|
54
|
+
Requires-Dist: polars>=0.20; extra == 'polars'
|
|
55
|
+
Provides-Extra: report
|
|
56
|
+
Requires-Dist: jinja2>=3.1; extra == 'report'
|
|
57
|
+
Provides-Extra: stats
|
|
58
|
+
Requires-Dist: scikit-learn>=1.1; extra == 'stats'
|
|
59
|
+
Requires-Dist: scipy>=1.9; extra == 'stats'
|
|
60
|
+
Provides-Extra: viz
|
|
61
|
+
Requires-Dist: matplotlib>=3.6; extra == 'viz'
|
|
62
|
+
Requires-Dist: seaborn>=0.12; extra == 'viz'
|
|
63
|
+
Description-Content-Type: text/markdown
|
|
64
|
+
|
|
65
|
+
# Murthylytics
|
|
66
|
+
|
|
67
|
+
**Production-grade, AI-powered machine-learning data analysis & preparation for Python.**
|
|
68
|
+
|
|
69
|
+
Murthylytics turns hundreds of lines of exploratory-data-analysis and preprocessing
|
|
70
|
+
boilerplate into a handful of intuitive commands — while staying transparent,
|
|
71
|
+
configurable and production-quality. Think of it as a next-generation companion to
|
|
72
|
+
pandas, ydata-profiling, Sweetviz and scikit-learn's preprocessing tools, unified
|
|
73
|
+
behind one stateful API.
|
|
74
|
+
|
|
75
|
+
```python
|
|
76
|
+
import murthylytics as mlt
|
|
77
|
+
|
|
78
|
+
mlt.read_csv("data.csv") # auto-detects encoding, delimiter, dtypes, datetimes
|
|
79
|
+
|
|
80
|
+
mlt.summary() # compact overview
|
|
81
|
+
mlt.inspect() # intelligent profiling: roles, targets, leakage, issues
|
|
82
|
+
|
|
83
|
+
mlt.clean_data() # roadmap: intelligent cleaning & imputation
|
|
84
|
+
mlt.auto_eda() # roadmap: HTML / Markdown / PDF / JSON reports
|
|
85
|
+
mlt.preprocess() # roadmap: task detection + preprocessing pipeline
|
|
86
|
+
mlt.recommend_model() # roadmap: model recommendations with justification
|
|
87
|
+
```
|
|
88
|
+
|
|
89
|
+
## Why Murthylytics
|
|
90
|
+
|
|
91
|
+
- **One stateful facade.** Load a dataset once; every call operates on the active
|
|
92
|
+
session — no handle passing.
|
|
93
|
+
- **Intelligent by default.** Encoding/delimiter/dtype detection, column-role
|
|
94
|
+
inference, target detection, class-imbalance and data-leakage checks, all automatic.
|
|
95
|
+
- **Lightweight core, optional power.** Base install is just pandas + numpy. Heavy
|
|
96
|
+
tooling (plots, XGBoost, SHAP, Parquet…) is lazy-loaded behind extras.
|
|
97
|
+
- **Engineered to last.** `src/` layout, full type hints, SOLID modules, a pure
|
|
98
|
+
stateless engine under the facade, and a test suite.
|
|
99
|
+
|
|
100
|
+
## Installation
|
|
101
|
+
|
|
102
|
+
```bash
|
|
103
|
+
pip install murthylytics # core (pandas + numpy)
|
|
104
|
+
pip install 'murthylytics[stats]' # scipy + scikit-learn powered analysis
|
|
105
|
+
pip install 'murthylytics[viz]' # matplotlib + seaborn plotting
|
|
106
|
+
pip install 'murthylytics[all]' # everything
|
|
107
|
+
```
|
|
108
|
+
|
|
109
|
+
> Develop locally: `pip install -e '.[dev,stats]'`
|
|
110
|
+
|
|
111
|
+
## Quick start
|
|
112
|
+
|
|
113
|
+
```python
|
|
114
|
+
import murthylytics as mlt
|
|
115
|
+
|
|
116
|
+
mlt.read_csv("titanic.csv")
|
|
117
|
+
|
|
118
|
+
mlt.shape() # {'rows': 891, 'columns': 12}
|
|
119
|
+
mlt.missing() # per-column missing counts & %
|
|
120
|
+
report = mlt.inspect()
|
|
121
|
+
print(report) # human-readable summary
|
|
122
|
+
print(report.recommendations) # actionable next steps
|
|
123
|
+
report.to_dict() # JSON-serialisable
|
|
124
|
+
```
|
|
125
|
+
|
|
126
|
+
## Feature status
|
|
127
|
+
|
|
128
|
+
| Area | API | Status |
|
|
129
|
+
|------|-----|--------|
|
|
130
|
+
| Data I/O (CSV/Excel/JSON/Parquet/SQL) | `read_*` | ✅ available |
|
|
131
|
+
| Exploration | `show/top/bottom/shape/columns/summary/describe/info/types/missing/duplicates/memory` | ✅ available |
|
|
132
|
+
| Intelligent inspection | `inspect` | ✅ available |
|
|
133
|
+
| Intelligent cleaning | `clean_data` | 🚧 roadmap (iteration 2) |
|
|
134
|
+
| Visualization | `cleaned_pyplot` | 🚧 roadmap (iteration 3) |
|
|
135
|
+
| AutoEDA reports | `auto_eda` | 🚧 roadmap (iteration 4) |
|
|
136
|
+
| Preprocessing | `preprocess` | 🚧 roadmap (iteration 5) |
|
|
137
|
+
| Feature engineering / selection | `engineer_features` / `select_features` | 🚧 roadmap (iteration 6) |
|
|
138
|
+
| Model recommendation | `recommend_model` | 🚧 roadmap (iteration 7) |
|
|
139
|
+
| Pipeline export | `export_pipeline` | 🚧 roadmap (iteration 8) |
|
|
140
|
+
| Plugins (malware, finance, …) | `use_plugin` | 🚧 roadmap (iteration 9) |
|
|
141
|
+
|
|
142
|
+
The roadmap functions are already part of the public surface with stable
|
|
143
|
+
signatures; calling one today raises a clear `NotImplementedError` pointing at the
|
|
144
|
+
iteration that delivers it.
|
|
145
|
+
|
|
146
|
+
## Architecture
|
|
147
|
+
|
|
148
|
+
```
|
|
149
|
+
murthylytics/
|
|
150
|
+
├── core/ config · session/context · logging · exceptions · types
|
|
151
|
+
├── io/ smart readers · encoding/delimiter/dtype detection · memory opt
|
|
152
|
+
├── exploration/ display helpers · intelligent inspection
|
|
153
|
+
├── cleaning/ (roadmap) duplicates · imputation · outliers · text fixes
|
|
154
|
+
├── viz/ (roadmap) auto-plot dispatcher
|
|
155
|
+
├── eda/ (roadmap) HTML/MD/PDF/JSON reports
|
|
156
|
+
├── preprocess/ (roadmap) task detection · scaling · encoding · pipelines
|
|
157
|
+
├── features/ (roadmap) engineering · selection
|
|
158
|
+
├── modeling/ (roadmap) model recommendation
|
|
159
|
+
├── pipeline/ (roadmap) save/load/export
|
|
160
|
+
└── plugins/ (roadmap) domain plugins
|
|
161
|
+
```
|
|
162
|
+
|
|
163
|
+
All mutable state lives in a single `Session`; the engine modules are pure
|
|
164
|
+
functions, which keeps them independently testable and reusable.
|
|
165
|
+
|
|
166
|
+
## License
|
|
167
|
+
|
|
168
|
+
MIT © Pranav Murthy
|
|
@@ -0,0 +1,104 @@
|
|
|
1
|
+
# Murthylytics
|
|
2
|
+
|
|
3
|
+
**Production-grade, AI-powered machine-learning data analysis & preparation for Python.**
|
|
4
|
+
|
|
5
|
+
Murthylytics turns hundreds of lines of exploratory-data-analysis and preprocessing
|
|
6
|
+
boilerplate into a handful of intuitive commands — while staying transparent,
|
|
7
|
+
configurable and production-quality. Think of it as a next-generation companion to
|
|
8
|
+
pandas, ydata-profiling, Sweetviz and scikit-learn's preprocessing tools, unified
|
|
9
|
+
behind one stateful API.
|
|
10
|
+
|
|
11
|
+
```python
|
|
12
|
+
import murthylytics as mlt
|
|
13
|
+
|
|
14
|
+
mlt.read_csv("data.csv") # auto-detects encoding, delimiter, dtypes, datetimes
|
|
15
|
+
|
|
16
|
+
mlt.summary() # compact overview
|
|
17
|
+
mlt.inspect() # intelligent profiling: roles, targets, leakage, issues
|
|
18
|
+
|
|
19
|
+
mlt.clean_data() # roadmap: intelligent cleaning & imputation
|
|
20
|
+
mlt.auto_eda() # roadmap: HTML / Markdown / PDF / JSON reports
|
|
21
|
+
mlt.preprocess() # roadmap: task detection + preprocessing pipeline
|
|
22
|
+
mlt.recommend_model() # roadmap: model recommendations with justification
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
## Why Murthylytics
|
|
26
|
+
|
|
27
|
+
- **One stateful facade.** Load a dataset once; every call operates on the active
|
|
28
|
+
session — no handle passing.
|
|
29
|
+
- **Intelligent by default.** Encoding/delimiter/dtype detection, column-role
|
|
30
|
+
inference, target detection, class-imbalance and data-leakage checks, all automatic.
|
|
31
|
+
- **Lightweight core, optional power.** Base install is just pandas + numpy. Heavy
|
|
32
|
+
tooling (plots, XGBoost, SHAP, Parquet…) is lazy-loaded behind extras.
|
|
33
|
+
- **Engineered to last.** `src/` layout, full type hints, SOLID modules, a pure
|
|
34
|
+
stateless engine under the facade, and a test suite.
|
|
35
|
+
|
|
36
|
+
## Installation
|
|
37
|
+
|
|
38
|
+
```bash
|
|
39
|
+
pip install murthylytics # core (pandas + numpy)
|
|
40
|
+
pip install 'murthylytics[stats]' # scipy + scikit-learn powered analysis
|
|
41
|
+
pip install 'murthylytics[viz]' # matplotlib + seaborn plotting
|
|
42
|
+
pip install 'murthylytics[all]' # everything
|
|
43
|
+
```
|
|
44
|
+
|
|
45
|
+
> Develop locally: `pip install -e '.[dev,stats]'`
|
|
46
|
+
|
|
47
|
+
## Quick start
|
|
48
|
+
|
|
49
|
+
```python
|
|
50
|
+
import murthylytics as mlt
|
|
51
|
+
|
|
52
|
+
mlt.read_csv("titanic.csv")
|
|
53
|
+
|
|
54
|
+
mlt.shape() # {'rows': 891, 'columns': 12}
|
|
55
|
+
mlt.missing() # per-column missing counts & %
|
|
56
|
+
report = mlt.inspect()
|
|
57
|
+
print(report) # human-readable summary
|
|
58
|
+
print(report.recommendations) # actionable next steps
|
|
59
|
+
report.to_dict() # JSON-serialisable
|
|
60
|
+
```
|
|
61
|
+
|
|
62
|
+
## Feature status
|
|
63
|
+
|
|
64
|
+
| Area | API | Status |
|
|
65
|
+
|------|-----|--------|
|
|
66
|
+
| Data I/O (CSV/Excel/JSON/Parquet/SQL) | `read_*` | ✅ available |
|
|
67
|
+
| Exploration | `show/top/bottom/shape/columns/summary/describe/info/types/missing/duplicates/memory` | ✅ available |
|
|
68
|
+
| Intelligent inspection | `inspect` | ✅ available |
|
|
69
|
+
| Intelligent cleaning | `clean_data` | 🚧 roadmap (iteration 2) |
|
|
70
|
+
| Visualization | `cleaned_pyplot` | 🚧 roadmap (iteration 3) |
|
|
71
|
+
| AutoEDA reports | `auto_eda` | 🚧 roadmap (iteration 4) |
|
|
72
|
+
| Preprocessing | `preprocess` | 🚧 roadmap (iteration 5) |
|
|
73
|
+
| Feature engineering / selection | `engineer_features` / `select_features` | 🚧 roadmap (iteration 6) |
|
|
74
|
+
| Model recommendation | `recommend_model` | 🚧 roadmap (iteration 7) |
|
|
75
|
+
| Pipeline export | `export_pipeline` | 🚧 roadmap (iteration 8) |
|
|
76
|
+
| Plugins (malware, finance, …) | `use_plugin` | 🚧 roadmap (iteration 9) |
|
|
77
|
+
|
|
78
|
+
The roadmap functions are already part of the public surface with stable
|
|
79
|
+
signatures; calling one today raises a clear `NotImplementedError` pointing at the
|
|
80
|
+
iteration that delivers it.
|
|
81
|
+
|
|
82
|
+
## Architecture
|
|
83
|
+
|
|
84
|
+
```
|
|
85
|
+
murthylytics/
|
|
86
|
+
├── core/ config · session/context · logging · exceptions · types
|
|
87
|
+
├── io/ smart readers · encoding/delimiter/dtype detection · memory opt
|
|
88
|
+
├── exploration/ display helpers · intelligent inspection
|
|
89
|
+
├── cleaning/ (roadmap) duplicates · imputation · outliers · text fixes
|
|
90
|
+
├── viz/ (roadmap) auto-plot dispatcher
|
|
91
|
+
├── eda/ (roadmap) HTML/MD/PDF/JSON reports
|
|
92
|
+
├── preprocess/ (roadmap) task detection · scaling · encoding · pipelines
|
|
93
|
+
├── features/ (roadmap) engineering · selection
|
|
94
|
+
├── modeling/ (roadmap) model recommendation
|
|
95
|
+
├── pipeline/ (roadmap) save/load/export
|
|
96
|
+
└── plugins/ (roadmap) domain plugins
|
|
97
|
+
```
|
|
98
|
+
|
|
99
|
+
All mutable state lives in a single `Session`; the engine modules are pure
|
|
100
|
+
functions, which keeps them independently testable and reusable.
|
|
101
|
+
|
|
102
|
+
## License
|
|
103
|
+
|
|
104
|
+
MIT © Pranav Murthy
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
"""Murthylytics quickstart.
|
|
2
|
+
|
|
3
|
+
Run with: python examples/quickstart.py
|
|
4
|
+
|
|
5
|
+
Generates a small synthetic dataset, then walks through the currently available
|
|
6
|
+
facade API: reading, exploration and intelligent inspection.
|
|
7
|
+
"""
|
|
8
|
+
|
|
9
|
+
from __future__ import annotations
|
|
10
|
+
|
|
11
|
+
import json
|
|
12
|
+
import tempfile
|
|
13
|
+
from pathlib import Path
|
|
14
|
+
|
|
15
|
+
import numpy as np
|
|
16
|
+
import pandas as pd
|
|
17
|
+
|
|
18
|
+
import murthylytics as mlt
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
def make_dataset(path: Path) -> None:
|
|
22
|
+
rng = np.random.default_rng(42)
|
|
23
|
+
n = 400
|
|
24
|
+
df = pd.DataFrame(
|
|
25
|
+
{
|
|
26
|
+
"user_id": range(1, n + 1),
|
|
27
|
+
"age": rng.integers(18, 75, n),
|
|
28
|
+
"monthly_spend": rng.gamma(3.0, 40.0, n).round(2),
|
|
29
|
+
"plan": rng.choice(["free", "pro", "enterprise"], n, p=[0.6, 0.3, 0.1]),
|
|
30
|
+
"signup": pd.date_range("2022-01-01", periods=n, freq="D").astype(str),
|
|
31
|
+
"churned": rng.choice([0, 1], n, p=[0.82, 0.18]),
|
|
32
|
+
}
|
|
33
|
+
)
|
|
34
|
+
df.loc[rng.choice(n, 25, replace=False), "monthly_spend"] = np.nan
|
|
35
|
+
df.to_csv(path, index=False)
|
|
36
|
+
|
|
37
|
+
|
|
38
|
+
def main() -> None:
|
|
39
|
+
with tempfile.TemporaryDirectory() as tmp:
|
|
40
|
+
csv = Path(tmp) / "subscriptions.csv"
|
|
41
|
+
make_dataset(csv)
|
|
42
|
+
|
|
43
|
+
mlt.enable_logging("INFO")
|
|
44
|
+
mlt.read_csv(csv)
|
|
45
|
+
|
|
46
|
+
print("\n== shape ==", mlt.shape())
|
|
47
|
+
print("== dtypes ==", mlt.types())
|
|
48
|
+
print("\n== summary ==")
|
|
49
|
+
print(json.dumps(mlt.summary(), indent=2))
|
|
50
|
+
print("\n== missing ==")
|
|
51
|
+
print(mlt.missing())
|
|
52
|
+
|
|
53
|
+
print("\n== intelligent inspection ==")
|
|
54
|
+
report = mlt.inspect()
|
|
55
|
+
print(report)
|
|
56
|
+
print("\nPotential targets:", report.potential_targets)
|
|
57
|
+
print("Recommendations:")
|
|
58
|
+
for rec in report.recommendations:
|
|
59
|
+
print(" -", rec)
|
|
60
|
+
|
|
61
|
+
|
|
62
|
+
if __name__ == "__main__":
|
|
63
|
+
main()
|
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
[build-system]
|
|
2
|
+
requires = ["hatchling>=1.21"]
|
|
3
|
+
build-backend = "hatchling.build"
|
|
4
|
+
|
|
5
|
+
[project]
|
|
6
|
+
name = "murthylytics"
|
|
7
|
+
dynamic = ["version"]
|
|
8
|
+
description = "Production-grade, AI-powered machine learning data-analysis and preparation library."
|
|
9
|
+
readme = "README.md"
|
|
10
|
+
requires-python = ">=3.9"
|
|
11
|
+
license = { text = "MIT" }
|
|
12
|
+
authors = [{ name = "Pranav Murthy" }]
|
|
13
|
+
keywords = [
|
|
14
|
+
"machine-learning", "data-science", "eda", "autoeda", "preprocessing",
|
|
15
|
+
"feature-engineering", "feature-selection", "automl", "data-cleaning",
|
|
16
|
+
]
|
|
17
|
+
classifiers = [
|
|
18
|
+
"Development Status :: 3 - Alpha",
|
|
19
|
+
"Intended Audience :: Science/Research",
|
|
20
|
+
"Intended Audience :: Developers",
|
|
21
|
+
"License :: OSI Approved :: MIT License",
|
|
22
|
+
"Programming Language :: Python :: 3",
|
|
23
|
+
"Programming Language :: Python :: 3.9",
|
|
24
|
+
"Programming Language :: Python :: 3.10",
|
|
25
|
+
"Programming Language :: Python :: 3.11",
|
|
26
|
+
"Programming Language :: Python :: 3.12",
|
|
27
|
+
"Topic :: Scientific/Engineering :: Artificial Intelligence",
|
|
28
|
+
"Typing :: Typed",
|
|
29
|
+
]
|
|
30
|
+
|
|
31
|
+
# Core dependencies are intentionally minimal. Everything heavy is optional.
|
|
32
|
+
dependencies = [
|
|
33
|
+
"pandas>=1.5",
|
|
34
|
+
"numpy>=1.23",
|
|
35
|
+
]
|
|
36
|
+
|
|
37
|
+
[project.optional-dependencies]
|
|
38
|
+
stats = ["scipy>=1.9", "scikit-learn>=1.1"]
|
|
39
|
+
viz = ["matplotlib>=3.6", "seaborn>=0.12"]
|
|
40
|
+
io = ["pyarrow>=10.0", "openpyxl>=3.1", "charset-normalizer>=3.0", "sqlalchemy>=2.0"]
|
|
41
|
+
ml = ["xgboost>=1.7", "lightgbm>=3.3"]
|
|
42
|
+
report = ["jinja2>=3.1"]
|
|
43
|
+
polars = ["polars>=0.20"]
|
|
44
|
+
all = [
|
|
45
|
+
"scipy>=1.9", "scikit-learn>=1.1",
|
|
46
|
+
"matplotlib>=3.6", "seaborn>=0.12",
|
|
47
|
+
"pyarrow>=10.0", "openpyxl>=3.1", "charset-normalizer>=3.0", "sqlalchemy>=2.0",
|
|
48
|
+
"xgboost>=1.7", "lightgbm>=3.3",
|
|
49
|
+
"jinja2>=3.1",
|
|
50
|
+
]
|
|
51
|
+
dev = [
|
|
52
|
+
"pytest>=7.4", "pytest-cov>=4.1",
|
|
53
|
+
"black>=23.0", "ruff>=0.1", "mypy>=1.5",
|
|
54
|
+
"pre-commit>=3.4",
|
|
55
|
+
]
|
|
56
|
+
|
|
57
|
+
[project.urls]
|
|
58
|
+
Homepage = "https://github.com/pranavmurthy/murthylytics"
|
|
59
|
+
Repository = "https://github.com/pranavmurthy/murthylytics"
|
|
60
|
+
Issues = "https://github.com/pranavmurthy/murthylytics/issues"
|
|
61
|
+
|
|
62
|
+
[tool.hatch.version]
|
|
63
|
+
path = "src/murthylytics/_version.py"
|
|
64
|
+
|
|
65
|
+
[tool.hatch.build.targets.wheel]
|
|
66
|
+
packages = ["src/murthylytics"]
|
|
67
|
+
|
|
68
|
+
[tool.hatch.build.targets.sdist]
|
|
69
|
+
# Explicit allowlist so build artifacts (public/, dist/) and local settings
|
|
70
|
+
# (.claude/) never leak into the published source distribution.
|
|
71
|
+
include = [
|
|
72
|
+
"src/murthylytics",
|
|
73
|
+
"tests",
|
|
74
|
+
"examples",
|
|
75
|
+
"README.md",
|
|
76
|
+
"LICENSE",
|
|
77
|
+
"pyproject.toml",
|
|
78
|
+
]
|
|
79
|
+
|
|
80
|
+
[tool.black]
|
|
81
|
+
line-length = 100
|
|
82
|
+
target-version = ["py39"]
|
|
83
|
+
|
|
84
|
+
[tool.ruff]
|
|
85
|
+
line-length = 100
|
|
86
|
+
target-version = "py39"
|
|
87
|
+
|
|
88
|
+
[tool.ruff.lint]
|
|
89
|
+
select = ["E", "F", "I", "W", "UP", "B", "C4", "SIM"]
|
|
90
|
+
ignore = ["E501"] # line length handled by black
|
|
91
|
+
|
|
92
|
+
[tool.mypy]
|
|
93
|
+
python_version = "3.9"
|
|
94
|
+
warn_unused_configs = true
|
|
95
|
+
disallow_untyped_defs = false
|
|
96
|
+
ignore_missing_imports = true
|
|
97
|
+
files = ["src/murthylytics"]
|
|
98
|
+
|
|
99
|
+
[tool.pytest.ini_options]
|
|
100
|
+
testpaths = ["tests"]
|
|
101
|
+
addopts = "-q"
|
|
102
|
+
filterwarnings = ["ignore::DeprecationWarning"]
|