lawkit-python 2.3.0__tar.gz → 2.4.1__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/Cargo.toml +52 -0
- {lawkit_python-2.3.0 → lawkit_python-2.4.1}/PKG-INFO +39 -21
- {lawkit_python-2.3.0 → lawkit_python-2.4.1}/README.md +18 -1
- lawkit_python-2.4.1/lawkit-core/Cargo.toml +44 -0
- lawkit_python-2.4.1/lawkit-core/README.md +490 -0
- lawkit_python-2.4.1/lawkit-core/benches/law_benchmark.rs +103 -0
- lawkit_python-2.4.1/lawkit-core/src/common/filtering.rs +353 -0
- lawkit_python-2.4.1/lawkit-core/src/common/input/file_detector.rs +256 -0
- lawkit_python-2.4.1/lawkit-core/src/common/input/formats/csv.rs +86 -0
- lawkit_python-2.4.1/lawkit-core/src/common/input/formats/excel.rs +208 -0
- lawkit_python-2.4.1/lawkit-core/src/common/input/formats/html.rs +134 -0
- lawkit_python-2.4.1/lawkit-core/src/common/input/formats/json_xml.rs +276 -0
- lawkit_python-2.4.1/lawkit-core/src/common/input/formats/mod.rs +18 -0
- lawkit_python-2.4.1/lawkit-core/src/common/input/formats/opendocument.rs +284 -0
- lawkit_python-2.4.1/lawkit-core/src/common/input/formats/pdf.rs +99 -0
- lawkit_python-2.4.1/lawkit-core/src/common/input/formats/powerpoint.rs +229 -0
- lawkit_python-2.4.1/lawkit-core/src/common/input/formats/word.rs +161 -0
- lawkit_python-2.4.1/lawkit-core/src/common/input/mod.rs +5 -0
- lawkit_python-2.4.1/lawkit-core/src/common/input/parser.rs +46 -0
- lawkit_python-2.4.1/lawkit-core/src/common/international.rs +214 -0
- lawkit_python-2.4.1/lawkit-core/src/common/memory.rs +1063 -0
- lawkit_python-2.4.1/lawkit-core/src/common/mod.rs +11 -0
- lawkit_python-2.4.1/lawkit-core/src/common/outliers.rs +456 -0
- lawkit_python-2.4.1/lawkit-core/src/common/output/formatter.rs +211 -0
- lawkit_python-2.4.1/lawkit-core/src/common/output/mod.rs +3 -0
- lawkit_python-2.4.1/lawkit-core/src/common/parallel.rs +487 -0
- lawkit_python-2.4.1/lawkit-core/src/common/risk.rs +41 -0
- lawkit_python-2.4.1/lawkit-core/src/common/statistics.rs +70 -0
- lawkit_python-2.4.1/lawkit-core/src/common/streaming_io.rs +185 -0
- lawkit_python-2.4.1/lawkit-core/src/common/timeseries.rs +837 -0
- lawkit_python-2.4.1/lawkit-core/src/core/mod.rs +121 -0
- lawkit_python-2.4.1/lawkit-core/src/error.rs +54 -0
- lawkit_python-2.4.1/lawkit-core/src/generate/benford.rs +118 -0
- lawkit_python-2.4.1/lawkit-core/src/generate/mod.rs +57 -0
- lawkit_python-2.4.1/lawkit-core/src/generate/normal.rs +78 -0
- lawkit_python-2.4.1/lawkit-core/src/generate/pareto.rs +118 -0
- lawkit_python-2.4.1/lawkit-core/src/generate/poisson.rs +88 -0
- lawkit_python-2.4.1/lawkit-core/src/generate/zipf.rs +116 -0
- lawkit_python-2.4.1/lawkit-core/src/laws/benford/analysis.rs +62 -0
- lawkit_python-2.4.1/lawkit-core/src/laws/benford/japanese.rs +431 -0
- lawkit_python-2.4.1/lawkit-core/src/laws/benford/mod.rs +6 -0
- lawkit_python-2.4.1/lawkit-core/src/laws/benford/result.rs +140 -0
- lawkit_python-2.4.1/lawkit-core/src/laws/integration/analysis.rs +822 -0
- lawkit_python-2.4.1/lawkit-core/src/laws/integration/mod.rs +5 -0
- lawkit_python-2.4.1/lawkit-core/src/laws/integration/result.rs +1106 -0
- lawkit_python-2.4.1/lawkit-core/src/laws/mod.rs +6 -0
- lawkit_python-2.4.1/lawkit-core/src/laws/normal/analysis.rs +365 -0
- lawkit_python-2.4.1/lawkit-core/src/laws/normal/mod.rs +9 -0
- lawkit_python-2.4.1/lawkit-core/src/laws/normal/result.rs +534 -0
- lawkit_python-2.4.1/lawkit-core/src/laws/pareto/analysis.rs +139 -0
- lawkit_python-2.4.1/lawkit-core/src/laws/pareto/mod.rs +5 -0
- lawkit_python-2.4.1/lawkit-core/src/laws/pareto/result.rs +130 -0
- lawkit_python-2.4.1/lawkit-core/src/laws/poisson/analysis.rs +473 -0
- lawkit_python-2.4.1/lawkit-core/src/laws/poisson/mod.rs +5 -0
- lawkit_python-2.4.1/lawkit-core/src/laws/poisson/result.rs +365 -0
- lawkit_python-2.4.1/lawkit-core/src/laws/zipf/analysis.rs +257 -0
- lawkit_python-2.4.1/lawkit-core/src/laws/zipf/mod.rs +8 -0
- lawkit_python-2.4.1/lawkit-core/src/laws/zipf/result.rs +319 -0
- lawkit_python-2.4.1/lawkit-core/src/lib.rs +15 -0
- lawkit_python-2.4.1/lawkit-python/Cargo.lock +2061 -0
- lawkit_python-2.4.1/lawkit-python/Cargo.toml +25 -0
- lawkit_python-2.4.1/lawkit-python/PACKAGE_SUMMARY.md +229 -0
- lawkit_python-2.4.1/lawkit-python/README.md +435 -0
- lawkit_python-2.4.1/lawkit-python/STRUCTURE.md +228 -0
- lawkit_python-2.4.1/lawkit-python/src/analyze.rs +47 -0
- lawkit_python-2.4.1/lawkit-python/src/benf.rs +66 -0
- lawkit_python-2.4.1/lawkit-python/src/colors.rs +110 -0
- lawkit_python-2.4.1/lawkit-python/src/common_options.rs +460 -0
- lawkit_python-2.4.1/lawkit-python/src/diagnose.rs +419 -0
- {lawkit_python-2.3.0 → lawkit_python-2.4.1/lawkit-python}/src/lawkit/__init__.py +12 -1
- lawkit_python-2.4.1/lawkit-python/src/lawkit/__main__.py +26 -0
- {lawkit_python-2.3.0 → lawkit_python-2.4.1/lawkit-python}/src/lawkit/lawkit.py +158 -98
- lawkit_python-2.4.1/lawkit-python/src/lib.rs +9 -0
- lawkit_python-2.4.1/lawkit-python/src/main.rs +399 -0
- lawkit_python-2.4.1/lawkit-python/src/mod.rs +9 -0
- lawkit_python-2.4.1/lawkit-python/src/normal.rs +947 -0
- lawkit_python-2.4.1/lawkit-python/src/pareto.rs +66 -0
- lawkit_python-2.4.1/lawkit-python/src/poisson.rs +764 -0
- lawkit_python-2.4.1/lawkit-python/src/subcommands/analyze.rs +47 -0
- lawkit_python-2.4.1/lawkit-python/src/subcommands/benf.rs +497 -0
- lawkit_python-2.4.1/lawkit-python/src/subcommands/diagnose.rs +419 -0
- lawkit_python-2.4.1/lawkit-python/src/subcommands/integration_common.rs +575 -0
- lawkit_python-2.4.1/lawkit-python/src/subcommands/mod.rs +9 -0
- lawkit_python-2.4.1/lawkit-python/src/subcommands/normal.rs +947 -0
- lawkit_python-2.4.1/lawkit-python/src/subcommands/pareto.rs +472 -0
- lawkit_python-2.4.1/lawkit-python/src/subcommands/poisson.rs +764 -0
- lawkit_python-2.4.1/lawkit-python/src/subcommands/validate.rs +121 -0
- lawkit_python-2.4.1/lawkit-python/src/subcommands/zipf.rs +490 -0
- lawkit_python-2.4.1/lawkit-python/src/validate.rs +121 -0
- lawkit_python-2.4.1/lawkit-python/src/zipf.rs +490 -0
- lawkit_python-2.4.1/lawkit-python/uv.lock +760 -0
- {lawkit_python-2.3.0 → lawkit_python-2.4.1}/pyproject.toml +14 -17
- lawkit_python-2.3.0/.gitignore +0 -122
- lawkit_python-2.3.0/src/lawkit/installer.py +0 -130
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
[workspace]
|
|
2
|
+
resolver = "2"
|
|
3
|
+
members = [
|
|
4
|
+
"lawkit-core",
|
|
5
|
+
"lawkit-cli"
|
|
6
|
+
]
|
|
7
|
+
|
|
8
|
+
[workspace.package]
|
|
9
|
+
version = "2.4.1"
|
|
10
|
+
edition = "2021"
|
|
11
|
+
authors = ["kako-jun"]
|
|
12
|
+
license = "MIT"
|
|
13
|
+
description = "Statistical law analysis toolkit with international number support"
|
|
14
|
+
homepage = "https://github.com/kako-jun/lawkit"
|
|
15
|
+
repository = "https://github.com/kako-jun/lawkit"
|
|
16
|
+
documentation = "https://docs.rs/lawkit-core"
|
|
17
|
+
readme = "README.md"
|
|
18
|
+
keywords = ["statistics", "benford", "pareto", "zipf", "audit"]
|
|
19
|
+
categories = ["command-line-utilities", "mathematics", "algorithms", "science"]
|
|
20
|
+
exclude = [
|
|
21
|
+
"test_manual/",
|
|
22
|
+
"test_threshold.csv",
|
|
23
|
+
".github/",
|
|
24
|
+
"international_numerals_research.md"
|
|
25
|
+
]
|
|
26
|
+
rust-version = "1.75"
|
|
27
|
+
|
|
28
|
+
[workspace.dependencies]
|
|
29
|
+
clap = { version = "4.0", features = ["derive", "cargo"] }
|
|
30
|
+
scraper = "0.17"
|
|
31
|
+
calamine = "0.22"
|
|
32
|
+
pdf-extract = "0.7"
|
|
33
|
+
docx-rs = "0.4"
|
|
34
|
+
zip = "0.6"
|
|
35
|
+
serde = { version = "1.0", features = ["derive"] }
|
|
36
|
+
serde_json = "1.0"
|
|
37
|
+
serde_yaml = "0.9"
|
|
38
|
+
toml = "0.8"
|
|
39
|
+
regex = "1.0"
|
|
40
|
+
thiserror = "1.0"
|
|
41
|
+
anyhow = "1.0"
|
|
42
|
+
rayon = "1.0"
|
|
43
|
+
tempfile = "3.0"
|
|
44
|
+
mockito = "1.0"
|
|
45
|
+
pretty_assertions = "1.0"
|
|
46
|
+
criterion = { version = "0.5", features = ["html_reports"] }
|
|
47
|
+
|
|
48
|
+
|
|
49
|
+
[profile.release]
|
|
50
|
+
lto = true
|
|
51
|
+
codegen-units = 1
|
|
52
|
+
panic = "abort"
|
|
@@ -1,14 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: lawkit-python
|
|
3
|
-
Version: 2.
|
|
4
|
-
Summary: Python wrapper for lawkit - Statistical law analysis toolkit for fraud detection and data quality assessment
|
|
5
|
-
Project-URL: Homepage, https://github.com/kako-jun/lawkit
|
|
6
|
-
Project-URL: Repository, https://github.com/kako-jun/lawkit
|
|
7
|
-
Project-URL: Issues, https://github.com/kako-jun/lawkit/issues
|
|
8
|
-
Project-URL: Documentation, https://github.com/kako-jun/lawkit/tree/main/docs
|
|
9
|
-
Author: kako-jun
|
|
10
|
-
License-Expression: MIT
|
|
11
|
-
Keywords: anomaly-detection,audit,benford,compliance,data-quality,forensic-accounting,fraud-detection,normal,outlier-detection,pareto,poisson,statistical-analysis,statistics,zipf
|
|
3
|
+
Version: 2.4.1
|
|
12
4
|
Classifier: Development Status :: 4 - Beta
|
|
13
5
|
Classifier: Intended Audience :: Developers
|
|
14
6
|
Classifier: Intended Audience :: Financial and Insurance Industry
|
|
@@ -21,20 +13,29 @@ Classifier: Programming Language :: Python :: 3.10
|
|
|
21
13
|
Classifier: Programming Language :: Python :: 3.11
|
|
22
14
|
Classifier: Programming Language :: Python :: 3.12
|
|
23
15
|
Classifier: Programming Language :: Python :: 3.13
|
|
24
|
-
Classifier: Topic :: Office/Business :: Financial
|
|
25
16
|
Classifier: Topic :: Scientific/Engineering :: Mathematics
|
|
26
|
-
Classifier: Topic ::
|
|
17
|
+
Classifier: Topic :: Office/Business :: Financial
|
|
27
18
|
Classifier: Topic :: Software Development :: Libraries :: Python Modules
|
|
19
|
+
Classifier: Topic :: Security
|
|
28
20
|
Classifier: Topic :: Utilities
|
|
29
|
-
Requires-
|
|
21
|
+
Requires-Dist: maturin>=1.9.1
|
|
22
|
+
Requires-Dist: pytest>=6.0 ; extra == 'dev'
|
|
23
|
+
Requires-Dist: pytest-cov ; extra == 'dev'
|
|
24
|
+
Requires-Dist: black ; extra == 'dev'
|
|
25
|
+
Requires-Dist: isort ; extra == 'dev'
|
|
26
|
+
Requires-Dist: mypy ; extra == 'dev'
|
|
27
|
+
Requires-Dist: ruff ; extra == 'dev'
|
|
30
28
|
Provides-Extra: dev
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
Requires-
|
|
36
|
-
|
|
37
|
-
|
|
29
|
+
Summary: Python wrapper for lawkit - Statistical law analysis toolkit for fraud detection and data quality assessment
|
|
30
|
+
Keywords: statistics,benford,pareto,zipf,normal,poisson,fraud-detection,audit,compliance,data-quality,forensic-accounting,statistical-analysis,outlier-detection,anomaly-detection
|
|
31
|
+
Author: kako-jun
|
|
32
|
+
License: MIT
|
|
33
|
+
Requires-Python: >=3.8
|
|
34
|
+
Description-Content-Type: text/markdown; charset=UTF-8; variant=GFM
|
|
35
|
+
Project-URL: Homepage, https://github.com/kako-jun/lawkit
|
|
36
|
+
Project-URL: Repository, https://github.com/kako-jun/lawkit
|
|
37
|
+
Project-URL: Issues, https://github.com/kako-jun/lawkit/issues
|
|
38
|
+
Project-URL: Documentation, https://github.com/kako-jun/lawkit/tree/main/docs
|
|
38
39
|
|
|
39
40
|
# lawkit-python
|
|
40
41
|
|
|
@@ -102,6 +103,24 @@ print(f"80/20 concentration: {pareto_result.concentration_80_20}")
|
|
|
102
103
|
|
|
103
104
|
## Usage Examples
|
|
104
105
|
|
|
106
|
+
### Command Line Interface (CLI) via Python Module
|
|
107
|
+
|
|
108
|
+
```bash
|
|
109
|
+
# Install and use immediately - binary included automatically
|
|
110
|
+
pip install lawkit-python
|
|
111
|
+
|
|
112
|
+
# Use lawkit CLI directly through Python module
|
|
113
|
+
python -m lawkit benf financial_data.csv
|
|
114
|
+
python -m lawkit pareto sales_data.csv --gini-coefficient
|
|
115
|
+
python -m lawkit analyze --laws all dataset.csv
|
|
116
|
+
python -m lawkit validate dataset.csv --consistency-check
|
|
117
|
+
python -m lawkit diagnose dataset.csv --report detailed
|
|
118
|
+
|
|
119
|
+
# Generate sample data for testing
|
|
120
|
+
python -m lawkit generate benf --samples 1000 --output-file test_data.csv
|
|
121
|
+
python -m lawkit generate pareto --samples 500 --concentration 0.8
|
|
122
|
+
```
|
|
123
|
+
|
|
105
124
|
### Modern API (Recommended)
|
|
106
125
|
|
|
107
126
|
```python
|
|
@@ -414,7 +433,6 @@ print(f"Power law exponent: {result.exponent:.3f}")
|
|
|
414
433
|
- `analyze_laws(input_data, options)` - Multi-law analysis
|
|
415
434
|
- `validate_laws(input_data, options)` - Data validation and consistency check
|
|
416
435
|
- `diagnose_laws(input_data, options)` - Conflict diagnosis and detailed reporting
|
|
417
|
-
- `compare_laws(input_data, options)` - Alias for analyze_laws (backward compatibility)
|
|
418
436
|
- `generate_data(law_type, samples, **kwargs)` - Generate sample data
|
|
419
437
|
- `analyze_string(content, law_type, options)` - Analyze string data directly
|
|
420
438
|
|
|
@@ -453,4 +471,4 @@ This project is licensed under the MIT License.
|
|
|
453
471
|
|
|
454
472
|
## Contributing
|
|
455
473
|
|
|
456
|
-
Contributions are welcome! Please read the [Contributing Guide](https://github.com/kako-jun/lawkit/blob/main/CONTRIBUTING.md) for details.
|
|
474
|
+
Contributions are welcome! Please read the [Contributing Guide](https://github.com/kako-jun/lawkit/blob/main/CONTRIBUTING.md) for details.
|
|
@@ -64,6 +64,24 @@ print(f"80/20 concentration: {pareto_result.concentration_80_20}")
|
|
|
64
64
|
|
|
65
65
|
## Usage Examples
|
|
66
66
|
|
|
67
|
+
### Command Line Interface (CLI) via Python Module
|
|
68
|
+
|
|
69
|
+
```bash
|
|
70
|
+
# Install and use immediately - binary included automatically
|
|
71
|
+
pip install lawkit-python
|
|
72
|
+
|
|
73
|
+
# Use lawkit CLI directly through Python module
|
|
74
|
+
python -m lawkit benf financial_data.csv
|
|
75
|
+
python -m lawkit pareto sales_data.csv --gini-coefficient
|
|
76
|
+
python -m lawkit analyze --laws all dataset.csv
|
|
77
|
+
python -m lawkit validate dataset.csv --consistency-check
|
|
78
|
+
python -m lawkit diagnose dataset.csv --report detailed
|
|
79
|
+
|
|
80
|
+
# Generate sample data for testing
|
|
81
|
+
python -m lawkit generate benf --samples 1000 --output-file test_data.csv
|
|
82
|
+
python -m lawkit generate pareto --samples 500 --concentration 0.8
|
|
83
|
+
```
|
|
84
|
+
|
|
67
85
|
### Modern API (Recommended)
|
|
68
86
|
|
|
69
87
|
```python
|
|
@@ -376,7 +394,6 @@ print(f"Power law exponent: {result.exponent:.3f}")
|
|
|
376
394
|
- `analyze_laws(input_data, options)` - Multi-law analysis
|
|
377
395
|
- `validate_laws(input_data, options)` - Data validation and consistency check
|
|
378
396
|
- `diagnose_laws(input_data, options)` - Conflict diagnosis and detailed reporting
|
|
379
|
-
- `compare_laws(input_data, options)` - Alias for analyze_laws (backward compatibility)
|
|
380
397
|
- `generate_data(law_type, samples, **kwargs)` - Generate sample data
|
|
381
398
|
- `analyze_string(content, law_type, options)` - Analyze string data directly
|
|
382
399
|
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
[package]
|
|
2
|
+
name = "lawkit-core"
|
|
3
|
+
version.workspace = true
|
|
4
|
+
edition.workspace = true
|
|
5
|
+
authors.workspace = true
|
|
6
|
+
license.workspace = true
|
|
7
|
+
description = "Core library for statistical law analysis with international number support"
|
|
8
|
+
homepage.workspace = true
|
|
9
|
+
repository.workspace = true
|
|
10
|
+
documentation.workspace = true
|
|
11
|
+
readme = "README.md"
|
|
12
|
+
keywords.workspace = true
|
|
13
|
+
categories = ["mathematics", "algorithms", "science"]
|
|
14
|
+
exclude.workspace = true
|
|
15
|
+
rust-version.workspace = true
|
|
16
|
+
|
|
17
|
+
[dependencies]
|
|
18
|
+
clap = { workspace = true }
|
|
19
|
+
scraper = { workspace = true }
|
|
20
|
+
calamine = { workspace = true }
|
|
21
|
+
pdf-extract = { workspace = true }
|
|
22
|
+
docx-rs = { workspace = true }
|
|
23
|
+
zip = { workspace = true }
|
|
24
|
+
serde = { workspace = true }
|
|
25
|
+
serde_json = { workspace = true }
|
|
26
|
+
serde_yaml = { workspace = true }
|
|
27
|
+
toml = { workspace = true }
|
|
28
|
+
regex = { workspace = true }
|
|
29
|
+
thiserror = { workspace = true }
|
|
30
|
+
anyhow = { workspace = true }
|
|
31
|
+
rayon = { workspace = true }
|
|
32
|
+
rand = "0.8.5"
|
|
33
|
+
rand_distr = "0.4.3"
|
|
34
|
+
diffx-core = "0.3.0"
|
|
35
|
+
|
|
36
|
+
[dev-dependencies]
|
|
37
|
+
tempfile = { workspace = true }
|
|
38
|
+
mockito = { workspace = true }
|
|
39
|
+
pretty_assertions = { workspace = true }
|
|
40
|
+
criterion = { version = "0.5", features = ["html_reports"] }
|
|
41
|
+
|
|
42
|
+
[[bench]]
|
|
43
|
+
name = "law_benchmark"
|
|
44
|
+
harness = false
|