lawkit-python 2.4.1__tar.gz → 2.4.2__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.
- {lawkit_python-2.4.1 → lawkit_python-2.4.2}/Cargo.toml +1 -1
- {lawkit_python-2.4.1 → lawkit_python-2.4.2}/PKG-INFO +3 -3
- {lawkit_python-2.4.1/lawkit-python → lawkit_python-2.4.2}/README.md +2 -2
- {lawkit_python-2.4.1 → lawkit_python-2.4.2}/lawkit-core/README.md +56 -38
- {lawkit_python-2.4.1 → lawkit_python-2.4.2}/lawkit-core/src/common/output/formatter.rs +20 -8
- {lawkit_python-2.4.1 → lawkit_python-2.4.2}/lawkit-python/Cargo.lock +4 -4
- {lawkit_python-2.4.1 → lawkit_python-2.4.2}/lawkit-python/Cargo.toml +2 -2
- {lawkit_python-2.4.1 → lawkit_python-2.4.2/lawkit-python}/README.md +2 -2
- {lawkit_python-2.4.1 → lawkit_python-2.4.2}/lawkit-python/src/subcommands/benf.rs +4 -4
- {lawkit_python-2.4.1 → lawkit_python-2.4.2}/pyproject.toml +1 -1
- {lawkit_python-2.4.1 → lawkit_python-2.4.2}/lawkit-core/Cargo.toml +0 -0
- {lawkit_python-2.4.1 → lawkit_python-2.4.2}/lawkit-core/benches/law_benchmark.rs +0 -0
- {lawkit_python-2.4.1 → lawkit_python-2.4.2}/lawkit-core/src/common/filtering.rs +0 -0
- {lawkit_python-2.4.1 → lawkit_python-2.4.2}/lawkit-core/src/common/input/file_detector.rs +0 -0
- {lawkit_python-2.4.1 → lawkit_python-2.4.2}/lawkit-core/src/common/input/formats/csv.rs +0 -0
- {lawkit_python-2.4.1 → lawkit_python-2.4.2}/lawkit-core/src/common/input/formats/excel.rs +0 -0
- {lawkit_python-2.4.1 → lawkit_python-2.4.2}/lawkit-core/src/common/input/formats/html.rs +0 -0
- {lawkit_python-2.4.1 → lawkit_python-2.4.2}/lawkit-core/src/common/input/formats/json_xml.rs +0 -0
- {lawkit_python-2.4.1 → lawkit_python-2.4.2}/lawkit-core/src/common/input/formats/mod.rs +0 -0
- {lawkit_python-2.4.1 → lawkit_python-2.4.2}/lawkit-core/src/common/input/formats/opendocument.rs +0 -0
- {lawkit_python-2.4.1 → lawkit_python-2.4.2}/lawkit-core/src/common/input/formats/pdf.rs +0 -0
- {lawkit_python-2.4.1 → lawkit_python-2.4.2}/lawkit-core/src/common/input/formats/powerpoint.rs +0 -0
- {lawkit_python-2.4.1 → lawkit_python-2.4.2}/lawkit-core/src/common/input/formats/word.rs +0 -0
- {lawkit_python-2.4.1 → lawkit_python-2.4.2}/lawkit-core/src/common/input/mod.rs +0 -0
- {lawkit_python-2.4.1 → lawkit_python-2.4.2}/lawkit-core/src/common/input/parser.rs +0 -0
- {lawkit_python-2.4.1 → lawkit_python-2.4.2}/lawkit-core/src/common/international.rs +0 -0
- {lawkit_python-2.4.1 → lawkit_python-2.4.2}/lawkit-core/src/common/memory.rs +0 -0
- {lawkit_python-2.4.1 → lawkit_python-2.4.2}/lawkit-core/src/common/mod.rs +0 -0
- {lawkit_python-2.4.1 → lawkit_python-2.4.2}/lawkit-core/src/common/outliers.rs +0 -0
- {lawkit_python-2.4.1 → lawkit_python-2.4.2}/lawkit-core/src/common/output/mod.rs +0 -0
- {lawkit_python-2.4.1 → lawkit_python-2.4.2}/lawkit-core/src/common/parallel.rs +0 -0
- {lawkit_python-2.4.1 → lawkit_python-2.4.2}/lawkit-core/src/common/risk.rs +0 -0
- {lawkit_python-2.4.1 → lawkit_python-2.4.2}/lawkit-core/src/common/statistics.rs +0 -0
- {lawkit_python-2.4.1 → lawkit_python-2.4.2}/lawkit-core/src/common/streaming_io.rs +0 -0
- {lawkit_python-2.4.1 → lawkit_python-2.4.2}/lawkit-core/src/common/timeseries.rs +0 -0
- {lawkit_python-2.4.1 → lawkit_python-2.4.2}/lawkit-core/src/core/mod.rs +0 -0
- {lawkit_python-2.4.1 → lawkit_python-2.4.2}/lawkit-core/src/error.rs +0 -0
- {lawkit_python-2.4.1 → lawkit_python-2.4.2}/lawkit-core/src/generate/benford.rs +0 -0
- {lawkit_python-2.4.1 → lawkit_python-2.4.2}/lawkit-core/src/generate/mod.rs +0 -0
- {lawkit_python-2.4.1 → lawkit_python-2.4.2}/lawkit-core/src/generate/normal.rs +0 -0
- {lawkit_python-2.4.1 → lawkit_python-2.4.2}/lawkit-core/src/generate/pareto.rs +0 -0
- {lawkit_python-2.4.1 → lawkit_python-2.4.2}/lawkit-core/src/generate/poisson.rs +0 -0
- {lawkit_python-2.4.1 → lawkit_python-2.4.2}/lawkit-core/src/generate/zipf.rs +0 -0
- {lawkit_python-2.4.1 → lawkit_python-2.4.2}/lawkit-core/src/laws/benford/analysis.rs +0 -0
- {lawkit_python-2.4.1 → lawkit_python-2.4.2}/lawkit-core/src/laws/benford/japanese.rs +0 -0
- {lawkit_python-2.4.1 → lawkit_python-2.4.2}/lawkit-core/src/laws/benford/mod.rs +0 -0
- {lawkit_python-2.4.1 → lawkit_python-2.4.2}/lawkit-core/src/laws/benford/result.rs +0 -0
- {lawkit_python-2.4.1 → lawkit_python-2.4.2}/lawkit-core/src/laws/integration/analysis.rs +0 -0
- {lawkit_python-2.4.1 → lawkit_python-2.4.2}/lawkit-core/src/laws/integration/mod.rs +0 -0
- {lawkit_python-2.4.1 → lawkit_python-2.4.2}/lawkit-core/src/laws/integration/result.rs +0 -0
- {lawkit_python-2.4.1 → lawkit_python-2.4.2}/lawkit-core/src/laws/mod.rs +0 -0
- {lawkit_python-2.4.1 → lawkit_python-2.4.2}/lawkit-core/src/laws/normal/analysis.rs +0 -0
- {lawkit_python-2.4.1 → lawkit_python-2.4.2}/lawkit-core/src/laws/normal/mod.rs +0 -0
- {lawkit_python-2.4.1 → lawkit_python-2.4.2}/lawkit-core/src/laws/normal/result.rs +0 -0
- {lawkit_python-2.4.1 → lawkit_python-2.4.2}/lawkit-core/src/laws/pareto/analysis.rs +0 -0
- {lawkit_python-2.4.1 → lawkit_python-2.4.2}/lawkit-core/src/laws/pareto/mod.rs +0 -0
- {lawkit_python-2.4.1 → lawkit_python-2.4.2}/lawkit-core/src/laws/pareto/result.rs +0 -0
- {lawkit_python-2.4.1 → lawkit_python-2.4.2}/lawkit-core/src/laws/poisson/analysis.rs +0 -0
- {lawkit_python-2.4.1 → lawkit_python-2.4.2}/lawkit-core/src/laws/poisson/mod.rs +0 -0
- {lawkit_python-2.4.1 → lawkit_python-2.4.2}/lawkit-core/src/laws/poisson/result.rs +0 -0
- {lawkit_python-2.4.1 → lawkit_python-2.4.2}/lawkit-core/src/laws/zipf/analysis.rs +0 -0
- {lawkit_python-2.4.1 → lawkit_python-2.4.2}/lawkit-core/src/laws/zipf/mod.rs +0 -0
- {lawkit_python-2.4.1 → lawkit_python-2.4.2}/lawkit-core/src/laws/zipf/result.rs +0 -0
- {lawkit_python-2.4.1 → lawkit_python-2.4.2}/lawkit-core/src/lib.rs +0 -0
- {lawkit_python-2.4.1 → lawkit_python-2.4.2}/lawkit-python/PACKAGE_SUMMARY.md +0 -0
- {lawkit_python-2.4.1 → lawkit_python-2.4.2}/lawkit-python/STRUCTURE.md +0 -0
- {lawkit_python-2.4.1 → lawkit_python-2.4.2}/lawkit-python/src/analyze.rs +0 -0
- {lawkit_python-2.4.1 → lawkit_python-2.4.2}/lawkit-python/src/benf.rs +0 -0
- {lawkit_python-2.4.1 → lawkit_python-2.4.2}/lawkit-python/src/colors.rs +0 -0
- {lawkit_python-2.4.1 → lawkit_python-2.4.2}/lawkit-python/src/common_options.rs +0 -0
- {lawkit_python-2.4.1 → lawkit_python-2.4.2}/lawkit-python/src/diagnose.rs +0 -0
- {lawkit_python-2.4.1 → lawkit_python-2.4.2}/lawkit-python/src/lawkit/__init__.py +0 -0
- {lawkit_python-2.4.1 → lawkit_python-2.4.2}/lawkit-python/src/lawkit/__main__.py +0 -0
- {lawkit_python-2.4.1 → lawkit_python-2.4.2}/lawkit-python/src/lawkit/lawkit.py +0 -0
- {lawkit_python-2.4.1 → lawkit_python-2.4.2}/lawkit-python/src/lib.rs +0 -0
- {lawkit_python-2.4.1 → lawkit_python-2.4.2}/lawkit-python/src/main.rs +0 -0
- {lawkit_python-2.4.1 → lawkit_python-2.4.2}/lawkit-python/src/mod.rs +0 -0
- {lawkit_python-2.4.1 → lawkit_python-2.4.2}/lawkit-python/src/normal.rs +0 -0
- {lawkit_python-2.4.1 → lawkit_python-2.4.2}/lawkit-python/src/pareto.rs +0 -0
- {lawkit_python-2.4.1 → lawkit_python-2.4.2}/lawkit-python/src/poisson.rs +0 -0
- {lawkit_python-2.4.1 → lawkit_python-2.4.2}/lawkit-python/src/subcommands/analyze.rs +0 -0
- {lawkit_python-2.4.1 → lawkit_python-2.4.2}/lawkit-python/src/subcommands/diagnose.rs +0 -0
- {lawkit_python-2.4.1 → lawkit_python-2.4.2}/lawkit-python/src/subcommands/integration_common.rs +0 -0
- {lawkit_python-2.4.1 → lawkit_python-2.4.2}/lawkit-python/src/subcommands/mod.rs +0 -0
- {lawkit_python-2.4.1 → lawkit_python-2.4.2}/lawkit-python/src/subcommands/normal.rs +0 -0
- {lawkit_python-2.4.1 → lawkit_python-2.4.2}/lawkit-python/src/subcommands/pareto.rs +0 -0
- {lawkit_python-2.4.1 → lawkit_python-2.4.2}/lawkit-python/src/subcommands/poisson.rs +0 -0
- {lawkit_python-2.4.1 → lawkit_python-2.4.2}/lawkit-python/src/subcommands/validate.rs +0 -0
- {lawkit_python-2.4.1 → lawkit_python-2.4.2}/lawkit-python/src/subcommands/zipf.rs +0 -0
- {lawkit_python-2.4.1 → lawkit_python-2.4.2}/lawkit-python/src/validate.rs +0 -0
- {lawkit_python-2.4.1 → lawkit_python-2.4.2}/lawkit-python/src/zipf.rs +0 -0
- {lawkit_python-2.4.1 → lawkit_python-2.4.2}/lawkit-python/uv.lock +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: lawkit-python
|
|
3
|
-
Version: 2.4.
|
|
3
|
+
Version: 2.4.2
|
|
4
4
|
Classifier: Development Status :: 4 - Beta
|
|
5
5
|
Classifier: Intended Audience :: Developers
|
|
6
6
|
Classifier: Intended Audience :: Financial and Insurance Industry
|
|
@@ -47,7 +47,7 @@ Python wrapper for the `lawkit` CLI tool - Statistical law analysis toolkit for
|
|
|
47
47
|
pip install lawkit-python
|
|
48
48
|
```
|
|
49
49
|
|
|
50
|
-
This
|
|
50
|
+
This includes the `lawkit` binary embedded in the wheel - no download required.
|
|
51
51
|
|
|
52
52
|
## Quick Start
|
|
53
53
|
|
|
@@ -318,7 +318,7 @@ pareto_result = run_pareto_analysis("sales.csv", gini_coefficient=True)
|
|
|
318
318
|
pip install lawkit-python
|
|
319
319
|
```
|
|
320
320
|
|
|
321
|
-
The
|
|
321
|
+
The binary is pre-embedded in the wheel for your platform.
|
|
322
322
|
|
|
323
323
|
### Manual Binary Installation
|
|
324
324
|
|
|
@@ -8,7 +8,7 @@ Python wrapper for the `lawkit` CLI tool - Statistical law analysis toolkit for
|
|
|
8
8
|
pip install lawkit-python
|
|
9
9
|
```
|
|
10
10
|
|
|
11
|
-
This
|
|
11
|
+
This includes the `lawkit` binary embedded in the wheel - no download required.
|
|
12
12
|
|
|
13
13
|
## Quick Start
|
|
14
14
|
|
|
@@ -279,7 +279,7 @@ pareto_result = run_pareto_analysis("sales.csv", gini_coefficient=True)
|
|
|
279
279
|
pip install lawkit-python
|
|
280
280
|
```
|
|
281
281
|
|
|
282
|
-
The
|
|
282
|
+
The binary is pre-embedded in the wheel for your platform.
|
|
283
283
|
|
|
284
284
|
### Manual Binary Installation
|
|
285
285
|
|
|
@@ -29,15 +29,15 @@ Numbers analyzed: 2500
|
|
|
29
29
|
Risk Level: Low [LOW]
|
|
30
30
|
|
|
31
31
|
First Digit Distribution:
|
|
32
|
-
1:
|
|
33
|
-
2:
|
|
34
|
-
3:
|
|
35
|
-
4:
|
|
36
|
-
5:
|
|
37
|
-
6:
|
|
38
|
-
7:
|
|
39
|
-
8:
|
|
40
|
-
9:
|
|
32
|
+
1: ████████████████┃░░░░░░░░░░░░░░░░░░░░░░░░░░░ 35.2% (expected: 30.1%)
|
|
33
|
+
2: ██████┃█████████░░░░░░░░░░░░░░░░░░░░░░░░░░░░ 14.8% (expected: 17.6%)
|
|
34
|
+
3: █████░░░░┃░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░ 10.3% (expected: 12.5%)
|
|
35
|
+
4: ████████┃░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░ 12.1% (expected: 9.7%)
|
|
36
|
+
5: ██░┃░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░ 5.2% (expected: 7.9%)
|
|
37
|
+
6: ████████░┃░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░ 11.7% (expected: 6.7%)
|
|
38
|
+
7: ███░░┃░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░ 6.8% (expected: 5.8%)
|
|
39
|
+
8: █░┃░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░ 2.9% (expected: 5.1%)
|
|
40
|
+
9: █░░░┃░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░ 1.0% (expected: 4.6%)
|
|
41
41
|
|
|
42
42
|
Statistical Tests:
|
|
43
43
|
Chi-square: 1.34 (p-value: 0.995)
|
|
@@ -261,48 +261,66 @@ pip install lawkit-python # CLI binary automatically included
|
|
|
261
261
|
# Benford Law - Fraud detection with digit distribution chart
|
|
262
262
|
$ lawkit benf financial_data.csv
|
|
263
263
|
First Digit Distribution:
|
|
264
|
-
1:
|
|
265
|
-
2:
|
|
266
|
-
3:
|
|
267
|
-
4:
|
|
268
|
-
5:
|
|
269
|
-
6:
|
|
270
|
-
7:
|
|
271
|
-
8:
|
|
272
|
-
9:
|
|
264
|
+
1: ███████░░░░░░░░┃░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░ 13.6% (expected: 30.1%)
|
|
265
|
+
2: ███████░░┃░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░ 14.6% (expected: 17.6%)
|
|
266
|
+
3: ██████┃░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░ 14.6% (expected: 12.5%)
|
|
267
|
+
4: █████┃█░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░ 13.6% (expected: 9.7%)
|
|
268
|
+
5: ████┃█░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░ 12.6% (expected: 7.9%)
|
|
269
|
+
6: ███┃███░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░ 13.6% (expected: 6.7%)
|
|
270
|
+
7: ███┃░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░ 7.8% (expected: 5.8%)
|
|
271
|
+
8: ██░┃░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░ 4.9% (expected: 5.1%)
|
|
272
|
+
9: ██┃░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░ 4.9% (expected: 4.6%)
|
|
273
273
|
|
|
274
274
|
# Pareto Analysis - 80/20 Rule with Lorenz curve visualization
|
|
275
275
|
$ lawkit pareto sales_data.csv
|
|
276
276
|
Lorenz Curve (Cumulative Distribution):
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
27%:
|
|
280
|
-
|
|
281
|
-
|
|
277
|
+
8%: ██████████████████████████████░░░░░░░░░░░░░░░░░░░░ 59.7% cumulative
|
|
278
|
+
17%: ████████████████████████████████████████┃██░░░░░░░ 85.3% cumulative (80/20 point)
|
|
279
|
+
27%: ███████████████████████████████████████████████░░░ 94.8% cumulative
|
|
280
|
+
35%: █████████████████████████████████████████████████░ 98.2% cumulative
|
|
281
|
+
46%: ██████████████████████████████████████████████████ 99.3% cumulative
|
|
282
282
|
|
|
283
|
-
80/20 Rule: Top 20% owns
|
|
283
|
+
80/20 Rule: Top 20% owns 90.0% of total wealth (Ideal: 80.0%, Ratio: 1.13)
|
|
284
284
|
|
|
285
285
|
# Normal Distribution - Quality control with histogram
|
|
286
286
|
$ lawkit normal measurements.csv
|
|
287
287
|
Distribution Histogram:
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
Distribution: μ=
|
|
288
|
+
97.73- 98.26: █┃░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░ 2.7%
|
|
289
|
+
98.26- 98.79: ██████┃░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░ 11.5%
|
|
290
|
+
98.79- 99.32: █████████████████┃░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░ 34.0%
|
|
291
|
+
99.32- 99.85: ███████████████████████████████████┃░░░░░░░░░░░░░░ 69.8%
|
|
292
|
+
99.85-100.39: █████████████████████████████████████████████████┃ 100.0%
|
|
293
|
+
|
|
294
|
+
Distribution: μ=100.39, σ=0.89, Range: [97.73, 103.04]
|
|
295
|
+
1σ: 60.0%, 2σ: 98.0%, 3σ: 100.0%
|
|
296
|
+
|
|
297
|
+
# Zipf Law - Rank-frequency distribution with power law analysis
|
|
298
|
+
$ lawkit zipf word_frequencies.csv
|
|
299
|
+
Rank-Frequency Distribution:
|
|
300
|
+
# 1: █████████████████████████████████████████████████┃ 1.74% (expected: 1.74%)
|
|
301
|
+
# 2: █████████████████████████┃█████████░░░░░░░░░░░░░░░ 1.22% (expected: 0.87%)
|
|
302
|
+
# 3: █████████████████┃████████████░░░░░░░░░░░░░░░░░░░░ 1.04% (expected: 0.58%)
|
|
303
|
+
# 4: █████████████┃███████████░░░░░░░░░░░░░░░░░░░░░░░░░ 0.87% (expected: 0.43%)
|
|
304
|
+
# 5: ██████████┃██████████████░░░░░░░░░░░░░░░░░░░░░░░░░ 0.87% (expected: 0.35%)
|
|
305
|
+
# 6: ████████┃███████████░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░ 0.70% (expected: 0.29%)
|
|
306
|
+
# 7: ███████┃████████████░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░ 0.70% (expected: 0.25%)
|
|
307
|
+
# 8: ██████┃█████████████░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░ 0.70% (expected: 0.22%)
|
|
308
|
+
# 9: ██████┃█████████████░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░ 0.70% (expected: 0.19%)
|
|
309
|
+
#10: █████┃██████████████░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░ 0.70% (expected: 0.17%)
|
|
310
|
+
|
|
311
|
+
Zipf Exponent: 0.142 (ideal: 1.0), Correlation: 0.950
|
|
295
312
|
|
|
296
313
|
# Poisson Distribution - Rare events with probability chart
|
|
297
314
|
$ lawkit poisson event_counts.csv
|
|
298
315
|
Probability Distribution:
|
|
299
|
-
P(X= 0):
|
|
300
|
-
P(X= 1):
|
|
301
|
-
P(X= 2):
|
|
302
|
-
P(X= 3):
|
|
303
|
-
P(X= 4):
|
|
304
|
-
|
|
305
|
-
Key Probabilities: P(X=0)=0.
|
|
316
|
+
P(X= 0): ███████████████████┃░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░ 0.103
|
|
317
|
+
P(X= 1): ████████████████████████████████████████████┃░░░░░ 0.234
|
|
318
|
+
P(X= 2): █████████████████████████████████████████████████┃ 0.266
|
|
319
|
+
P(X= 3): ██████████████████████████████████████┃░░░░░░░░░░░ 0.201
|
|
320
|
+
P(X= 4): █████████████████████┃░░░░░░░░░░░░░░░░░░░░░░░░░░░░ 0.114
|
|
321
|
+
|
|
322
|
+
Key Probabilities: P(X=0)=0.103, P(X=1)=0.234, P(X≥2)=0.662
|
|
323
|
+
λ=2.27, Variance/Mean=0.774 (ideal: 1.0), Fit Score=0.682
|
|
306
324
|
```
|
|
307
325
|
|
|
308
326
|
### Three-Stage Analysis Workflow
|
|
@@ -111,19 +111,31 @@ fn format_text(result: &BenfordResult) -> String {
|
|
|
111
111
|
|
|
112
112
|
fn format_distribution_bars(result: &BenfordResult) -> String {
|
|
113
113
|
let mut output = String::new();
|
|
114
|
-
const
|
|
114
|
+
const CHART_WIDTH: usize = 50;
|
|
115
115
|
|
|
116
116
|
for i in 0..9 {
|
|
117
117
|
let digit = i + 1;
|
|
118
118
|
let observed = result.digit_distribution[i];
|
|
119
119
|
let expected = result.expected_distribution[i];
|
|
120
|
-
let bar_length = ((observed / 100.0) *
|
|
121
|
-
let bar_length = bar_length.min(
|
|
122
|
-
|
|
123
|
-
//
|
|
124
|
-
let
|
|
125
|
-
let
|
|
126
|
-
|
|
120
|
+
let bar_length = ((observed / 100.0) * CHART_WIDTH as f64).round() as usize;
|
|
121
|
+
let bar_length = bar_length.min(CHART_WIDTH); // Ensure we don't exceed max width
|
|
122
|
+
|
|
123
|
+
// Calculate expected value line position
|
|
124
|
+
let expected_line_pos = ((expected / 100.0) * CHART_WIDTH as f64).round() as usize;
|
|
125
|
+
let expected_line_pos = expected_line_pos.min(CHART_WIDTH - 1); // Ensure it's within bounds
|
|
126
|
+
|
|
127
|
+
// Create bar with filled portion, expected value line, and background
|
|
128
|
+
let mut bar_chars = Vec::new();
|
|
129
|
+
for pos in 0..CHART_WIDTH {
|
|
130
|
+
if pos == expected_line_pos {
|
|
131
|
+
bar_chars.push('┃'); // Expected value line (always visible)
|
|
132
|
+
} else if pos < bar_length {
|
|
133
|
+
bar_chars.push('█'); // Filled portion
|
|
134
|
+
} else {
|
|
135
|
+
bar_chars.push('░'); // Background portion
|
|
136
|
+
}
|
|
137
|
+
}
|
|
138
|
+
let full_bar: String = bar_chars.iter().collect();
|
|
127
139
|
|
|
128
140
|
output.push_str(&format!(
|
|
129
141
|
"{digit:1}: {full_bar} {observed:>5.1}% (expected: {expected:>5.1}%)\n"
|
|
@@ -345,9 +345,9 @@ dependencies = [
|
|
|
345
345
|
|
|
346
346
|
[[package]]
|
|
347
347
|
name = "crc32fast"
|
|
348
|
-
version = "1.
|
|
348
|
+
version = "1.5.0"
|
|
349
349
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
350
|
-
checksum = "
|
|
350
|
+
checksum = "9481c1c90cbf2ac953f07c8d4a58aa3945c425b7185c9154d67a65e4230da511"
|
|
351
351
|
dependencies = [
|
|
352
352
|
"cfg-if",
|
|
353
353
|
]
|
|
@@ -786,7 +786,7 @@ dependencies = [
|
|
|
786
786
|
|
|
787
787
|
[[package]]
|
|
788
788
|
name = "lawkit-core"
|
|
789
|
-
version = "2.4.
|
|
789
|
+
version = "2.4.2"
|
|
790
790
|
dependencies = [
|
|
791
791
|
"anyhow",
|
|
792
792
|
"calamine",
|
|
@@ -809,7 +809,7 @@ dependencies = [
|
|
|
809
809
|
|
|
810
810
|
[[package]]
|
|
811
811
|
name = "lawkit-python"
|
|
812
|
-
version = "2.4.
|
|
812
|
+
version = "2.4.2"
|
|
813
813
|
dependencies = [
|
|
814
814
|
"chrono",
|
|
815
815
|
"clap",
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
|
|
4
4
|
[package]
|
|
5
5
|
name = "lawkit-python"
|
|
6
|
-
version = "2.4.
|
|
6
|
+
version = "2.4.2"
|
|
7
7
|
edition = "2021"
|
|
8
8
|
authors = ["kako-jun"]
|
|
9
9
|
license = "MIT"
|
|
@@ -17,7 +17,7 @@ path = "src/main.rs"
|
|
|
17
17
|
|
|
18
18
|
[dependencies]
|
|
19
19
|
# Reference to the actual lawkit dependencies
|
|
20
|
-
lawkit-core = { version = "2.4.
|
|
20
|
+
lawkit-core = { version = "2.4.2", path = "../lawkit-core" }
|
|
21
21
|
clap = { version = "4.0", features = ["derive", "cargo"] }
|
|
22
22
|
serde_json = "1.0"
|
|
23
23
|
owo-colors = "4.1"
|
|
@@ -8,7 +8,7 @@ Python wrapper for the `lawkit` CLI tool - Statistical law analysis toolkit for
|
|
|
8
8
|
pip install lawkit-python
|
|
9
9
|
```
|
|
10
10
|
|
|
11
|
-
This
|
|
11
|
+
This includes the `lawkit` binary embedded in the wheel - no download required.
|
|
12
12
|
|
|
13
13
|
## Quick Start
|
|
14
14
|
|
|
@@ -279,7 +279,7 @@ pareto_result = run_pareto_analysis("sales.csv", gini_coefficient=True)
|
|
|
279
279
|
pip install lawkit-python
|
|
280
280
|
```
|
|
281
281
|
|
|
282
|
-
The
|
|
282
|
+
The binary is pre-embedded in the wheel for your platform.
|
|
283
283
|
|
|
284
284
|
### Manual Binary Installation
|
|
285
285
|
|
|
@@ -474,18 +474,18 @@ fn determine_risk_level(mad: f64, p_value: f64) -> RiskLevel {
|
|
|
474
474
|
|
|
475
475
|
fn format_distribution_bars(result: &BenfordResult) -> String {
|
|
476
476
|
let mut output = String::new();
|
|
477
|
-
const
|
|
477
|
+
const CHART_WIDTH: usize = 50;
|
|
478
478
|
|
|
479
479
|
for i in 0..9 {
|
|
480
480
|
let digit = i + 1;
|
|
481
481
|
let observed = result.digit_distribution[i];
|
|
482
482
|
let expected = result.expected_distribution[i];
|
|
483
|
-
let bar_length = ((observed / 100.0) *
|
|
484
|
-
let bar_length = bar_length.min(
|
|
483
|
+
let bar_length = ((observed / 100.0) * CHART_WIDTH as f64).round() as usize;
|
|
484
|
+
let bar_length = bar_length.min(CHART_WIDTH); // Ensure we don't exceed max width
|
|
485
485
|
|
|
486
486
|
// Create bar with filled and background portions
|
|
487
487
|
let filled_bar = "█".repeat(bar_length);
|
|
488
|
-
let background_bar = "░".repeat(
|
|
488
|
+
let background_bar = "░".repeat(CHART_WIDTH - bar_length);
|
|
489
489
|
let full_bar = format!("{filled_bar}{background_bar}");
|
|
490
490
|
|
|
491
491
|
output.push_str(&format!(
|
|
@@ -4,7 +4,7 @@ build-backend = "maturin"
|
|
|
4
4
|
|
|
5
5
|
[project]
|
|
6
6
|
name = "lawkit-python"
|
|
7
|
-
version = "2.4.
|
|
7
|
+
version = "2.4.2"
|
|
8
8
|
description = "Python wrapper for lawkit - Statistical law analysis toolkit for fraud detection and data quality assessment"
|
|
9
9
|
readme = "README.md"
|
|
10
10
|
license = "MIT"
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{lawkit_python-2.4.1 → lawkit_python-2.4.2}/lawkit-core/src/common/input/formats/json_xml.rs
RENAMED
|
File without changes
|
|
File without changes
|
{lawkit_python-2.4.1 → lawkit_python-2.4.2}/lawkit-core/src/common/input/formats/opendocument.rs
RENAMED
|
File without changes
|
|
File without changes
|
{lawkit_python-2.4.1 → lawkit_python-2.4.2}/lawkit-core/src/common/input/formats/powerpoint.rs
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{lawkit_python-2.4.1 → lawkit_python-2.4.2}/lawkit-python/src/subcommands/integration_common.rs
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|