datapilot-kit 0.3.0rc1__py3-none-any.whl

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 (44) hide show
  1. datapilot/__init__.py +11 -0
  2. datapilot/analysis/__init__.py +3 -0
  3. datapilot/analysis/correlation.py +58 -0
  4. datapilot/analysis/datatype.py +48 -0
  5. datapilot/analysis/duplicate.py +40 -0
  6. datapilot/analysis/health.py +163 -0
  7. datapilot/analysis/insights.py +101 -0
  8. datapilot/analysis/missing.py +56 -0
  9. datapilot/analysis/models.py +108 -0
  10. datapilot/analysis/outliers.py +85 -0
  11. datapilot/analysis/statistics.py +46 -0
  12. datapilot/analysis/summary.py +36 -0
  13. datapilot/api/__init__.py +7 -0
  14. datapilot/api/analyze.py +16 -0
  15. datapilot/assets/style.css +1081 -0
  16. datapilot/cli/__init__.py +3 -0
  17. datapilot/core/__init__.py +3 -0
  18. datapilot/core/loader.py +72 -0
  19. datapilot/core/report.py +104 -0
  20. datapilot/interpretation/__init__.py +3 -0
  21. datapilot/llm/__init__.py +0 -0
  22. datapilot/recommendation/__init__.py +0 -0
  23. datapilot/reporting/__init__.py +3 -0
  24. datapilot/reporting/fragments.py +329 -0
  25. datapilot/reporting/html.py +51 -0
  26. datapilot/reporting/placeholders.py +133 -0
  27. datapilot/reporting/renderer.py +57 -0
  28. datapilot/templates/report.html +528 -0
  29. datapilot/ui/__init__.py +0 -0
  30. datapilot/ui/cards.py +70 -0
  31. datapilot/ui/console.py +12 -0
  32. datapilot/ui/dashboard.py +90 -0
  33. datapilot/ui/panels.py +16 -0
  34. datapilot/ui/renderer.py +21 -0
  35. datapilot/ui/sections.py +89 -0
  36. datapilot/ui/tables.py +21 -0
  37. datapilot/ui/theme.py +20 -0
  38. datapilot/utils/__init__.py +3 -0
  39. datapilot/visualization/__init__.py +0 -0
  40. datapilot_kit-0.3.0rc1.dist-info/METADATA +103 -0
  41. datapilot_kit-0.3.0rc1.dist-info/RECORD +44 -0
  42. datapilot_kit-0.3.0rc1.dist-info/WHEEL +5 -0
  43. datapilot_kit-0.3.0rc1.dist-info/licenses/LICENSE +21 -0
  44. datapilot_kit-0.3.0rc1.dist-info/top_level.txt +1 -0
@@ -0,0 +1,46 @@
1
+ """
2
+ Statistical analysis for Datapilot.
3
+ """
4
+
5
+ from typing import SupportsFloat, cast
6
+
7
+ import pandas as pd
8
+
9
+ from .models import StatisticsSummary
10
+
11
+
12
+ def generate_statistics_summary(
13
+ dataframe: pd.DataFrame,
14
+ ) -> StatisticsSummary:
15
+ """
16
+ Generate descriptive statistics for all numeric columns.
17
+ """
18
+
19
+ numeric_dataframe = dataframe.select_dtypes(
20
+ include="number",
21
+ )
22
+
23
+ statistics: dict[str, dict[str, float]] = {}
24
+
25
+ for column in numeric_dataframe.columns:
26
+ series = numeric_dataframe[column]
27
+
28
+ description = series.describe()
29
+
30
+ statistics[str(column)] = {
31
+ "count": float(cast(SupportsFloat, description["count"])),
32
+ "mean": float(cast(SupportsFloat, description["mean"])),
33
+ "median": float(cast(SupportsFloat, series.median())),
34
+ "std": float(cast(SupportsFloat, description["std"])),
35
+ "variance": float(cast(SupportsFloat, series.var())),
36
+ "min": float(cast(SupportsFloat, description["min"])),
37
+ "q1": float(cast(SupportsFloat, description["25%"])),
38
+ "q3": float(cast(SupportsFloat, description["75%"])),
39
+ "max": float(cast(SupportsFloat, description["max"])),
40
+ "skewness": float(cast(SupportsFloat, series.skew())),
41
+ "kurtosis": float(cast(SupportsFloat, series.kurt())),
42
+ }
43
+
44
+ return StatisticsSummary(
45
+ column_statistics=statistics,
46
+ )
@@ -0,0 +1,36 @@
1
+ """
2
+ Dataset summary analysis for Datapilot.
3
+ """
4
+
5
+ import pandas as pd
6
+
7
+ from .models import DatasetSummary
8
+
9
+
10
+ def generate_summary(dataframe: pd.DataFrame) -> DatasetSummary:
11
+ """
12
+ Generate a summary of the dataset.
13
+
14
+ Parameters
15
+ ----------
16
+ dataframe : pandas.DataFrame
17
+ Dataset to summarize.
18
+
19
+ Returns
20
+ -------
21
+ DatasetSummary
22
+ Summary information about the dataset.
23
+ """
24
+
25
+ memory_usage = float(
26
+ dataframe.memory_usage(deep=True).sum()
27
+ / 1024
28
+ / 1024
29
+ )
30
+
31
+ return DatasetSummary(
32
+ rows=dataframe.shape[0],
33
+ columns=dataframe.shape[1],
34
+ memory_usage_mb=round(memory_usage, 2),
35
+ column_names=list(dataframe.columns),
36
+ )
@@ -0,0 +1,7 @@
1
+ """
2
+ Public API for Datapilot.
3
+ """
4
+
5
+ from .analyze import analyze
6
+
7
+ __all__ = ["analyze"]
@@ -0,0 +1,16 @@
1
+ """
2
+ Public API for Datapilot.
3
+ """
4
+
5
+ from typing import Any
6
+
7
+ from ..core.loader import load_dataset
8
+ from ..core.report import Report
9
+
10
+
11
+ def analyze(data: Any) -> Report:
12
+ """
13
+ Analyze a dataset and return a Report object.
14
+ """
15
+ dataframe = load_dataset(data)
16
+ return Report(dataframe)