polars-data-profiling 0.1.0__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.
- polars_data_profiling/__init__.py +19 -0
- polars_data_profiling/compare_reports.py +386 -0
- polars_data_profiling/config.py +558 -0
- polars_data_profiling/config_default.yaml +219 -0
- polars_data_profiling/config_minimal.yaml +218 -0
- polars_data_profiling/controller/__init__.py +1 -0
- polars_data_profiling/controller/console.py +127 -0
- polars_data_profiling/controller/namespace.py +38 -0
- polars_data_profiling/model/__init__.py +5 -0
- polars_data_profiling/model/alerts.py +779 -0
- polars_data_profiling/model/correlations.py +332 -0
- polars_data_profiling/model/dataframe.py +24 -0
- polars_data_profiling/model/describe.py +197 -0
- polars_data_profiling/model/description.py +106 -0
- polars_data_profiling/model/duplicates.py +64 -0
- polars_data_profiling/model/engine.py +192 -0
- polars_data_profiling/model/expressions.py +215 -0
- polars_data_profiling/model/handler.py +84 -0
- polars_data_profiling/model/images.py +179 -0
- polars_data_profiling/model/missing.py +161 -0
- polars_data_profiling/model/pairwise.py +59 -0
- polars_data_profiling/model/probe.py +217 -0
- polars_data_profiling/model/sample.py +77 -0
- polars_data_profiling/model/summaries.py +641 -0
- polars_data_profiling/model/summarizer.py +177 -0
- polars_data_profiling/model/summary.py +143 -0
- polars_data_profiling/model/summary_algorithms.py +301 -0
- polars_data_profiling/model/table.py +47 -0
- polars_data_profiling/model/timeseries.py +312 -0
- polars_data_profiling/model/timeseries_index.py +48 -0
- polars_data_profiling/model/type_rules.py +35 -0
- polars_data_profiling/model/typeset.py +262 -0
- polars_data_profiling/model/typeset_base.py +367 -0
- polars_data_profiling/model/typeset_relations.py +132 -0
- polars_data_profiling/profile_report.py +508 -0
- polars_data_profiling/py.typed +0 -0
- polars_data_profiling/report/__init__.py +5 -0
- polars_data_profiling/report/formatters.py +344 -0
- polars_data_profiling/report/presentation/__init__.py +1 -0
- polars_data_profiling/report/presentation/core/__init__.py +43 -0
- polars_data_profiling/report/presentation/core/alerts.py +18 -0
- polars_data_profiling/report/presentation/core/collapse.py +25 -0
- polars_data_profiling/report/presentation/core/container.py +51 -0
- polars_data_profiling/report/presentation/core/correlation_table.py +21 -0
- polars_data_profiling/report/presentation/core/dropdown.py +45 -0
- polars_data_profiling/report/presentation/core/duplicate.py +16 -0
- polars_data_profiling/report/presentation/core/frequency_table.py +14 -0
- polars_data_profiling/report/presentation/core/frequency_table_small.py +16 -0
- polars_data_profiling/report/presentation/core/html.py +14 -0
- polars_data_profiling/report/presentation/core/image.py +34 -0
- polars_data_profiling/report/presentation/core/item_renderer.py +16 -0
- polars_data_profiling/report/presentation/core/renderable.py +42 -0
- polars_data_profiling/report/presentation/core/root.py +36 -0
- polars_data_profiling/report/presentation/core/sample.py +29 -0
- polars_data_profiling/report/presentation/core/scores.py +33 -0
- polars_data_profiling/report/presentation/core/table.py +27 -0
- polars_data_profiling/report/presentation/core/toggle_button.py +14 -0
- polars_data_profiling/report/presentation/core/variable.py +51 -0
- polars_data_profiling/report/presentation/core/variable_info.py +36 -0
- polars_data_profiling/report/presentation/flavours/__init__.py +9 -0
- polars_data_profiling/report/presentation/flavours/flavour_html.py +65 -0
- polars_data_profiling/report/presentation/flavours/flavour_widget.py +62 -0
- polars_data_profiling/report/presentation/flavours/flavours.py +42 -0
- polars_data_profiling/report/presentation/flavours/html/__init__.py +57 -0
- polars_data_profiling/report/presentation/flavours/html/alerts.py +10 -0
- polars_data_profiling/report/presentation/flavours/html/collapse.py +7 -0
- polars_data_profiling/report/presentation/flavours/html/container.py +85 -0
- polars_data_profiling/report/presentation/flavours/html/correlation_table.py +21 -0
- polars_data_profiling/report/presentation/flavours/html/dropdown.py +7 -0
- polars_data_profiling/report/presentation/flavours/html/duplicate.py +23 -0
- polars_data_profiling/report/presentation/flavours/html/frame_table.py +61 -0
- polars_data_profiling/report/presentation/flavours/html/frequency_table.py +20 -0
- polars_data_profiling/report/presentation/flavours/html/frequency_table_small.py +15 -0
- polars_data_profiling/report/presentation/flavours/html/html.py +6 -0
- polars_data_profiling/report/presentation/flavours/html/image.py +7 -0
- polars_data_profiling/report/presentation/flavours/html/root.py +15 -0
- polars_data_profiling/report/presentation/flavours/html/sample.py +17 -0
- polars_data_profiling/report/presentation/flavours/html/scores.py +12 -0
- polars_data_profiling/report/presentation/flavours/html/table.py +7 -0
- polars_data_profiling/report/presentation/flavours/html/templates/alerts/alert_constant.html +1 -0
- polars_data_profiling/report/presentation/flavours/html/templates/alerts/alert_constant_length.html +1 -0
- polars_data_profiling/report/presentation/flavours/html/templates/alerts/alert_dirty_category.html +1 -0
- polars_data_profiling/report/presentation/flavours/html/templates/alerts/alert_duplicates.html +1 -0
- polars_data_profiling/report/presentation/flavours/html/templates/alerts/alert_empty.html +1 -0
- polars_data_profiling/report/presentation/flavours/html/templates/alerts/alert_high_cardinality.html +1 -0
- polars_data_profiling/report/presentation/flavours/html/templates/alerts/alert_high_correlation.html +4 -0
- polars_data_profiling/report/presentation/flavours/html/templates/alerts/alert_imbalance.html +1 -0
- polars_data_profiling/report/presentation/flavours/html/templates/alerts/alert_infinite.html +1 -0
- polars_data_profiling/report/presentation/flavours/html/templates/alerts/alert_missing.html +1 -0
- polars_data_profiling/report/presentation/flavours/html/templates/alerts/alert_near_duplicates.html +1 -0
- polars_data_profiling/report/presentation/flavours/html/templates/alerts/alert_non_stationary.html +1 -0
- polars_data_profiling/report/presentation/flavours/html/templates/alerts/alert_seasonal.html +1 -0
- polars_data_profiling/report/presentation/flavours/html/templates/alerts/alert_skewed.html +1 -0
- polars_data_profiling/report/presentation/flavours/html/templates/alerts/alert_truncated.html +1 -0
- polars_data_profiling/report/presentation/flavours/html/templates/alerts/alert_type_date.html +1 -0
- polars_data_profiling/report/presentation/flavours/html/templates/alerts/alert_uniform.html +1 -0
- polars_data_profiling/report/presentation/flavours/html/templates/alerts/alert_unique.html +1 -0
- polars_data_profiling/report/presentation/flavours/html/templates/alerts/alert_unsupported.html +1 -0
- polars_data_profiling/report/presentation/flavours/html/templates/alerts/alert_zeros.html +1 -0
- polars_data_profiling/report/presentation/flavours/html/templates/alerts.html +47 -0
- polars_data_profiling/report/presentation/flavours/html/templates/collapse.html +31 -0
- polars_data_profiling/report/presentation/flavours/html/templates/correlation_table.html +5 -0
- polars_data_profiling/report/presentation/flavours/html/templates/diagram.html +13 -0
- polars_data_profiling/report/presentation/flavours/html/templates/dropdown.html +25 -0
- polars_data_profiling/report/presentation/flavours/html/templates/duplicate.html +5 -0
- polars_data_profiling/report/presentation/flavours/html/templates/frequency_table.html +45 -0
- polars_data_profiling/report/presentation/flavours/html/templates/frequency_table_small.html +34 -0
- polars_data_profiling/report/presentation/flavours/html/templates/report.html +42 -0
- polars_data_profiling/report/presentation/flavours/html/templates/sample.html +10 -0
- polars_data_profiling/report/presentation/flavours/html/templates/scores.html +78 -0
- polars_data_profiling/report/presentation/flavours/html/templates/sequence/batch_grid.html +16 -0
- polars_data_profiling/report/presentation/flavours/html/templates/sequence/cards.html +41 -0
- polars_data_profiling/report/presentation/flavours/html/templates/sequence/correlations.html +53 -0
- polars_data_profiling/report/presentation/flavours/html/templates/sequence/grid.html +39 -0
- polars_data_profiling/report/presentation/flavours/html/templates/sequence/interactions.html +45 -0
- polars_data_profiling/report/presentation/flavours/html/templates/sequence/list.html +7 -0
- polars_data_profiling/report/presentation/flavours/html/templates/sequence/named_list.html +8 -0
- polars_data_profiling/report/presentation/flavours/html/templates/sequence/overview_tabs.html +47 -0
- polars_data_profiling/report/presentation/flavours/html/templates/sequence/scores.html +3 -0
- polars_data_profiling/report/presentation/flavours/html/templates/sequence/sections.html +15 -0
- polars_data_profiling/report/presentation/flavours/html/templates/sequence/select.html +40 -0
- polars_data_profiling/report/presentation/flavours/html/templates/sequence/tabs.html +30 -0
- polars_data_profiling/report/presentation/flavours/html/templates/table.html +38 -0
- polars_data_profiling/report/presentation/flavours/html/templates/toggle_button.html +18 -0
- polars_data_profiling/report/presentation/flavours/html/templates/variable.html +7 -0
- polars_data_profiling/report/presentation/flavours/html/templates/variable_info.html +49 -0
- polars_data_profiling/report/presentation/flavours/html/templates/wrapper/assets/bootstrap.bundle.min.js +7 -0
- polars_data_profiling/report/presentation/flavours/html/templates/wrapper/assets/bootstrap.min.css +6 -0
- polars_data_profiling/report/presentation/flavours/html/templates/wrapper/assets/cosmo.bootstrap.min.css +12 -0
- polars_data_profiling/report/presentation/flavours/html/templates/wrapper/assets/flatly.bootstrap.min.css +12 -0
- polars_data_profiling/report/presentation/flavours/html/templates/wrapper/assets/script.js +398 -0
- polars_data_profiling/report/presentation/flavours/html/templates/wrapper/assets/simplex.bootstrap.min.css +12 -0
- polars_data_profiling/report/presentation/flavours/html/templates/wrapper/assets/style.css +1455 -0
- polars_data_profiling/report/presentation/flavours/html/templates/wrapper/assets/united.bootstrap.min.css +12 -0
- polars_data_profiling/report/presentation/flavours/html/templates/wrapper/footer.html +6 -0
- polars_data_profiling/report/presentation/flavours/html/templates/wrapper/javascript.html +18 -0
- polars_data_profiling/report/presentation/flavours/html/templates/wrapper/navigation.html +22 -0
- polars_data_profiling/report/presentation/flavours/html/templates/wrapper/style.html +20 -0
- polars_data_profiling/report/presentation/flavours/html/templates.py +79 -0
- polars_data_profiling/report/presentation/flavours/html/theme.py +74 -0
- polars_data_profiling/report/presentation/flavours/html/toggle_button.py +7 -0
- polars_data_profiling/report/presentation/flavours/html/variable.py +7 -0
- polars_data_profiling/report/presentation/flavours/html/variable_info.py +7 -0
- polars_data_profiling/report/presentation/flavours/widget/__init__.py +59 -0
- polars_data_profiling/report/presentation/flavours/widget/alerts.py +43 -0
- polars_data_profiling/report/presentation/flavours/widget/collapse.py +43 -0
- polars_data_profiling/report/presentation/flavours/widget/container.py +127 -0
- polars_data_profiling/report/presentation/flavours/widget/correlation_table.py +16 -0
- polars_data_profiling/report/presentation/flavours/widget/dropdown.py +31 -0
- polars_data_profiling/report/presentation/flavours/widget/duplicate.py +14 -0
- polars_data_profiling/report/presentation/flavours/widget/frequency_table.py +57 -0
- polars_data_profiling/report/presentation/flavours/widget/frequency_table_small.py +64 -0
- polars_data_profiling/report/presentation/flavours/widget/html.py +11 -0
- polars_data_profiling/report/presentation/flavours/widget/image.py +29 -0
- polars_data_profiling/report/presentation/flavours/widget/notebook.py +82 -0
- polars_data_profiling/report/presentation/flavours/widget/root.py +10 -0
- polars_data_profiling/report/presentation/flavours/widget/sample.py +14 -0
- polars_data_profiling/report/presentation/flavours/widget/table.py +30 -0
- polars_data_profiling/report/presentation/flavours/widget/toggle_button.py +17 -0
- polars_data_profiling/report/presentation/flavours/widget/variable.py +12 -0
- polars_data_profiling/report/presentation/flavours/widget/variable_info.py +11 -0
- polars_data_profiling/report/presentation/frequency_table_utils.py +169 -0
- polars_data_profiling/report/structure/__init__.py +1 -0
- polars_data_profiling/report/structure/correlations.py +202 -0
- polars_data_profiling/report/structure/overview.py +506 -0
- polars_data_profiling/report/structure/report.py +547 -0
- polars_data_profiling/report/structure/variables/__init__.py +41 -0
- polars_data_profiling/report/structure/variables/render_boolean.py +130 -0
- polars_data_profiling/report/structure/variables/render_categorical.py +562 -0
- polars_data_profiling/report/structure/variables/render_common.py +34 -0
- polars_data_profiling/report/structure/variables/render_complex.py +102 -0
- polars_data_profiling/report/structure/variables/render_count.py +172 -0
- polars_data_profiling/report/structure/variables/render_date.py +147 -0
- polars_data_profiling/report/structure/variables/render_file.py +68 -0
- polars_data_profiling/report/structure/variables/render_generic.py +45 -0
- polars_data_profiling/report/structure/variables/render_image.py +202 -0
- polars_data_profiling/report/structure/variables/render_path.py +138 -0
- polars_data_profiling/report/structure/variables/render_real.py +314 -0
- polars_data_profiling/report/structure/variables/render_text.py +213 -0
- polars_data_profiling/report/structure/variables/render_timeseries.py +371 -0
- polars_data_profiling/report/structure/variables/render_url.py +132 -0
- polars_data_profiling/report/utils.py +32 -0
- polars_data_profiling/serialize_report.py +144 -0
- polars_data_profiling/utils/__init__.py +1 -0
- polars_data_profiling/utils/collect.py +41 -0
- polars_data_profiling/utils/common.py +29 -0
- polars_data_profiling/utils/dataframe.py +166 -0
- polars_data_profiling/utils/notebook.py +8 -0
- polars_data_profiling/utils/paths.py +46 -0
- polars_data_profiling/utils/progress_bar.py +16 -0
- polars_data_profiling/utils/styles.py +22 -0
- polars_data_profiling/version.py +8 -0
- polars_data_profiling/visualisation/__init__.py +1 -0
- polars_data_profiling/visualisation/charts/__init__.py +16 -0
- polars_data_profiling/visualisation/charts/builders.py +631 -0
- polars_data_profiling/visualisation/charts/palette.py +129 -0
- polars_data_profiling/visualisation/charts/scales.py +204 -0
- polars_data_profiling/visualisation/charts/specs.py +249 -0
- polars_data_profiling/visualisation/charts/svg.py +1336 -0
- polars_data_profiling/visualisation/missing.py +34 -0
- polars_data_profiling/visualisation/plot.py +142 -0
- polars_data_profiling-0.1.0.dist-info/METADATA +131 -0
- polars_data_profiling-0.1.0.dist-info/RECORD +207 -0
- polars_data_profiling-0.1.0.dist-info/WHEEL +4 -0
- polars_data_profiling-0.1.0.dist-info/entry_points.txt +3 -0
- polars_data_profiling-0.1.0.dist-info/licenses/LICENSE +22 -0
- polars_data_profiling-0.1.0.dist-info/licenses/NOTICE +26 -0
|
@@ -0,0 +1,219 @@
|
|
|
1
|
+
# Title of the document
|
|
2
|
+
title: Profiling Report
|
|
3
|
+
|
|
4
|
+
# Metadata
|
|
5
|
+
dataset:
|
|
6
|
+
description: ""
|
|
7
|
+
creator: ""
|
|
8
|
+
author: ""
|
|
9
|
+
copyright_holder: ""
|
|
10
|
+
copyright_year: ""
|
|
11
|
+
url: ""
|
|
12
|
+
|
|
13
|
+
variables:
|
|
14
|
+
descriptions: {}
|
|
15
|
+
|
|
16
|
+
# infer dtypes
|
|
17
|
+
infer_dtypes: true
|
|
18
|
+
|
|
19
|
+
# Show the description at each variable (in addition to the overview tab)
|
|
20
|
+
show_variable_description: true
|
|
21
|
+
|
|
22
|
+
# Number of workers (0=multiprocessing.cpu_count())
|
|
23
|
+
pool_size: 0
|
|
24
|
+
|
|
25
|
+
# Show the progress bar
|
|
26
|
+
progress_bar: true
|
|
27
|
+
|
|
28
|
+
# Per variable type description settings
|
|
29
|
+
vars:
|
|
30
|
+
num:
|
|
31
|
+
quantiles:
|
|
32
|
+
- 0.05
|
|
33
|
+
- 0.25
|
|
34
|
+
- 0.5
|
|
35
|
+
- 0.75
|
|
36
|
+
- 0.95
|
|
37
|
+
skewness_threshold: 20
|
|
38
|
+
low_categorical_threshold: 5
|
|
39
|
+
# Set to zero to disable
|
|
40
|
+
chi_squared_threshold: 0.999
|
|
41
|
+
cat:
|
|
42
|
+
length: true
|
|
43
|
+
characters: true
|
|
44
|
+
words: true
|
|
45
|
+
cardinality_threshold: 50
|
|
46
|
+
n_obs: 5
|
|
47
|
+
# Set to zero to disable
|
|
48
|
+
chi_squared_threshold: 0.999
|
|
49
|
+
coerce_str_to_date: false
|
|
50
|
+
redact: false
|
|
51
|
+
histogram_largest: 50
|
|
52
|
+
stop_words: []
|
|
53
|
+
bool:
|
|
54
|
+
n_obs: 3
|
|
55
|
+
# string to boolean mapping dict
|
|
56
|
+
mappings:
|
|
57
|
+
"t": true
|
|
58
|
+
"f": false
|
|
59
|
+
"yes": true
|
|
60
|
+
"no": false
|
|
61
|
+
"y": true
|
|
62
|
+
"n": false
|
|
63
|
+
"true": true
|
|
64
|
+
"false": false
|
|
65
|
+
file:
|
|
66
|
+
active: false
|
|
67
|
+
image:
|
|
68
|
+
active: false
|
|
69
|
+
exif: true
|
|
70
|
+
hash: true
|
|
71
|
+
path:
|
|
72
|
+
active: false
|
|
73
|
+
url:
|
|
74
|
+
active: false
|
|
75
|
+
timeseries:
|
|
76
|
+
active: false
|
|
77
|
+
autocorrelation: 0.7
|
|
78
|
+
lags:
|
|
79
|
+
- 1
|
|
80
|
+
- 7
|
|
81
|
+
- 12
|
|
82
|
+
- 24
|
|
83
|
+
- 30
|
|
84
|
+
significance: 0.05
|
|
85
|
+
pacf_acf_lag: 100
|
|
86
|
+
|
|
87
|
+
# Sort the variables. Possible values: "ascending", "descending" or null (leaves original sorting)
|
|
88
|
+
sort: null
|
|
89
|
+
|
|
90
|
+
# which diagrams to show
|
|
91
|
+
missing_diagrams:
|
|
92
|
+
bar: true
|
|
93
|
+
matrix: true
|
|
94
|
+
heatmap: true
|
|
95
|
+
|
|
96
|
+
correlations:
|
|
97
|
+
pearson:
|
|
98
|
+
calculate: false
|
|
99
|
+
warn_high_correlations: true
|
|
100
|
+
threshold: 0.9
|
|
101
|
+
spearman:
|
|
102
|
+
calculate: false
|
|
103
|
+
warn_high_correlations: false
|
|
104
|
+
threshold: 0.9
|
|
105
|
+
kendall:
|
|
106
|
+
calculate: false
|
|
107
|
+
warn_high_correlations: false
|
|
108
|
+
threshold: 0.9
|
|
109
|
+
cramers:
|
|
110
|
+
calculate: false
|
|
111
|
+
warn_high_correlations: true
|
|
112
|
+
threshold: 0.9
|
|
113
|
+
auto:
|
|
114
|
+
calculate: true
|
|
115
|
+
warn_high_correlations: true
|
|
116
|
+
threshold: 0.9
|
|
117
|
+
|
|
118
|
+
# Bivariate / Pairwise relations
|
|
119
|
+
interactions:
|
|
120
|
+
targets: []
|
|
121
|
+
continuous: true
|
|
122
|
+
|
|
123
|
+
# For categorical
|
|
124
|
+
categorical_maximum_correlation_distinct: 100
|
|
125
|
+
|
|
126
|
+
report:
|
|
127
|
+
precision: 10
|
|
128
|
+
|
|
129
|
+
# Plot-specific settings
|
|
130
|
+
plot:
|
|
131
|
+
|
|
132
|
+
scatter_threshold: 1000
|
|
133
|
+
|
|
134
|
+
correlation:
|
|
135
|
+
cmap: RdBu
|
|
136
|
+
bad: "#000000"
|
|
137
|
+
|
|
138
|
+
missing:
|
|
139
|
+
cmap: RdBu
|
|
140
|
+
# Force labels when there are > 50 variables
|
|
141
|
+
# https://github.com/ResidentMario/missingno/issues/93#issuecomment-513322615
|
|
142
|
+
force_labels: true
|
|
143
|
+
|
|
144
|
+
cat_freq:
|
|
145
|
+
show: true # if false, the category frequency plot is turned off
|
|
146
|
+
type: bar # options: 'bar', 'pie'
|
|
147
|
+
max_unique: 10
|
|
148
|
+
colors: null # null for the report palette, or a list of CSS colours
|
|
149
|
+
|
|
150
|
+
histogram:
|
|
151
|
+
x_axis_labels: true
|
|
152
|
+
|
|
153
|
+
# Number of bins (set to 0 to automatically detect the bin size)
|
|
154
|
+
bins: 50
|
|
155
|
+
|
|
156
|
+
# Maximum number of bins (when bins=0)
|
|
157
|
+
max_bins: 250
|
|
158
|
+
|
|
159
|
+
font_path: null
|
|
160
|
+
|
|
161
|
+
# The number of observations to show
|
|
162
|
+
n_obs_unique: 5
|
|
163
|
+
n_extreme_obs: 5
|
|
164
|
+
n_freq_table_max: 10
|
|
165
|
+
|
|
166
|
+
# Use `deep` flag for memory_usage
|
|
167
|
+
memory_deep: false
|
|
168
|
+
|
|
169
|
+
# Configuration related to the duplicates
|
|
170
|
+
duplicates:
|
|
171
|
+
head: 10
|
|
172
|
+
key: "# duplicates"
|
|
173
|
+
|
|
174
|
+
# Configuration related to the samples area
|
|
175
|
+
samples:
|
|
176
|
+
head: 10
|
|
177
|
+
tail: 10
|
|
178
|
+
random: 0
|
|
179
|
+
|
|
180
|
+
# Configuration related to the rejection of variables
|
|
181
|
+
reject_variables: true
|
|
182
|
+
|
|
183
|
+
# When in a Jupyter notebook
|
|
184
|
+
notebook:
|
|
185
|
+
iframe:
|
|
186
|
+
height: 800px
|
|
187
|
+
width: 100%
|
|
188
|
+
# or 'src'
|
|
189
|
+
attribute: srcdoc
|
|
190
|
+
|
|
191
|
+
html:
|
|
192
|
+
# Minify the html
|
|
193
|
+
minify_html: true
|
|
194
|
+
|
|
195
|
+
# Offline support
|
|
196
|
+
use_local_assets: true
|
|
197
|
+
|
|
198
|
+
# If true, single file, else directory with assets
|
|
199
|
+
inline: true
|
|
200
|
+
|
|
201
|
+
# Show navbar
|
|
202
|
+
navbar_show: true
|
|
203
|
+
|
|
204
|
+
# Assets prefix if inline = true
|
|
205
|
+
assets_prefix: null
|
|
206
|
+
|
|
207
|
+
# Styling options for the HTML report
|
|
208
|
+
style:
|
|
209
|
+
# light (default), dark or auto (follows the viewer's system setting)
|
|
210
|
+
theme: null
|
|
211
|
+
# Let the host page show through the report background (embedding)
|
|
212
|
+
transparent_background: false
|
|
213
|
+
logo: ""
|
|
214
|
+
primary_colors:
|
|
215
|
+
- "#0d6efd"
|
|
216
|
+
- "#dc3545"
|
|
217
|
+
- "#198754"
|
|
218
|
+
|
|
219
|
+
full_width: false
|
|
@@ -0,0 +1,218 @@
|
|
|
1
|
+
# Title of the document
|
|
2
|
+
title: Profiling Report
|
|
3
|
+
|
|
4
|
+
# Metadata
|
|
5
|
+
dataset:
|
|
6
|
+
description: ""
|
|
7
|
+
creator: ""
|
|
8
|
+
author: ""
|
|
9
|
+
copyright_holder: ""
|
|
10
|
+
copyright_year: ""
|
|
11
|
+
url: ""
|
|
12
|
+
|
|
13
|
+
variables:
|
|
14
|
+
descriptions: {}
|
|
15
|
+
|
|
16
|
+
# infer dtypes
|
|
17
|
+
infer_dtypes: false
|
|
18
|
+
|
|
19
|
+
# Show the description at each variable (in addition to the overview tab)
|
|
20
|
+
show_variable_description: true
|
|
21
|
+
|
|
22
|
+
# Number of workers (0=multiprocessing.cpu_count())
|
|
23
|
+
pool_size: 0
|
|
24
|
+
|
|
25
|
+
# Show the progress bar
|
|
26
|
+
progress_bar: true
|
|
27
|
+
|
|
28
|
+
# Per variable type description settings
|
|
29
|
+
vars:
|
|
30
|
+
num:
|
|
31
|
+
quantiles:
|
|
32
|
+
- 0.05
|
|
33
|
+
- 0.25
|
|
34
|
+
- 0.5
|
|
35
|
+
- 0.75
|
|
36
|
+
- 0.95
|
|
37
|
+
skewness_threshold: 20
|
|
38
|
+
low_categorical_threshold: 5
|
|
39
|
+
# Set to zero to disable
|
|
40
|
+
chi_squared_threshold: 0
|
|
41
|
+
cat:
|
|
42
|
+
length: false
|
|
43
|
+
characters: false
|
|
44
|
+
words: false
|
|
45
|
+
cardinality_threshold: 50
|
|
46
|
+
n_obs: 5
|
|
47
|
+
# Set to zero to disable
|
|
48
|
+
chi_squared_threshold: 0
|
|
49
|
+
coerce_str_to_date: false
|
|
50
|
+
redact: false
|
|
51
|
+
histogram_largest: 10
|
|
52
|
+
stop_words: []
|
|
53
|
+
bool:
|
|
54
|
+
n_obs: 3
|
|
55
|
+
# string to boolean mapping dict
|
|
56
|
+
mappings:
|
|
57
|
+
"t": true
|
|
58
|
+
"f": false
|
|
59
|
+
"yes": true
|
|
60
|
+
"no": false
|
|
61
|
+
"y": true
|
|
62
|
+
"n": false
|
|
63
|
+
"true": true
|
|
64
|
+
"false": false
|
|
65
|
+
path:
|
|
66
|
+
active: false
|
|
67
|
+
file:
|
|
68
|
+
active: false
|
|
69
|
+
image:
|
|
70
|
+
active: false
|
|
71
|
+
exif: false
|
|
72
|
+
hash: false
|
|
73
|
+
url:
|
|
74
|
+
active: false
|
|
75
|
+
timeseries:
|
|
76
|
+
active: false
|
|
77
|
+
autocorrelation: 0.7
|
|
78
|
+
lags:
|
|
79
|
+
- 1
|
|
80
|
+
- 7
|
|
81
|
+
- 12
|
|
82
|
+
- 24
|
|
83
|
+
- 30
|
|
84
|
+
significance: 0.05
|
|
85
|
+
pacf_acf_lag: 100
|
|
86
|
+
|
|
87
|
+
# Sort the variables. Possible values: "ascending", "descending" or null (leaves original sorting)
|
|
88
|
+
sort: null
|
|
89
|
+
|
|
90
|
+
# which diagrams to show
|
|
91
|
+
missing_diagrams:
|
|
92
|
+
bar: false
|
|
93
|
+
matrix: false
|
|
94
|
+
heatmap: false
|
|
95
|
+
|
|
96
|
+
correlations:
|
|
97
|
+
pearson:
|
|
98
|
+
calculate: false
|
|
99
|
+
warn_high_correlations: true
|
|
100
|
+
threshold: 0.9
|
|
101
|
+
spearman:
|
|
102
|
+
calculate: false
|
|
103
|
+
warn_high_correlations: false
|
|
104
|
+
threshold: 0.9
|
|
105
|
+
kendall:
|
|
106
|
+
calculate: false
|
|
107
|
+
warn_high_correlations: false
|
|
108
|
+
threshold: 0.9
|
|
109
|
+
cramers:
|
|
110
|
+
calculate: false
|
|
111
|
+
warn_high_correlations: true
|
|
112
|
+
threshold: 0.9
|
|
113
|
+
auto:
|
|
114
|
+
calculate: false
|
|
115
|
+
warn_high_correlations: true
|
|
116
|
+
threshold: 0.9
|
|
117
|
+
|
|
118
|
+
# Bivariate / Pairwise relations
|
|
119
|
+
interactions:
|
|
120
|
+
targets: []
|
|
121
|
+
continuous: false
|
|
122
|
+
|
|
123
|
+
# For categorical
|
|
124
|
+
categorical_maximum_correlation_distinct: 100
|
|
125
|
+
|
|
126
|
+
report:
|
|
127
|
+
precision: 10
|
|
128
|
+
|
|
129
|
+
# Plot-specific settings
|
|
130
|
+
plot:
|
|
131
|
+
|
|
132
|
+
scatter_threshold: 1000
|
|
133
|
+
|
|
134
|
+
correlation:
|
|
135
|
+
cmap: RdBu
|
|
136
|
+
bad: "#000000"
|
|
137
|
+
|
|
138
|
+
missing:
|
|
139
|
+
cmap: RdBu
|
|
140
|
+
# Force labels when there are > 50 variables
|
|
141
|
+
force_labels: true
|
|
142
|
+
|
|
143
|
+
cat_freq:
|
|
144
|
+
show: true # if false, the category frequency plot is turned off
|
|
145
|
+
type: bar # options: 'bar', 'pie'
|
|
146
|
+
max_unique: 0
|
|
147
|
+
colors: null # null for the report palette, or a list of CSS colours
|
|
148
|
+
|
|
149
|
+
histogram:
|
|
150
|
+
x_axis_labels: true
|
|
151
|
+
|
|
152
|
+
# Number of bins (set to 0 to automatically detect the bin size)
|
|
153
|
+
bins: 50
|
|
154
|
+
|
|
155
|
+
# Maximum number of bins (when bins=0)
|
|
156
|
+
max_bins: 250
|
|
157
|
+
|
|
158
|
+
font_path: null
|
|
159
|
+
|
|
160
|
+
# The number of observations to show
|
|
161
|
+
n_obs_unique: 5
|
|
162
|
+
n_extreme_obs: 5
|
|
163
|
+
n_freq_table_max: 10
|
|
164
|
+
|
|
165
|
+
# Use `deep` flag for memory_usage
|
|
166
|
+
memory_deep: false
|
|
167
|
+
|
|
168
|
+
# Configuration related to the duplicates
|
|
169
|
+
duplicates:
|
|
170
|
+
head: 0
|
|
171
|
+
key: "# duplicates"
|
|
172
|
+
|
|
173
|
+
# Configuration related to the samples area
|
|
174
|
+
samples:
|
|
175
|
+
head: 0
|
|
176
|
+
tail: 0
|
|
177
|
+
random: 0
|
|
178
|
+
|
|
179
|
+
# Configuration related to the rejection of variables
|
|
180
|
+
reject_variables: true
|
|
181
|
+
|
|
182
|
+
# When in a Jupyter notebook
|
|
183
|
+
notebook:
|
|
184
|
+
iframe:
|
|
185
|
+
height: 800px
|
|
186
|
+
width: 100%
|
|
187
|
+
# or 'src'
|
|
188
|
+
attribute: srcdoc
|
|
189
|
+
|
|
190
|
+
html:
|
|
191
|
+
# Minify the html
|
|
192
|
+
minify_html: true
|
|
193
|
+
|
|
194
|
+
# Offline support
|
|
195
|
+
use_local_assets: true
|
|
196
|
+
|
|
197
|
+
# If true, single file, else directory with assets
|
|
198
|
+
inline: true
|
|
199
|
+
|
|
200
|
+
# Show navbar
|
|
201
|
+
navbar_show: true
|
|
202
|
+
|
|
203
|
+
# Assets prefix if inline = true
|
|
204
|
+
assets_prefix: null
|
|
205
|
+
|
|
206
|
+
# Styling options for the HTML report
|
|
207
|
+
style:
|
|
208
|
+
# light (default), dark or auto (follows the viewer's system setting)
|
|
209
|
+
theme: null
|
|
210
|
+
# Let the host page show through the report background (embedding)
|
|
211
|
+
transparent_background: false
|
|
212
|
+
logo: ""
|
|
213
|
+
primary_colors:
|
|
214
|
+
- "#0d6efd"
|
|
215
|
+
- "#dc3545"
|
|
216
|
+
- "#198754"
|
|
217
|
+
|
|
218
|
+
full_width: false
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"""The controller module handles all user interaction with the package (console, jupyter, etc.)."""
|
|
@@ -0,0 +1,127 @@
|
|
|
1
|
+
"""The ``polars_data_profiling`` command line interface."""
|
|
2
|
+
|
|
3
|
+
import argparse
|
|
4
|
+
from pathlib import Path
|
|
5
|
+
from typing import Any
|
|
6
|
+
|
|
7
|
+
from polars_data_profiling.profile_report import ProfileReport
|
|
8
|
+
from polars_data_profiling.utils.dataframe import read_polars
|
|
9
|
+
from polars_data_profiling.version import __version__
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
def parse_args(args: list[Any] | None = None) -> argparse.Namespace:
|
|
13
|
+
"""Parse the command line arguments for the `polars_data_profiling` binary.
|
|
14
|
+
|
|
15
|
+
Args:
|
|
16
|
+
args: List of input arguments. (Default value=None).
|
|
17
|
+
|
|
18
|
+
Returns:
|
|
19
|
+
Namespace with parsed arguments.
|
|
20
|
+
|
|
21
|
+
"""
|
|
22
|
+
parser = argparse.ArgumentParser(
|
|
23
|
+
description="Profile a CSV, Parquet, IPC or JSON file with Polars and write an HTML (or JSON) report."
|
|
24
|
+
)
|
|
25
|
+
|
|
26
|
+
# Version
|
|
27
|
+
parser.add_argument(
|
|
28
|
+
"--version", action="version", version=f"%(prog)s {__version__}"
|
|
29
|
+
)
|
|
30
|
+
|
|
31
|
+
# Console specific
|
|
32
|
+
parser.add_argument(
|
|
33
|
+
"-s",
|
|
34
|
+
"--silent",
|
|
35
|
+
help="Only generate but do not open report",
|
|
36
|
+
action="store_true",
|
|
37
|
+
)
|
|
38
|
+
|
|
39
|
+
parser.add_argument(
|
|
40
|
+
"-m",
|
|
41
|
+
"--minimal",
|
|
42
|
+
help="Minimal configuration for big data sets",
|
|
43
|
+
action="store_true",
|
|
44
|
+
)
|
|
45
|
+
|
|
46
|
+
parser.add_argument(
|
|
47
|
+
"-e",
|
|
48
|
+
"--explorative",
|
|
49
|
+
help="Explorative configuration featuring unicode, file and image analysis",
|
|
50
|
+
action="store_true",
|
|
51
|
+
)
|
|
52
|
+
|
|
53
|
+
# Config
|
|
54
|
+
parser.add_argument(
|
|
55
|
+
"--pool_size", type=int, default=0, help="Number of CPU cores to use"
|
|
56
|
+
)
|
|
57
|
+
parser.add_argument(
|
|
58
|
+
"--title",
|
|
59
|
+
type=str,
|
|
60
|
+
default="Profiling Report",
|
|
61
|
+
help="Title for the report",
|
|
62
|
+
)
|
|
63
|
+
|
|
64
|
+
parser.add_argument(
|
|
65
|
+
"--infer_dtypes",
|
|
66
|
+
default=True,
|
|
67
|
+
action="store_true",
|
|
68
|
+
help="Infer variable types from the values (default)",
|
|
69
|
+
)
|
|
70
|
+
|
|
71
|
+
parser.add_argument(
|
|
72
|
+
"--no-infer_dtypes",
|
|
73
|
+
dest="infer_dtypes",
|
|
74
|
+
action="store_false",
|
|
75
|
+
help="Use the dtypes the file was read with",
|
|
76
|
+
)
|
|
77
|
+
|
|
78
|
+
parser.add_argument(
|
|
79
|
+
"--config_file",
|
|
80
|
+
type=str,
|
|
81
|
+
default=None,
|
|
82
|
+
help="Specify a yaml config file. Have a look at the 'config_default.yaml' as a starting point.",
|
|
83
|
+
)
|
|
84
|
+
|
|
85
|
+
parser.add_argument(
|
|
86
|
+
"input_file",
|
|
87
|
+
type=str,
|
|
88
|
+
help="CSV, TSV, Parquet, Arrow IPC/Feather, NDJSON or JSON file to profile (read lazily)",
|
|
89
|
+
)
|
|
90
|
+
parser.add_argument(
|
|
91
|
+
"output_file",
|
|
92
|
+
type=str,
|
|
93
|
+
nargs="?",
|
|
94
|
+
help="Output report file. If empty, replaces the input_file's extension with .html and uses that.",
|
|
95
|
+
default=None,
|
|
96
|
+
)
|
|
97
|
+
|
|
98
|
+
return parser.parse_args(args)
|
|
99
|
+
|
|
100
|
+
|
|
101
|
+
def main(args: list[Any] | None = None) -> None:
|
|
102
|
+
"""Run the `polars_data_profiling` package.
|
|
103
|
+
|
|
104
|
+
Args:
|
|
105
|
+
args: Arguments for the programme (Default value=None).
|
|
106
|
+
"""
|
|
107
|
+
|
|
108
|
+
# Parse the arguments
|
|
109
|
+
parsed_args = parse_args(args)
|
|
110
|
+
kwargs = vars(parsed_args)
|
|
111
|
+
|
|
112
|
+
input_file = Path(kwargs.pop("input_file"))
|
|
113
|
+
output_file = kwargs.pop("output_file")
|
|
114
|
+
if output_file is None:
|
|
115
|
+
output_file = str(input_file.with_suffix(".html"))
|
|
116
|
+
|
|
117
|
+
silent = kwargs.pop("silent")
|
|
118
|
+
|
|
119
|
+
# open the file lazily
|
|
120
|
+
df = read_polars(input_file)
|
|
121
|
+
|
|
122
|
+
# Generate the profiling report
|
|
123
|
+
p = ProfileReport(
|
|
124
|
+
df,
|
|
125
|
+
**kwargs,
|
|
126
|
+
)
|
|
127
|
+
p.to_file(Path(output_file), silent=silent)
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
"""The ``profile`` namespace on Polars frames.
|
|
2
|
+
|
|
3
|
+
Importing ``polars_data_profiling`` registers it, so that::
|
|
4
|
+
|
|
5
|
+
df.profile.report(title="My data") # pl.DataFrame
|
|
6
|
+
pl.scan_parquet("big.parquet").profile.report(minimal=True) # pl.LazyFrame
|
|
7
|
+
|
|
8
|
+
return a :class:`~polars_data_profiling.ProfileReport`.
|
|
9
|
+
"""
|
|
10
|
+
|
|
11
|
+
from __future__ import annotations
|
|
12
|
+
|
|
13
|
+
from typing import Any
|
|
14
|
+
|
|
15
|
+
import polars as pl
|
|
16
|
+
|
|
17
|
+
from polars_data_profiling.profile_report import ProfileReport
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
class _ProfileNamespace:
|
|
21
|
+
def __init__(self, frame: pl.DataFrame | pl.LazyFrame) -> None:
|
|
22
|
+
self._frame = frame
|
|
23
|
+
|
|
24
|
+
def report(self, **kwargs: Any) -> ProfileReport:
|
|
25
|
+
"""Profile this frame.
|
|
26
|
+
|
|
27
|
+
Args:
|
|
28
|
+
**kwargs: any argument of :class:`~polars_data_profiling.ProfileReport`
|
|
29
|
+
(``minimal``, ``title``, ``tsmode``, ...).
|
|
30
|
+
|
|
31
|
+
Returns:
|
|
32
|
+
The (lazily computed) report.
|
|
33
|
+
"""
|
|
34
|
+
return ProfileReport(self._frame, **kwargs)
|
|
35
|
+
|
|
36
|
+
|
|
37
|
+
pl.api.register_dataframe_namespace("profile")(_ProfileNamespace)
|
|
38
|
+
pl.api.register_lazyframe_namespace("profile")(_ProfileNamespace)
|