dataprof 0.5.10__cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.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.
- dataprof/__init__.py +370 -0
- dataprof/__init__.pyi +301 -0
- dataprof/_dataprof.cpython-39-aarch64-linux-gnu.so +0 -0
- dataprof/py.typed +0 -0
- dataprof-0.5.10.dist-info/METADATA +262 -0
- dataprof-0.5.10.dist-info/RECORD +9 -0
- dataprof-0.5.10.dist-info/WHEEL +5 -0
- dataprof-0.5.10.dist-info/licenses/LICENSE +21 -0
- dataprof-0.5.10.dist-info/licenses/LICENSE-APACHE +89 -0
dataprof/__init__.py
ADDED
|
@@ -0,0 +1,370 @@
|
|
|
1
|
+
"""DataProf Python bindings"""
|
|
2
|
+
|
|
3
|
+
from ._dataprof import *
|
|
4
|
+
from ._dataprof import __version__
|
|
5
|
+
|
|
6
|
+
# Core exports for data profiling
|
|
7
|
+
__all__ = [
|
|
8
|
+
# Core analysis functions
|
|
9
|
+
"analyze_csv_file",
|
|
10
|
+
"analyze_csv_with_quality",
|
|
11
|
+
"analyze_json_file",
|
|
12
|
+
"calculate_data_quality_metrics",
|
|
13
|
+
"batch_analyze_glob",
|
|
14
|
+
"batch_analyze_directory",
|
|
15
|
+
|
|
16
|
+
# Python logging integration
|
|
17
|
+
"configure_logging",
|
|
18
|
+
"get_logger",
|
|
19
|
+
"log_info",
|
|
20
|
+
"log_debug",
|
|
21
|
+
"log_warning",
|
|
22
|
+
"log_error",
|
|
23
|
+
|
|
24
|
+
# Enhanced analysis with logging
|
|
25
|
+
"analyze_csv_with_logging",
|
|
26
|
+
|
|
27
|
+
# Arrow/PyCapsule interface
|
|
28
|
+
"analyze_csv_to_arrow",
|
|
29
|
+
"profile_dataframe",
|
|
30
|
+
"profile_arrow",
|
|
31
|
+
"RecordBatch",
|
|
32
|
+
|
|
33
|
+
# Core classes
|
|
34
|
+
"PyColumnProfile",
|
|
35
|
+
"PyQualityReport",
|
|
36
|
+
"PyDataQualityMetrics",
|
|
37
|
+
"PyBatchResult",
|
|
38
|
+
|
|
39
|
+
# Context managers
|
|
40
|
+
"PyBatchAnalyzer",
|
|
41
|
+
"PyCsvProcessor",
|
|
42
|
+
|
|
43
|
+
# High-level API
|
|
44
|
+
"profile",
|
|
45
|
+
"ProfileReport",
|
|
46
|
+
]
|
|
47
|
+
|
|
48
|
+
# Conditionally add parquet support if available
|
|
49
|
+
try:
|
|
50
|
+
from ._dataprof import analyze_parquet_to_arrow
|
|
51
|
+
__all__.append("analyze_parquet_to_arrow")
|
|
52
|
+
except ImportError:
|
|
53
|
+
# Parquet support is optional; skip if not available in this build.
|
|
54
|
+
pass
|
|
55
|
+
|
|
56
|
+
import json
|
|
57
|
+
import os
|
|
58
|
+
from ._dataprof import analyze_csv_with_quality, PyQualityReport
|
|
59
|
+
|
|
60
|
+
class ProfileReport:
|
|
61
|
+
"""
|
|
62
|
+
High-level wrapper for DataProf reports with export capabilities.
|
|
63
|
+
"""
|
|
64
|
+
def __init__(self, report: PyQualityReport):
|
|
65
|
+
self.report = report
|
|
66
|
+
|
|
67
|
+
def save(self, path: str):
|
|
68
|
+
"""
|
|
69
|
+
Save the profile report to a file.
|
|
70
|
+
Format is inferred from extension: .html or .json
|
|
71
|
+
"""
|
|
72
|
+
if path.endswith('.html'):
|
|
73
|
+
content = self._to_html()
|
|
74
|
+
with open(path, 'w', encoding='utf-8') as f:
|
|
75
|
+
f.write(content)
|
|
76
|
+
elif path.endswith('.json'):
|
|
77
|
+
content = self._to_json()
|
|
78
|
+
with open(path, 'w', encoding='utf-8') as f:
|
|
79
|
+
f.write(content)
|
|
80
|
+
else:
|
|
81
|
+
raise ValueError("Unsupported format. Please use .html or .json")
|
|
82
|
+
return self
|
|
83
|
+
|
|
84
|
+
def _to_json(self):
|
|
85
|
+
# Basic JSON dump of the metrics
|
|
86
|
+
data = {
|
|
87
|
+
"file_path": self.report.file_path,
|
|
88
|
+
"total_rows": self.report.total_rows,
|
|
89
|
+
"total_columns": self.report.total_columns,
|
|
90
|
+
"scan_time_ms": self.report.scan_time_ms,
|
|
91
|
+
"quality_score": self.report.quality_score(),
|
|
92
|
+
"columns": []
|
|
93
|
+
}
|
|
94
|
+
for col in self.report.column_profiles:
|
|
95
|
+
data["columns"].append({
|
|
96
|
+
"name": col.name,
|
|
97
|
+
"type": col.data_type,
|
|
98
|
+
"null_percentage": col.null_percentage
|
|
99
|
+
})
|
|
100
|
+
return json.dumps(data, indent=2)
|
|
101
|
+
|
|
102
|
+
def _to_html(self):
|
|
103
|
+
# Generate variable cards
|
|
104
|
+
variables_html = ""
|
|
105
|
+
for i, col in enumerate(self.report.column_profiles):
|
|
106
|
+
unique_display = f"{col.unique_count:,}" if col.unique_count is not None else "N/A"
|
|
107
|
+
null_color = "bg-green-500" if col.null_percentage == 0 else ("bg-yellow-500" if col.null_percentage < 5 else "bg-red-500")
|
|
108
|
+
|
|
109
|
+
# Badge color based on type
|
|
110
|
+
type_badge_color = "bg-gray-100 text-gray-800"
|
|
111
|
+
if col.data_type.lower() in ['integer', 'float', 'number']:
|
|
112
|
+
type_badge_color = "bg-blue-100 text-blue-800"
|
|
113
|
+
elif col.data_type.lower() in ['string', 'text']:
|
|
114
|
+
type_badge_color = "bg-green-100 text-green-800"
|
|
115
|
+
elif col.data_type.lower() in ['date', 'datetime']:
|
|
116
|
+
type_badge_color = "bg-purple-100 text-purple-800"
|
|
117
|
+
|
|
118
|
+
variables_html += f"""
|
|
119
|
+
<div class="variable-card bg-white rounded-lg border border-gray-200 p-6 hover:shadow-md transition-shadow duration-200" data-name="{col.name.lower()}">
|
|
120
|
+
<div class="flex flex-col md:flex-row md:items-start md:justify-between gap-4">
|
|
121
|
+
<div class="flex-1">
|
|
122
|
+
<div class="flex items-center gap-3 mb-2">
|
|
123
|
+
<h3 class="text-lg font-bold text-gray-900 font-mono">{col.name}</h3>
|
|
124
|
+
<span class="px-2.5 py-0.5 rounded-full text-xs font-medium {type_badge_color} border border-opacity-20">{col.data_type}</span>
|
|
125
|
+
</div>
|
|
126
|
+
|
|
127
|
+
<div class="grid grid-cols-2 sm:grid-cols-4 gap-4 mt-4">
|
|
128
|
+
<!-- Valid -->
|
|
129
|
+
<div class="flex flex-col">
|
|
130
|
+
<span class="text-xs text-gray-500 uppercase tracking-wider font-semibold">Count</span>
|
|
131
|
+
<span class="text-sm font-medium text-gray-900">{col.total_count:,}</span>
|
|
132
|
+
</div>
|
|
133
|
+
|
|
134
|
+
<!-- Missing -->
|
|
135
|
+
<div class="flex flex-col">
|
|
136
|
+
<span class="text-xs text-gray-500 uppercase tracking-wider font-semibold">Missing</span>
|
|
137
|
+
<div class="flex items-baseline gap-1">
|
|
138
|
+
<span class="text-sm font-medium {('text-red-600' if col.null_percentage > 0 else 'text-gray-900')}">
|
|
139
|
+
{col.null_count:,}
|
|
140
|
+
</span>
|
|
141
|
+
<span class="text-xs text-gray-400">({col.null_percentage:.1f}%)</span>
|
|
142
|
+
</div>
|
|
143
|
+
</div>
|
|
144
|
+
|
|
145
|
+
<!-- Unique -->
|
|
146
|
+
<div class="flex flex-col">
|
|
147
|
+
<span class="text-xs text-gray-500 uppercase tracking-wider font-semibold">Distinct</span>
|
|
148
|
+
<span class="text-sm font-medium text-gray-900">{unique_display}</span>
|
|
149
|
+
</div>
|
|
150
|
+
|
|
151
|
+
<!-- Memory/Other (Placeholder) -->
|
|
152
|
+
<div class="flex flex-col">
|
|
153
|
+
<span class="text-xs text-gray-500 uppercase tracking-wider font-semibold">Uniqueness</span>
|
|
154
|
+
<span class="text-sm font-medium text-gray-900">{col.uniqueness_ratio * 100:.1f}%</span>
|
|
155
|
+
</div>
|
|
156
|
+
</div>
|
|
157
|
+
</div>
|
|
158
|
+
|
|
159
|
+
<!-- Mini Visualization Bars -->
|
|
160
|
+
<div class="w-full md:w-48 flex flex-col gap-3 pt-2">
|
|
161
|
+
<div class="w-full">
|
|
162
|
+
<div class="flex justify-between text-xs mb-1">
|
|
163
|
+
<span class="text-gray-500">Completeness</span>
|
|
164
|
+
<span class="text-gray-700 font-medium">{100 - col.null_percentage:.1f}%</span>
|
|
165
|
+
</div>
|
|
166
|
+
<div class="w-full bg-gray-100 rounded-full h-2 overflow-hidden">
|
|
167
|
+
<div class="{null_color} h-2 rounded-full" style="width: {100 - col.null_percentage}%"></div>
|
|
168
|
+
</div>
|
|
169
|
+
</div>
|
|
170
|
+
<div class="w-full">
|
|
171
|
+
<div class="flex justify-between text-xs mb-1">
|
|
172
|
+
<span class="text-gray-500">Uniqueness</span>
|
|
173
|
+
<span class="text-gray-700 font-medium">{col.uniqueness_ratio * 100:.1f}%</span>
|
|
174
|
+
</div>
|
|
175
|
+
<div class="w-full bg-gray-100 rounded-full h-2 overflow-hidden">
|
|
176
|
+
<div class="bg-blue-500 h-2 rounded-full" style="width: {col.uniqueness_ratio * 100}%"></div>
|
|
177
|
+
</div>
|
|
178
|
+
</div>
|
|
179
|
+
</div>
|
|
180
|
+
</div>
|
|
181
|
+
</div>
|
|
182
|
+
"""
|
|
183
|
+
|
|
184
|
+
# Current date for footer
|
|
185
|
+
from datetime import datetime
|
|
186
|
+
generated_date = datetime.now().strftime("%Y-%m-%d %H:%M")
|
|
187
|
+
|
|
188
|
+
html = f"""
|
|
189
|
+
<!DOCTYPE html>
|
|
190
|
+
<html lang="en" class="scroll-smooth">
|
|
191
|
+
<head>
|
|
192
|
+
<meta charset="UTF-8">
|
|
193
|
+
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
194
|
+
<title>Data Analysis Report - {self.report.file_path}</title>
|
|
195
|
+
<script src="https://cdn.tailwindcss.com"></script>
|
|
196
|
+
<script>
|
|
197
|
+
tailwind.config = {{
|
|
198
|
+
theme: {{
|
|
199
|
+
extend: {{
|
|
200
|
+
colors: {{
|
|
201
|
+
slate: {{ 850: '#1e293b' }}
|
|
202
|
+
}}
|
|
203
|
+
}}
|
|
204
|
+
}}
|
|
205
|
+
}}
|
|
206
|
+
</script>
|
|
207
|
+
<style>
|
|
208
|
+
body {{ font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif; }}
|
|
209
|
+
.sidebar {{ width: 280px; }}
|
|
210
|
+
.content {{ margin-left: 280px; }}
|
|
211
|
+
@media (max-width: 1024px) {{
|
|
212
|
+
.sidebar {{ display: none; }}
|
|
213
|
+
.content {{ margin-left: 0; }}
|
|
214
|
+
}}
|
|
215
|
+
</style>
|
|
216
|
+
<link href="https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap" rel="stylesheet">
|
|
217
|
+
</head>
|
|
218
|
+
<body class="bg-slate-50 text-slate-900 antialiased">
|
|
219
|
+
|
|
220
|
+
<!-- Mobile Header -->
|
|
221
|
+
<div class="lg:hidden bg-slate-900 text-white p-4 flex items-center justify-between sticky top-0 z-50">
|
|
222
|
+
<h1 class="font-bold text-xl">DataProf</h1>
|
|
223
|
+
<span class="text-xs text-slate-400">v0.4</span>
|
|
224
|
+
</div>
|
|
225
|
+
|
|
226
|
+
<div class="flex min-h-screen">
|
|
227
|
+
<!-- Sidebar -->
|
|
228
|
+
<aside class="sidebar fixed inset-y-0 left-0 bg-slate-900 text-white z-40 overflow-y-auto hidden lg:block">
|
|
229
|
+
<div class="p-6">
|
|
230
|
+
<div class="flex item-center gap-3 mb-8">
|
|
231
|
+
<div class="w-8 h-8 rounded bg-gradient-to-br from-blue-400 to-indigo-600 flex items-center justify-center font-bold text-lg">D</div>
|
|
232
|
+
<span class="font-bold text-xl tracking-tight">DataProf</span>
|
|
233
|
+
</div>
|
|
234
|
+
|
|
235
|
+
<nav class="space-y-1">
|
|
236
|
+
<a href="#overview" class="flex items-center gap-3 px-3 py-2 text-slate-100 bg-slate-800 rounded-md transition-colors">
|
|
237
|
+
<svg class="w-5 h-5" fill="none" stroke="currentColor" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 19v-6a2 2 0 00-2-2H5a2 2 0 00-2 2v6a2 2 0 002 2h2a2 2 0 002-2zm0 0V9a2 2 0 012-2h2a2 2 0 012 2v10m-6 0a2 2 0 002 2h2a2 2 0 002-2m0 0V5a2 2 0 012-2h2a2 2 0 012 2v14a2 2 0 01-2 2h-2a2 2 0 01-2-2z"></path></svg>
|
|
238
|
+
Overview
|
|
239
|
+
</a>
|
|
240
|
+
<a href="#variables" class="flex items-center gap-3 px-3 py-2 text-slate-400 hover:text-white hover:bg-slate-800 rounded-md transition-colors">
|
|
241
|
+
<svg class="w-5 h-5" fill="none" stroke="currentColor" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M4 6h16M4 10h16M4 14h16M4 18h16"></path></svg>
|
|
242
|
+
Variables ({len(self.report.column_profiles)})
|
|
243
|
+
</a>
|
|
244
|
+
</nav>
|
|
245
|
+
|
|
246
|
+
<div class="mt-8 pt-8 border-t border-slate-700">
|
|
247
|
+
<h3 class="text-xs font-semibold text-slate-500 uppercase tracking-wider mb-4">Meta Info</h3>
|
|
248
|
+
<div class="space-y-3 text-sm text-slate-400">
|
|
249
|
+
<div class="flex justify-between">
|
|
250
|
+
<span>Rows</span>
|
|
251
|
+
<span class="text-white">{self.report.total_rows:,}</span>
|
|
252
|
+
</div>
|
|
253
|
+
<div class="flex justify-between">
|
|
254
|
+
<span>Columns</span>
|
|
255
|
+
<span class="text-white">{self.report.total_columns}</span>
|
|
256
|
+
</div>
|
|
257
|
+
<div class="flex justify-between">
|
|
258
|
+
<span>Analysis Time</span>
|
|
259
|
+
<span class="text-white">{self.report.scan_time_ms:,}ms</span>
|
|
260
|
+
</div>
|
|
261
|
+
</div>
|
|
262
|
+
</div>
|
|
263
|
+
</div>
|
|
264
|
+
</aside>
|
|
265
|
+
|
|
266
|
+
<!-- Main Content -->
|
|
267
|
+
<main class="content flex-1 min-w-0">
|
|
268
|
+
<div class="max-w-5xl mx-auto p-4 lg:p-10">
|
|
269
|
+
|
|
270
|
+
<!-- Header -->
|
|
271
|
+
<header id="overview" class="mb-10">
|
|
272
|
+
<div class="flex justify-between items-start mb-6">
|
|
273
|
+
<div>
|
|
274
|
+
<h1 class="text-3xl font-bold text-gray-900 mb-2">Analysis Report</h1>
|
|
275
|
+
<p class="text-gray-500 font-mono text-sm break-all">{self.report.file_path}</p>
|
|
276
|
+
</div>
|
|
277
|
+
<div class="hidden sm:block text-right">
|
|
278
|
+
<div class="text-sm text-gray-500">Generated on</div>
|
|
279
|
+
<div class="font-medium text-gray-900">{generated_date}</div>
|
|
280
|
+
</div>
|
|
281
|
+
</div>
|
|
282
|
+
|
|
283
|
+
<!-- Metrics Grid -->
|
|
284
|
+
<div class="grid grid-cols-1 md:grid-cols-2 lg:grid-cols-4 gap-4">
|
|
285
|
+
<div class="bg-white p-5 rounded-xl border border-gray-200 shadow-sm">
|
|
286
|
+
<div class="text-sm font-medium text-gray-500 mb-1">Quality Score</div>
|
|
287
|
+
<div class="flex items-baseline gap-2">
|
|
288
|
+
<span class="text-3xl font-bold text-blue-600">{self.report.quality_score():.1f}%</span>
|
|
289
|
+
</div>
|
|
290
|
+
</div>
|
|
291
|
+
<div class="bg-white p-5 rounded-xl border border-gray-200 shadow-sm">
|
|
292
|
+
<div class="text-sm font-medium text-gray-500 mb-1">Total Variables</div>
|
|
293
|
+
<div class="flex items-baseline gap-2">
|
|
294
|
+
<span class="text-3xl font-bold text-gray-900">{self.report.total_columns}</span>
|
|
295
|
+
</div>
|
|
296
|
+
</div>
|
|
297
|
+
<div class="bg-white p-5 rounded-xl border border-gray-200 shadow-sm">
|
|
298
|
+
<div class="text-sm font-medium text-gray-500 mb-1">Total Rows</div>
|
|
299
|
+
<div class="flex items-baseline gap-2">
|
|
300
|
+
<span class="text-3xl font-bold text-gray-900">{self.report.total_rows:,}</span>
|
|
301
|
+
</div>
|
|
302
|
+
</div>
|
|
303
|
+
<div class="bg-white p-5 rounded-xl border border-gray-200 shadow-sm">
|
|
304
|
+
<div class="text-sm font-medium text-gray-500 mb-1">Memory Usage</div>
|
|
305
|
+
<div class="flex items-baseline gap-2">
|
|
306
|
+
<span class="text-3xl font-bold text-purple-600">Low</span>
|
|
307
|
+
<span class="text-xs text-gray-400">Streamed</span>
|
|
308
|
+
</div>
|
|
309
|
+
</div>
|
|
310
|
+
</div>
|
|
311
|
+
</header>
|
|
312
|
+
|
|
313
|
+
<hr class="border-gray-200 my-10" />
|
|
314
|
+
|
|
315
|
+
<!-- Variables Section -->
|
|
316
|
+
<section id="variables">
|
|
317
|
+
<div class="flex flex-col sm:flex-row justify-between items-end sm:items-center mb-6 gap-4">
|
|
318
|
+
<h2 class="text-2xl font-bold text-gray-900">Variables</h2>
|
|
319
|
+
<input type="text" id="searchInput" placeholder="Search variables..." class="w-full sm:w-64 px-4 py-2 rounded-lg border border-gray-200 focus:outline-none focus:ring-2 focus:ring-blue-500 focus:border-transparent text-sm">
|
|
320
|
+
</div>
|
|
321
|
+
|
|
322
|
+
<div class="space-y-4" id="variablesContainer">
|
|
323
|
+
{variables_html}
|
|
324
|
+
</div>
|
|
325
|
+
</section>
|
|
326
|
+
|
|
327
|
+
<footer class="mt-20 pt-10 border-t border-gray-200 text-center text-gray-400 text-sm">
|
|
328
|
+
<p>Generated by <strong>DataProf</strong> - The High-Performance Data Profiler</p>
|
|
329
|
+
</footer>
|
|
330
|
+
</div>
|
|
331
|
+
</main>
|
|
332
|
+
</div>
|
|
333
|
+
|
|
334
|
+
<!-- Simple Search Script -->
|
|
335
|
+
<script>
|
|
336
|
+
document.getElementById('searchInput').addEventListener('input', function(e) {{
|
|
337
|
+
const term = e.target.value.toLowerCase();
|
|
338
|
+
const cards = document.querySelectorAll('.variable-card');
|
|
339
|
+
|
|
340
|
+
cards.forEach(card => {{
|
|
341
|
+
const name = card.getAttribute('data-name');
|
|
342
|
+
if (name.includes(term)) {{
|
|
343
|
+
card.style.display = 'block';
|
|
344
|
+
}} else {{
|
|
345
|
+
card.style.display = 'none';
|
|
346
|
+
}}
|
|
347
|
+
}});
|
|
348
|
+
}});
|
|
349
|
+
</script>
|
|
350
|
+
</body>
|
|
351
|
+
</html>
|
|
352
|
+
"""
|
|
353
|
+
return html
|
|
354
|
+
|
|
355
|
+
|
|
356
|
+
def profile(path: str) -> ProfileReport:
|
|
357
|
+
"""
|
|
358
|
+
Profile a file and return a report object.
|
|
359
|
+
|
|
360
|
+
Args:
|
|
361
|
+
path: Path to the file (CSV, etc)
|
|
362
|
+
|
|
363
|
+
Returns:
|
|
364
|
+
ProfileReport: object containing the analysis and .save() method
|
|
365
|
+
"""
|
|
366
|
+
# Simply call the quality analysis for now
|
|
367
|
+
# Future versions could dispatch based on file extension
|
|
368
|
+
report = analyze_csv_with_quality(path)
|
|
369
|
+
return ProfileReport(report)
|
|
370
|
+
|
dataprof/__init__.pyi
ADDED
|
@@ -0,0 +1,301 @@
|
|
|
1
|
+
"""
|
|
2
|
+
Type stubs for dataprof Python bindings.
|
|
3
|
+
|
|
4
|
+
This module provides data profiling and quality assessment functionality
|
|
5
|
+
implemented in Rust with Python bindings via PyO3.
|
|
6
|
+
"""
|
|
7
|
+
|
|
8
|
+
from typing import Any, Dict, List, Optional, Tuple, Union
|
|
9
|
+
from typing_extensions import Self
|
|
10
|
+
|
|
11
|
+
try:
|
|
12
|
+
import pandas as pd
|
|
13
|
+
_PANDAS_AVAILABLE = True
|
|
14
|
+
except ImportError:
|
|
15
|
+
_PANDAS_AVAILABLE = False
|
|
16
|
+
|
|
17
|
+
try:
|
|
18
|
+
import polars as pl
|
|
19
|
+
_POLARS_AVAILABLE = True
|
|
20
|
+
except ImportError:
|
|
21
|
+
_POLARS_AVAILABLE = False
|
|
22
|
+
|
|
23
|
+
# Type alias for Arrow-compatible DataFrames
|
|
24
|
+
if _PANDAS_AVAILABLE and _POLARS_AVAILABLE:
|
|
25
|
+
ArrowDataFrame = Union[pd.DataFrame, pl.DataFrame, "RecordBatch"]
|
|
26
|
+
elif _PANDAS_AVAILABLE:
|
|
27
|
+
ArrowDataFrame = Union[pd.DataFrame, "RecordBatch"]
|
|
28
|
+
elif _POLARS_AVAILABLE:
|
|
29
|
+
ArrowDataFrame = Union[pl.DataFrame, "RecordBatch"]
|
|
30
|
+
else:
|
|
31
|
+
ArrowDataFrame = "RecordBatch"
|
|
32
|
+
|
|
33
|
+
# Version is imported from Rust binary module (_dataprof)
|
|
34
|
+
__version__: str
|
|
35
|
+
|
|
36
|
+
# Core analysis functions
|
|
37
|
+
def analyze_csv_file(path: str) -> List[PyColumnProfile]: ...
|
|
38
|
+
def analyze_csv_with_quality(path: str) -> PyQualityReport: ...
|
|
39
|
+
def analyze_json_file(path: str) -> List[PyColumnProfile]: ...
|
|
40
|
+
def analyze_json_with_quality(path: str) -> PyQualityReport: ...
|
|
41
|
+
def calculate_data_quality_metrics(path: str) -> PyDataQualityMetrics: ...
|
|
42
|
+
|
|
43
|
+
# Parquet analysis functions (available with parquet feature)
|
|
44
|
+
def analyze_parquet_file(path: str) -> List[PyColumnProfile]: ...
|
|
45
|
+
def analyze_parquet_with_quality_py(path: str) -> PyQualityReport: ...
|
|
46
|
+
|
|
47
|
+
# Batch processing functions
|
|
48
|
+
# Supports CSV, JSON, JSONL, and Parquet files (Parquet requires parquet feature)
|
|
49
|
+
def batch_analyze_glob(
|
|
50
|
+
pattern: str,
|
|
51
|
+
parallel: Optional[bool] = None,
|
|
52
|
+
max_concurrent: Optional[int] = None,
|
|
53
|
+
html_output: Optional[str] = None,
|
|
54
|
+
) -> PyBatchResult: ...
|
|
55
|
+
|
|
56
|
+
def batch_analyze_directory(
|
|
57
|
+
directory: str,
|
|
58
|
+
recursive: Optional[bool] = None,
|
|
59
|
+
parallel: Optional[bool] = None,
|
|
60
|
+
max_concurrent: Optional[int] = None,
|
|
61
|
+
html_output: Optional[str] = None,
|
|
62
|
+
) -> PyBatchResult: ...
|
|
63
|
+
|
|
64
|
+
# Python logging integration
|
|
65
|
+
def configure_logging(level: Optional[str] = None, format: Optional[str] = None) -> None: ...
|
|
66
|
+
def get_logger(name: Optional[str] = None) -> Any: ...
|
|
67
|
+
def log_info(message: str, logger_name: Optional[str] = None) -> None: ...
|
|
68
|
+
def log_debug(message: str, logger_name: Optional[str] = None) -> None: ...
|
|
69
|
+
def log_warning(message: str, logger_name: Optional[str] = None) -> None: ...
|
|
70
|
+
def log_error(message: str, logger_name: Optional[str] = None) -> None: ...
|
|
71
|
+
|
|
72
|
+
# Enhanced analysis functions with logging
|
|
73
|
+
def analyze_csv_with_logging(file_path: str, log_level: Optional[str] = None) -> List[PyColumnProfile]: ...
|
|
74
|
+
|
|
75
|
+
# Pandas integration (conditional)
|
|
76
|
+
if _PANDAS_AVAILABLE:
|
|
77
|
+
def analyze_csv_dataframe(file_path: str) -> pd.DataFrame: ...
|
|
78
|
+
else:
|
|
79
|
+
def analyze_csv_dataframe(file_path: str) -> Any: ...
|
|
80
|
+
|
|
81
|
+
# Arrow/PyCapsule interface functions
|
|
82
|
+
def analyze_csv_to_arrow(path: str) -> "RecordBatch":
|
|
83
|
+
"""Analyze CSV file and return results as Arrow RecordBatch."""
|
|
84
|
+
...
|
|
85
|
+
|
|
86
|
+
def analyze_parquet_to_arrow(path: str) -> "RecordBatch":
|
|
87
|
+
"""Analyze Parquet file and return results as Arrow RecordBatch."""
|
|
88
|
+
...
|
|
89
|
+
|
|
90
|
+
def profile_dataframe(df: "ArrowDataFrame", name: str = "dataframe") -> PyQualityReport:
|
|
91
|
+
"""Profile a pandas or polars DataFrame directly via Arrow PyCapsule protocol."""
|
|
92
|
+
...
|
|
93
|
+
|
|
94
|
+
def profile_arrow(table: Any, name: str = "arrow_table") -> PyQualityReport:
|
|
95
|
+
"""Profile a PyArrow Table or RecordBatch directly (no auto-detection overhead)."""
|
|
96
|
+
...
|
|
97
|
+
|
|
98
|
+
# Core profiling classes exported from Rust
|
|
99
|
+
class PyColumnProfile:
|
|
100
|
+
"""Column profiling information from Rust."""
|
|
101
|
+
|
|
102
|
+
name: str
|
|
103
|
+
data_type: str
|
|
104
|
+
total_count: int
|
|
105
|
+
null_count: int
|
|
106
|
+
unique_count: Optional[int]
|
|
107
|
+
null_percentage: float
|
|
108
|
+
uniqueness_ratio: float
|
|
109
|
+
|
|
110
|
+
def __new__(cls) -> Self: ...
|
|
111
|
+
|
|
112
|
+
class PyQualityReport:
|
|
113
|
+
"""Complete quality report for a dataset."""
|
|
114
|
+
|
|
115
|
+
file_path: str
|
|
116
|
+
total_rows: Optional[int]
|
|
117
|
+
total_columns: int
|
|
118
|
+
column_profiles: List[PyColumnProfile]
|
|
119
|
+
rows_scanned: int
|
|
120
|
+
sampling_ratio: float
|
|
121
|
+
scan_time_ms: int
|
|
122
|
+
data_quality_metrics: PyDataQualityMetrics
|
|
123
|
+
source_type: str
|
|
124
|
+
source_library: Optional[str]
|
|
125
|
+
memory_bytes: Optional[int]
|
|
126
|
+
|
|
127
|
+
def __new__(cls) -> Self: ...
|
|
128
|
+
def quality_score(self) -> float: ...
|
|
129
|
+
def to_json(self) -> str: ...
|
|
130
|
+
|
|
131
|
+
class PyDataQualityMetrics:
|
|
132
|
+
"""ISO 8000/25012 compliant data quality metrics."""
|
|
133
|
+
|
|
134
|
+
# Overall Score
|
|
135
|
+
overall_quality_score: float
|
|
136
|
+
|
|
137
|
+
# Completeness
|
|
138
|
+
missing_values_ratio: float
|
|
139
|
+
complete_records_ratio: float
|
|
140
|
+
null_columns: List[str]
|
|
141
|
+
|
|
142
|
+
# Consistency
|
|
143
|
+
data_type_consistency: float
|
|
144
|
+
format_violations: int
|
|
145
|
+
encoding_issues: int
|
|
146
|
+
|
|
147
|
+
# Uniqueness
|
|
148
|
+
duplicate_rows: int
|
|
149
|
+
key_uniqueness: float
|
|
150
|
+
high_cardinality_warning: bool
|
|
151
|
+
|
|
152
|
+
# Accuracy
|
|
153
|
+
outlier_ratio: float
|
|
154
|
+
range_violations: int
|
|
155
|
+
negative_values_in_positive: int
|
|
156
|
+
|
|
157
|
+
# Timeliness (ISO 8000-8)
|
|
158
|
+
future_dates_count: int
|
|
159
|
+
stale_data_ratio: float
|
|
160
|
+
temporal_violations: int
|
|
161
|
+
|
|
162
|
+
def __new__(cls) -> Self: ...
|
|
163
|
+
def completeness_summary(self) -> str: ...
|
|
164
|
+
def consistency_summary(self) -> str: ...
|
|
165
|
+
def uniqueness_summary(self) -> str: ...
|
|
166
|
+
def accuracy_summary(self) -> str: ...
|
|
167
|
+
def timeliness_summary(self) -> str: ...
|
|
168
|
+
def summary_dict(self) -> Dict[str, str]: ...
|
|
169
|
+
def _repr_html_(self) -> str: ...
|
|
170
|
+
def __str__(self) -> str: ...
|
|
171
|
+
|
|
172
|
+
class PyBatchResult:
|
|
173
|
+
"""Result of batch processing operation."""
|
|
174
|
+
|
|
175
|
+
processed_files: int
|
|
176
|
+
failed_files: int
|
|
177
|
+
total_duration_secs: float
|
|
178
|
+
average_quality_score: float
|
|
179
|
+
|
|
180
|
+
def __new__(cls) -> Self: ...
|
|
181
|
+
|
|
182
|
+
# Context Manager Classes
|
|
183
|
+
class PyBatchAnalyzer:
|
|
184
|
+
"""Context manager for batch analysis with automatic cleanup.
|
|
185
|
+
|
|
186
|
+
Supports automatic format detection for CSV, JSON, JSONL, and Parquet files.
|
|
187
|
+
Files are analyzed using the appropriate parser based on file extension.
|
|
188
|
+
"""
|
|
189
|
+
|
|
190
|
+
def __new__(cls) -> Self: ...
|
|
191
|
+
def __enter__(self) -> Self: ...
|
|
192
|
+
def __exit__(self, exc_type: Any, exc_value: Any, traceback: Any) -> bool: ...
|
|
193
|
+
def add_file(self, path: str) -> None:
|
|
194
|
+
"""Add a file to analysis queue (auto-detects CSV/JSON/Parquet format)."""
|
|
195
|
+
...
|
|
196
|
+
def add_temp_file(self, path: str) -> None: ...
|
|
197
|
+
def get_results(self) -> List[Any]: ...
|
|
198
|
+
def analyze_batch(self, paths: List[str]) -> List[Any]:
|
|
199
|
+
"""Analyze multiple files in batch (auto-detects CSV/JSON/Parquet format)."""
|
|
200
|
+
...
|
|
201
|
+
|
|
202
|
+
class PyCsvProcessor:
|
|
203
|
+
"""Context manager for CSV file processing with automatic handling."""
|
|
204
|
+
|
|
205
|
+
def __new__(cls, chunk_size: Optional[int] = None) -> Self: ...
|
|
206
|
+
def __enter__(self) -> Self: ...
|
|
207
|
+
def __exit__(self, exc_type: Any, exc_value: Any, traceback: Any) -> bool: ...
|
|
208
|
+
def open_file(self, path: str) -> None: ...
|
|
209
|
+
def process_chunks(self) -> List[Any]: ...
|
|
210
|
+
def get_processing_info(self) -> Dict[str, Any]: ...
|
|
211
|
+
|
|
212
|
+
class RecordBatch:
|
|
213
|
+
"""Arrow RecordBatch with PyCapsule interface support for zero-copy exchange.
|
|
214
|
+
|
|
215
|
+
This class implements the Arrow PyCapsule Interface, enabling efficient
|
|
216
|
+
zero-copy data transfer between Rust and Python (pandas, polars, pyarrow).
|
|
217
|
+
"""
|
|
218
|
+
|
|
219
|
+
@property
|
|
220
|
+
def num_rows(self) -> int:
|
|
221
|
+
"""Number of rows in the batch."""
|
|
222
|
+
...
|
|
223
|
+
|
|
224
|
+
@property
|
|
225
|
+
def num_columns(self) -> int:
|
|
226
|
+
"""Number of columns in the batch."""
|
|
227
|
+
...
|
|
228
|
+
|
|
229
|
+
@property
|
|
230
|
+
def column_names(self) -> List[str]:
|
|
231
|
+
"""Column names as a list."""
|
|
232
|
+
...
|
|
233
|
+
|
|
234
|
+
def to_pandas(self) -> "pd.DataFrame":
|
|
235
|
+
"""Convert to pandas DataFrame (zero-copy if pyarrow available).
|
|
236
|
+
|
|
237
|
+
Requires pyarrow to be installed.
|
|
238
|
+
"""
|
|
239
|
+
...
|
|
240
|
+
|
|
241
|
+
def to_polars(self) -> "pl.DataFrame":
|
|
242
|
+
"""Convert to polars DataFrame (zero-copy).
|
|
243
|
+
|
|
244
|
+
Requires polars and pyarrow to be installed.
|
|
245
|
+
"""
|
|
246
|
+
...
|
|
247
|
+
|
|
248
|
+
def __arrow_c_schema__(self) -> object:
|
|
249
|
+
"""Arrow PyCapsule Interface: export schema as PyCapsule."""
|
|
250
|
+
...
|
|
251
|
+
|
|
252
|
+
def __arrow_c_array__(self, requested_schema: Optional[object] = None) -> Tuple[object, object]:
|
|
253
|
+
"""Arrow PyCapsule Interface: export array as (schema_capsule, array_capsule)."""
|
|
254
|
+
...
|
|
255
|
+
|
|
256
|
+
def __repr__(self) -> str: ...
|
|
257
|
+
|
|
258
|
+
# Export all public classes and functions
|
|
259
|
+
__all__ = [
|
|
260
|
+
# Core analysis functions
|
|
261
|
+
"analyze_csv_file",
|
|
262
|
+
"analyze_csv_with_quality",
|
|
263
|
+
"analyze_json_file",
|
|
264
|
+
"analyze_json_with_quality",
|
|
265
|
+
"analyze_parquet_file",
|
|
266
|
+
"analyze_parquet_with_quality_py",
|
|
267
|
+
"calculate_data_quality_metrics",
|
|
268
|
+
"batch_analyze_glob",
|
|
269
|
+
"batch_analyze_directory",
|
|
270
|
+
|
|
271
|
+
# Python logging integration
|
|
272
|
+
"configure_logging",
|
|
273
|
+
"get_logger",
|
|
274
|
+
"log_info",
|
|
275
|
+
"log_debug",
|
|
276
|
+
"log_warning",
|
|
277
|
+
"log_error",
|
|
278
|
+
|
|
279
|
+
# Enhanced analysis with logging
|
|
280
|
+
"analyze_csv_with_logging",
|
|
281
|
+
|
|
282
|
+
# Pandas integration
|
|
283
|
+
"analyze_csv_dataframe",
|
|
284
|
+
|
|
285
|
+
# Arrow/PyCapsule interface
|
|
286
|
+
"analyze_csv_to_arrow",
|
|
287
|
+
"analyze_parquet_to_arrow",
|
|
288
|
+
"profile_dataframe",
|
|
289
|
+
"profile_arrow",
|
|
290
|
+
"RecordBatch",
|
|
291
|
+
|
|
292
|
+
# Core classes
|
|
293
|
+
"PyColumnProfile",
|
|
294
|
+
"PyQualityReport",
|
|
295
|
+
"PyDataQualityMetrics",
|
|
296
|
+
"PyBatchResult",
|
|
297
|
+
|
|
298
|
+
# Context managers
|
|
299
|
+
"PyBatchAnalyzer",
|
|
300
|
+
"PyCsvProcessor",
|
|
301
|
+
]
|
|
Binary file
|
dataprof/py.typed
ADDED
|
File without changes
|
|
@@ -0,0 +1,262 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: dataprof
|
|
3
|
+
Version: 0.5.10
|
|
4
|
+
Classifier: Development Status :: 4 - Beta
|
|
5
|
+
Classifier: Intended Audience :: Developers
|
|
6
|
+
Classifier: Intended Audience :: Science/Research
|
|
7
|
+
Classifier: License :: OSI Approved :: MIT License
|
|
8
|
+
Classifier: Operating System :: POSIX
|
|
9
|
+
Classifier: Operating System :: Microsoft :: Windows
|
|
10
|
+
Classifier: Operating System :: MacOS :: MacOS X
|
|
11
|
+
Classifier: Programming Language :: Rust
|
|
12
|
+
Classifier: Programming Language :: Python :: Implementation :: CPython
|
|
13
|
+
Classifier: Programming Language :: Python :: Implementation :: PyPy
|
|
14
|
+
Classifier: Programming Language :: Python :: 3
|
|
15
|
+
Classifier: Programming Language :: Python :: 3.8
|
|
16
|
+
Classifier: Programming Language :: Python :: 3.9
|
|
17
|
+
Classifier: Programming Language :: Python :: 3.10
|
|
18
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
19
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
20
|
+
Classifier: Topic :: Scientific/Engineering
|
|
21
|
+
Classifier: Topic :: Software Development :: Libraries :: Python Modules
|
|
22
|
+
Requires-Dist: pandas>=1.3.0 ; extra == 'all'
|
|
23
|
+
Requires-Dist: ipython>=7.0.0 ; extra == 'all'
|
|
24
|
+
Requires-Dist: numpy>=1.20.0 ; extra == 'all'
|
|
25
|
+
Requires-Dist: pandas>=1.3.0 ; extra == 'jupyter'
|
|
26
|
+
Requires-Dist: ipython>=7.0.0 ; extra == 'jupyter'
|
|
27
|
+
Requires-Dist: pandas>=1.3.0 ; extra == 'pandas'
|
|
28
|
+
Provides-Extra: all
|
|
29
|
+
Provides-Extra: jupyter
|
|
30
|
+
Provides-Extra: pandas
|
|
31
|
+
License-File: LICENSE
|
|
32
|
+
License-File: LICENSE-APACHE
|
|
33
|
+
Summary: Fast, lightweight data profiling and quality assessment library
|
|
34
|
+
Keywords: data,profiling,quality,csv,json,analysis,performance
|
|
35
|
+
Home-Page: https://github.com/AndreaBozzo/dataprof
|
|
36
|
+
Author-email: Andrea Bozzo <andreabozzo92@gmail.com>
|
|
37
|
+
Requires-Python: >=3.8
|
|
38
|
+
Description-Content-Type: text/markdown; charset=UTF-8; variant=GFM
|
|
39
|
+
Project-URL: Homepage, https://github.com/AndreaBozzo/dataprof
|
|
40
|
+
Project-URL: Issues, https://github.com/AndreaBozzo/dataprof/issues
|
|
41
|
+
Project-URL: Repository, https://github.com/AndreaBozzo/dataprof
|
|
42
|
+
|
|
43
|
+
<div align="center">
|
|
44
|
+
<img src="assets/images/logo.png" alt="dataprof logo" width="800" height="auto" />
|
|
45
|
+
<h1>dataprof</h1>
|
|
46
|
+
<p>
|
|
47
|
+
<strong>The High-Performance Profiler for Large Datasets</strong>
|
|
48
|
+
</p>
|
|
49
|
+
|
|
50
|
+
[](https://github.com/AndreaBozzo/dataprof/actions)
|
|
51
|
+
[](https://codecov.io/gh/AndreaBozzo/dataprof)
|
|
52
|
+
[](https://crates.io/crates/dataprof)
|
|
53
|
+
[](LICENSE)
|
|
54
|
+
[](https://pepy.tech/projects/dataprof)
|
|
55
|
+
</div>
|
|
56
|
+
|
|
57
|
+
<br />
|
|
58
|
+
|
|
59
|
+
> **Profile 50GB datasets in seconds on your laptop.**
|
|
60
|
+
|
|
61
|
+
DataProf is built for Data Scientists and Engineers who need to understand their data *fast*. No more `MemoryError` when trying to profile a CSV larger than your RAM.
|
|
62
|
+
|
|
63
|
+
**Pandas-Profiling vs DataProf on a 10GB CSV:**
|
|
64
|
+
| Feature | Pandas-Profiling / YData | DataProf |
|
|
65
|
+
|---------|--------------------------|----------|
|
|
66
|
+
| **Memory Usage** | 12GB+ (Crashes) | **< 100MB (Streaming)** |
|
|
67
|
+
| **Speed** | 15+ minutes | **45 seconds** |
|
|
68
|
+
| **Implementation** | Python (Slow) | **Rust (Fast)** |
|
|
69
|
+
|
|
70
|
+
## Quick Start
|
|
71
|
+
|
|
72
|
+
### Installation
|
|
73
|
+
|
|
74
|
+
The easiest way to get started is via pip:
|
|
75
|
+
|
|
76
|
+
```bash
|
|
77
|
+
pip install dataprof
|
|
78
|
+
```
|
|
79
|
+
|
|
80
|
+
### Python Usage
|
|
81
|
+
|
|
82
|
+
Forget complex configurations. Just point to your file:
|
|
83
|
+
|
|
84
|
+
```python
|
|
85
|
+
import dataprof
|
|
86
|
+
|
|
87
|
+
# Analyze a huge file without crashing memory
|
|
88
|
+
# Generates a report.html with quality metrics and distributions
|
|
89
|
+
dataprof.profile("huge_dataset.csv").save("report.html")
|
|
90
|
+
```
|
|
91
|
+
|
|
92
|
+
### CLI & Rust Usage (Advanced)
|
|
93
|
+
|
|
94
|
+
If you prefer the command line or are a Rust developer:
|
|
95
|
+
|
|
96
|
+
```bash
|
|
97
|
+
# Install via cargo
|
|
98
|
+
cargo install dataprof
|
|
99
|
+
|
|
100
|
+
# Generate report from CLI
|
|
101
|
+
dataprof-cli report huge_data.csv -o report.html
|
|
102
|
+
```
|
|
103
|
+
|
|
104
|
+
**More options:** `dataprof-cli --help` | [Full CLI Guide](docs/guides/CLI_USAGE_GUIDE.md)
|
|
105
|
+
|
|
106
|
+
## 💡 Key Features
|
|
107
|
+
|
|
108
|
+
- **No Size Limits**: Profiles files larger than RAM using streaming and memory mapping.
|
|
109
|
+
- **Blazing Fast**: Written in Rust with SIMD acceleration.
|
|
110
|
+
- **Privacy Guaranteed**: Data never leaves your machine.
|
|
111
|
+
- **Format Support**: CSV, Parquet, JSON/L, and Databases (Postgres, MySQL, etc.).
|
|
112
|
+
- **Smart Detection**: Automatically identifies Emails, IPs, IBANs, Credit Cards, and more.
|
|
113
|
+
|
|
114
|
+
## 📊 Beautiful Reports
|
|
115
|
+
|
|
116
|
+
<div align="center">
|
|
117
|
+
<p><strong>Interactive Demo</strong><br/>
|
|
118
|
+
<em>Animated walkthrough of dataprof features and dashboards</em></p>
|
|
119
|
+
<img src="assets/animations/dataprof_demo_minimal.gif" alt="DataProf Demo" width="100%" />
|
|
120
|
+
|
|
121
|
+
<br/><br/>
|
|
122
|
+
|
|
123
|
+
<p><strong>Single File Analysis</strong><br/>
|
|
124
|
+
<em>Interactive dashboards with quality scoring and distributions</em></p>
|
|
125
|
+
<img src="assets/images/dataprofhtml2026.png" alt="Single Report Dashboard" width="100%" />
|
|
126
|
+
|
|
127
|
+
<br/><br/>
|
|
128
|
+
|
|
129
|
+
<p><strong>Batch Processing Dashboard</strong><br/>
|
|
130
|
+
<em>Aggregate metrics from hundreds of files in one view</em></p>
|
|
131
|
+
<img src="assets/images/dataprofbatch2026.png" alt="Batch Dashboard" width="100%" />
|
|
132
|
+
</div>
|
|
133
|
+
|
|
134
|
+
## Documentation
|
|
135
|
+
|
|
136
|
+
- **[Python API Reference](docs/python/README.md)**
|
|
137
|
+
- **[CLI Guide](docs/guides/CLI_USAGE_GUIDE.md)**
|
|
138
|
+
|
|
139
|
+
### Advanced Examples
|
|
140
|
+
|
|
141
|
+
**Batch Processing (Python)**
|
|
142
|
+
```python
|
|
143
|
+
# Process a whole directory of files in parallel
|
|
144
|
+
result = dataprof.batch_analyze_directory("/data_folder", recursive=True)
|
|
145
|
+
print(f"Processed {result.processed_files} files at {result.files_per_second:.1f} files/sec")
|
|
146
|
+
```
|
|
147
|
+
|
|
148
|
+
**Database Integration (Python)**
|
|
149
|
+
```python
|
|
150
|
+
# Profile a SQL query directly
|
|
151
|
+
await dataprof.analyze_database_async(
|
|
152
|
+
"postgresql://user:pass@localhost/db",
|
|
153
|
+
"SELECT * FROM sales_data_2024"
|
|
154
|
+
)
|
|
155
|
+
```
|
|
156
|
+
|
|
157
|
+
**Rust Library Usage**
|
|
158
|
+
```rust
|
|
159
|
+
use dataprof::*;
|
|
160
|
+
|
|
161
|
+
let profiler = DataProfiler::auto();
|
|
162
|
+
let report = profiler.analyze_file("dataset.csv")?;
|
|
163
|
+
println!("Quality Score: {}", report.quality_score());
|
|
164
|
+
```
|
|
165
|
+
|
|
166
|
+
## Development
|
|
167
|
+
|
|
168
|
+
```bash
|
|
169
|
+
# Setup
|
|
170
|
+
git clone https://github.com/AndreaBozzo/dataprof.git
|
|
171
|
+
cd dataprof
|
|
172
|
+
cargo build --release
|
|
173
|
+
|
|
174
|
+
# Test databases (optional)
|
|
175
|
+
docker-compose -f .devcontainer/compose.yml up -d
|
|
176
|
+
|
|
177
|
+
# Common tasks
|
|
178
|
+
cargo test # Run tests
|
|
179
|
+
cargo bench # Benchmarks
|
|
180
|
+
cargo clippy # Linting
|
|
181
|
+
```
|
|
182
|
+
|
|
183
|
+
### Feature Flags
|
|
184
|
+
|
|
185
|
+
```bash
|
|
186
|
+
# Minimal (CSV/JSON only)
|
|
187
|
+
cargo build --release
|
|
188
|
+
|
|
189
|
+
# With Apache Arrow (large files >100MB)
|
|
190
|
+
cargo build --release --features arrow
|
|
191
|
+
|
|
192
|
+
# With Parquet support
|
|
193
|
+
cargo build --release --features parquet
|
|
194
|
+
|
|
195
|
+
# With databases
|
|
196
|
+
cargo build --release --features postgres,mysql,sqlite
|
|
197
|
+
|
|
198
|
+
# Python async support
|
|
199
|
+
maturin develop --features python-async,database,postgres
|
|
200
|
+
|
|
201
|
+
# All features
|
|
202
|
+
cargo build --release --all-features
|
|
203
|
+
```
|
|
204
|
+
|
|
205
|
+
**When to use Arrow:** Large files (>100MB), many columns (>20), uniform types
|
|
206
|
+
**When to use Parquet:** Analytics, data lakes, Spark/Pandas integration
|
|
207
|
+
|
|
208
|
+
|
|
209
|
+
## Documentation
|
|
210
|
+
|
|
211
|
+
**User Guides:**
|
|
212
|
+
[CLI Reference](docs/guides/CLI_USAGE_GUIDE.md)
|
|
213
|
+
[Database Connectors](docs/guides/database-connectors.md)
|
|
214
|
+
|
|
215
|
+
## 🤝 Contributing
|
|
216
|
+
|
|
217
|
+
We welcome contributions from everyone! Whether you want to:
|
|
218
|
+
- **Fix a bug** 🐛
|
|
219
|
+
- **Add a feature** ✨
|
|
220
|
+
- **Improve documentation** 📚
|
|
221
|
+
- **Report an issue** 📝
|
|
222
|
+
|
|
223
|
+
### Quick Start for Contributors
|
|
224
|
+
|
|
225
|
+
1. **Fork & clone:**
|
|
226
|
+
```bash
|
|
227
|
+
git clone https://github.com/YOUR-USERNAME/dataprof.git
|
|
228
|
+
cd dataprof
|
|
229
|
+
```
|
|
230
|
+
|
|
231
|
+
2. **Build & test:**
|
|
232
|
+
```bash
|
|
233
|
+
cargo build
|
|
234
|
+
cargo test
|
|
235
|
+
```
|
|
236
|
+
|
|
237
|
+
3. **Create a feature branch:**
|
|
238
|
+
```bash
|
|
239
|
+
git checkout -b feature/your-feature-name
|
|
240
|
+
```
|
|
241
|
+
|
|
242
|
+
4. **Before submitting PR:**
|
|
243
|
+
```bash
|
|
244
|
+
cargo fmt --all
|
|
245
|
+
cargo clippy --all --all-targets
|
|
246
|
+
cargo test --all
|
|
247
|
+
```
|
|
248
|
+
|
|
249
|
+
5. **Submit a Pull Request** with clear description
|
|
250
|
+
|
|
251
|
+
|
|
252
|
+
All contributions are welcome. Please read [CONTRIBUTING.md](CONTRIBUTING.md) for guidelines and our [Code of Conduct](CODE_OF_CONDUCT.md).
|
|
253
|
+
|
|
254
|
+
## License
|
|
255
|
+
|
|
256
|
+
Dual-licensed under either:
|
|
257
|
+
- [MIT License](LICENSE)
|
|
258
|
+
- [Apache License, Version 2.0](LICENSE-APACHE)
|
|
259
|
+
|
|
260
|
+
You may use this project under the terms of either license.
|
|
261
|
+
|
|
262
|
+
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
dataprof/__init__.py,sha256=eouGe3RqLcOXMXgnsAKuqPo_9VeSVWT6lKtuVYeY4Uk,17045
|
|
2
|
+
dataprof/__init__.pyi,sha256=ydqb_Jeq6n0zdwviWcI-t8puNX1Cs_WcHhGdxV14bjc,9146
|
|
3
|
+
dataprof/_dataprof.cpython-39-aarch64-linux-gnu.so,sha256=vrEwgB9jB8ZtSMx31vA4xZKZQ3dOtcqmjT6hwE2py9A,3209728
|
|
4
|
+
dataprof/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
5
|
+
dataprof-0.5.10.dist-info/METADATA,sha256=jnCNhUCOggR85P7EZaeKBoDrosloTe7fVIiii_MV1-E,8042
|
|
6
|
+
dataprof-0.5.10.dist-info/WHEEL,sha256=ZCVTgmyb6xH7HGGaqVcLpakgTQNNsX0NH11090T4Ty8,145
|
|
7
|
+
dataprof-0.5.10.dist-info/licenses/LICENSE,sha256=7_d4AXHNOaGNQl4OWJm8nivsxzFYIfMhdIH0SxVT0Ec,1069
|
|
8
|
+
dataprof-0.5.10.dist-info/licenses/LICENSE-APACHE,sha256=vfGpqOFXkOiiplmGz8pEsfw-k1mCoY3GptujJT7rOxE,10252
|
|
9
|
+
dataprof-0.5.10.dist-info/RECORD,,
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Andrea Bozzo
|
|
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,89 @@
|
|
|
1
|
+
Apache License
|
|
2
|
+
Version 2.0, January 2004
|
|
3
|
+
http://www.apache.org/licenses/
|
|
4
|
+
|
|
5
|
+
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
|
6
|
+
|
|
7
|
+
1. Definitions.
|
|
8
|
+
|
|
9
|
+
"License" shall mean the terms and conditions for use, reproduction, and distribution as defined by Sections 1 through 9 of this document.
|
|
10
|
+
|
|
11
|
+
"Licensor" shall mean the copyright owner or entity authorized by the copyright owner that is granting the License.
|
|
12
|
+
|
|
13
|
+
"Legal Entity" shall mean the union of the acting entity and all other entities that control, are controlled by, or are under common control with that entity. For the purposes of this definition, "control" means (i) the power, direct or indirect, to cause the direction or management of such entity, whether by contract or otherwise, or (ii) ownership of fifty percent (50%) or more of the outstanding shares, or (iii) beneficial ownership of such entity.
|
|
14
|
+
|
|
15
|
+
"You" (or "Your") shall mean an individual or Legal Entity exercising permissions granted by this License.
|
|
16
|
+
|
|
17
|
+
"Source" form shall mean the preferred form for making modifications, including but not limited to software source code, documentation source, and configuration files.
|
|
18
|
+
|
|
19
|
+
"Object" form shall mean any form resulting from mechanical transformation or translation of a Source form, including but not limited to compiled object code, generated documentation, and conversions to other media types.
|
|
20
|
+
|
|
21
|
+
"Work" shall mean the work of authorship, whether in Source or Object form, made available under the License, as indicated by a copyright notice that is included in or attached to the work (an example is provided in the Appendix below).
|
|
22
|
+
|
|
23
|
+
"Derivative Works" shall mean any work, whether in Source or Object form, that is based on (or derived from) the Work and for which the editorial revisions, annotations, elaborations, or other modifications represent, as a whole, an original work of authorship. For the purposes of this License, Derivative Works shall not include works that remain separable from, or merely link (or bind by name) to the interfaces of, the Work and Derivative Works thereof.
|
|
24
|
+
|
|
25
|
+
"Contribution" shall mean any work of authorship, including the original version of the Work and any modifications or additions to that Work or Derivative Works thereof, that is intentionally submitted to Licensor for inclusion in the Work by the copyright owner or by an individual or Legal Entity authorized to submit on behalf of the copyright owner. For the purposes of this definition, "submitted" means any form of electronic, verbal, or written communication sent to the Licensor or its representatives, including but not limited to communication on electronic mailing lists, source code control systems, and issue tracking systems that are managed by, or on behalf of, the Licensor for the purpose of discussing and improving the Work, but excluding communication that is conspicuously marked or otherwise designated in writing by the copyright owner as "Not a Contribution."
|
|
26
|
+
|
|
27
|
+
"Contributor" shall mean Licensor and any individual or Legal Entity on behalf of whom a Contribution has been received by Licensor and subsequently incorporated within the Work.
|
|
28
|
+
|
|
29
|
+
2. Grant of Copyright License.
|
|
30
|
+
|
|
31
|
+
Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable copyright license to reproduce, prepare Derivative Works of, publicly display, publicly perform, sublicense, and distribute the Work and such Derivative Works in Source or Object form.
|
|
32
|
+
|
|
33
|
+
3. Grant of Patent License.
|
|
34
|
+
|
|
35
|
+
Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable (except as stated in this section) patent license to make, have made, use, offer to sell, sell, import, and otherwise transfer the Work, where such license applies only to those patent claims licensable by such Contributor that are necessarily infringed by their Contribution(s) alone or by combination of their Contribution(s) with the Work to which such Contribution(s) was submitted. If You institute patent litigation against any entity (including a cross-claim or counterclaim in a lawsuit) alleging that the Work or a Contribution incorporated within the Work constitutes direct or contributory patent infringement, then any patent licenses granted to You under this License for that Work shall terminate as of the date such litigation is filed.
|
|
36
|
+
|
|
37
|
+
4. Redistribution.
|
|
38
|
+
|
|
39
|
+
You may reproduce and distribute copies of the Work or Derivative Works thereof in any medium, with or without modifications, and in Source or Object form, provided that You meet the following conditions:
|
|
40
|
+
|
|
41
|
+
(a) You must give any other recipients of the Work or Derivative Works a copy of this License; and
|
|
42
|
+
|
|
43
|
+
(b) You must cause any modified files to carry prominent notices stating that You changed the files; and
|
|
44
|
+
|
|
45
|
+
(c) You must retain, in the Source form of any Derivative Works that You distribute, all copyright, patent, trademark, and attribution notices from the Source form of the Work, excluding those notices that do not pertain to any part of the Derivative Works; and
|
|
46
|
+
|
|
47
|
+
(d) If the Work includes a "NOTICE" text file as part of its distribution, then any Derivative Works that You distribute must include a readable copy of the attribution notices contained within such NOTICE file, excluding those notices that do not pertain to any part of the Derivative Works, in at least one of the following places: within a NOTICE text file distributed as part of the Derivative Works; within the Source form or documentation, if provided along with the Derivative Works; or, within a display generated by the Derivative Works, if and wherever such third-party notices normally appear. The contents of the NOTICE file are for informational purposes only and do not modify the License. You may add Your own attribution notices within Derivative Works that You distribute, alongside or as an addendum to the NOTICE text from the Work, provided that such additional attribution notices cannot be construed as modifying the License.
|
|
48
|
+
|
|
49
|
+
You may add Your own copyright statement to Your modifications and may provide additional or different license terms and conditions for use, reproduction, or distribution of Your modifications, or for any such Derivative Works as a whole, provided Your use, reproduction, and distribution of the Work otherwise complies with the conditions stated in this License.
|
|
50
|
+
|
|
51
|
+
5. Submission of Contributions.
|
|
52
|
+
|
|
53
|
+
Unless You explicitly state otherwise, any Contribution intentionally submitted for inclusion in the Work by You to the Licensor shall be under the terms and conditions of this License, without any additional terms or conditions. Notwithstanding the above, nothing herein shall supersede or modify the terms of any separate license agreement you may have executed with Licensor regarding such Contributions.
|
|
54
|
+
|
|
55
|
+
6. Trademarks.
|
|
56
|
+
|
|
57
|
+
This License does not grant permission to use the trade names, trademarks, service marks, or product names of the Licensor, except as required for reasonable and customary use in describing the origin of the Work and reproducing the content of the NOTICE file.
|
|
58
|
+
|
|
59
|
+
7. Disclaimer of Warranty.
|
|
60
|
+
|
|
61
|
+
Unless required by applicable law or agreed to in writing, Licensor provides the Work (and each Contributor provides its Contributions) on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied, including, without limitation, any warranties or conditions of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE. You are solely responsible for determining the appropriateness of using or redistributing the Work and assume any risks associated with Your exercise of permissions under this License.
|
|
62
|
+
|
|
63
|
+
8. Limitation of Liability.
|
|
64
|
+
|
|
65
|
+
In no event and under no legal theory, whether in tort (including negligence), contract, or otherwise, unless required by applicable law (such as deliberate and grossly negligent acts) or agreed to in writing, shall any Contributor be liable to You for damages, including any direct, indirect, special, incidental, or consequential damages of any character arising as a result of this License or out of the use or inability to use the Work (including but not limited to damages for loss of goodwill, work stoppage, computer failure or malfunction, or any and all other commercial damages or losses), even if such Contributor has been advised of the possibility of such damages.
|
|
66
|
+
|
|
67
|
+
9. Accepting Warranty or Additional Liability.
|
|
68
|
+
|
|
69
|
+
While redistributing the Work or Derivative Works thereof, You may choose to offer, and charge a fee for, acceptance of support, warranty, indemnity, or other liability obligations and/or rights consistent with this License. However, in accepting such obligations, You may act only on Your own behalf and on Your sole responsibility, not on behalf of any other Contributor, and only if You agree to indemnify, defend, and hold each Contributor harmless for any liability incurred by, or claims asserted against, such Contributor by reason of your accepting any such warranty or additional liability.
|
|
70
|
+
|
|
71
|
+
END OF TERMS AND CONDITIONS
|
|
72
|
+
|
|
73
|
+
APPENDIX: How to apply the Apache License to your work.
|
|
74
|
+
|
|
75
|
+
To apply the Apache License to your work, attach the following boilerplate notice, with the fields enclosed by brackets "[]" replaced with your own identifying information. (Don't include the brackets!) The text should be enclosed in the appropriate comment syntax for the file format. We also recommend that a file or class name and description of purpose be included on the same "printed page" as the copyright notice for easier identification within third-party archives.
|
|
76
|
+
|
|
77
|
+
Copyright 2026 Andrea Bozzo
|
|
78
|
+
|
|
79
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
|
80
|
+
you may not use this file except in compliance with the License.
|
|
81
|
+
You may obtain a copy of the License at
|
|
82
|
+
|
|
83
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
|
84
|
+
|
|
85
|
+
Unless required by applicable law or agreed to in writing, software
|
|
86
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
|
87
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
88
|
+
See the License for the specific language governing permissions and
|
|
89
|
+
limitations under the License.
|