rusto 0.3.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.
rusto-0.3.2/PKG-INFO ADDED
@@ -0,0 +1,41 @@
1
+ Metadata-Version: 2.4
2
+ Name: rusto
3
+ Version: 0.3.2
4
+ Summary: Pure Rust OCR library for Python based on RapidOCR and PaddleOCR
5
+ Author-email: RustO Contributors <contact@rusto.dev>
6
+ License-Expression: MIT
7
+ Requires-Python: >=3.8
8
+ Description-Content-Type: text/markdown
9
+ Provides-Extra: test
10
+ Requires-Dist: pytest>=7.0; extra == "test"
11
+
12
+ # RustO for Python
13
+
14
+ [![PyPI](https://img.shields.io/pypi/v/rusto.svg?logo=pypi&logoColor=white&color=blue)](https://pypi.org/project/rusto/)
15
+ [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
16
+
17
+ Pure Rust OCR library for Python based on RapidOCR and PaddleOCR architectures.
18
+
19
+ ## Installation
20
+
21
+ ```bash
22
+ pip install rusto
23
+ ```
24
+
25
+ ## Quick Start
26
+
27
+ ```python
28
+ from rusto import RustO, InitializeConfig
29
+
30
+ # Initialize engine with preset or model paths
31
+ engine = RustO.initialize(InitializeConfig(template="ppv6"))
32
+
33
+ # Run OCR detection
34
+ result = engine.detect_text(path="document.png")
35
+ for line in result.results:
36
+ print(f"{line.text} (score: {line.score:.2f})")
37
+ ```
38
+
39
+ ## License
40
+
41
+ MIT
rusto-0.3.2/README.md ADDED
@@ -0,0 +1,30 @@
1
+ # RustO for Python
2
+
3
+ [![PyPI](https://img.shields.io/pypi/v/rusto.svg?logo=pypi&logoColor=white&color=blue)](https://pypi.org/project/rusto/)
4
+ [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
5
+
6
+ Pure Rust OCR library for Python based on RapidOCR and PaddleOCR architectures.
7
+
8
+ ## Installation
9
+
10
+ ```bash
11
+ pip install rusto
12
+ ```
13
+
14
+ ## Quick Start
15
+
16
+ ```python
17
+ from rusto import RustO, InitializeConfig
18
+
19
+ # Initialize engine with preset or model paths
20
+ engine = RustO.initialize(InitializeConfig(template="ppv6"))
21
+
22
+ # Run OCR detection
23
+ result = engine.detect_text(path="document.png")
24
+ for line in result.results:
25
+ print(f"{line.text} (score: {line.score:.2f})")
26
+ ```
27
+
28
+ ## License
29
+
30
+ MIT
@@ -0,0 +1,23 @@
1
+ [build-system]
2
+ requires = ["setuptools>=61.0", "wheel"]
3
+ build-backend = "setuptools.build_meta"
4
+
5
+ [project]
6
+ name = "rusto"
7
+ version = "0.3.2"
8
+ description = "Pure Rust OCR library for Python based on RapidOCR and PaddleOCR"
9
+ readme = "README.md"
10
+ authors = [{ name = "RustO Contributors", email = "contact@rusto.dev" }]
11
+ license = "MIT"
12
+ requires-python = ">=3.8"
13
+ dependencies = []
14
+
15
+ [project.optional-dependencies]
16
+ test = ["pytest>=7.0"]
17
+
18
+ [tool.setuptools.packages.find]
19
+ where = ["."]
20
+ include = ["rusto*"]
21
+
22
+ [tool.setuptools.package-data]
23
+ "*" = ["*.so", "*.dylib", "*.dll"]
@@ -0,0 +1,58 @@
1
+ """RustO - High performance OCR engine powered by Rust."""
2
+
3
+ from __future__ import annotations
4
+ import os
5
+ import sys
6
+
7
+ # Ensure host library directory is in search path
8
+ _current_dir = os.path.dirname(os.path.abspath(__file__))
9
+ _repo_target_debug = os.path.abspath(os.path.join(_current_dir, "../../../target/debug"))
10
+ _repo_target_release = os.path.abspath(os.path.join(_current_dir, "../../../target/release"))
11
+
12
+ for _candidate in [_current_dir, _repo_target_debug, _repo_target_release]:
13
+ if os.path.isdir(_candidate) and _candidate not in sys.path:
14
+ sys.path.insert(0, _candidate)
15
+
16
+ from .generated.rusto import (
17
+ RustO,
18
+ RustOProtocol,
19
+ InitializeConfig,
20
+ DetectionConfig,
21
+ RecognitionConfig,
22
+ ClassificationConfig,
23
+ OrientationConfig,
24
+ UnwarpConfig,
25
+ CalibrationOptions,
26
+ OcrRunOptions,
27
+ DetectionRunOptions,
28
+ PostprocessRunOptions,
29
+ Frame,
30
+ RustoBindingError,
31
+ ImageSource,
32
+ OutputGranularity,
33
+ TextResult,
34
+ DetectTextResult,
35
+ OptimizationOptions,
36
+ )
37
+
38
+ __all__ = [
39
+ "RustO",
40
+ "RustOProtocol",
41
+ "InitializeConfig",
42
+ "DetectionConfig",
43
+ "RecognitionConfig",
44
+ "ClassificationConfig",
45
+ "OrientationConfig",
46
+ "UnwarpConfig",
47
+ "CalibrationOptions",
48
+ "OptimizationOptions",
49
+ "OcrRunOptions",
50
+ "DetectionRunOptions",
51
+ "PostprocessRunOptions",
52
+ "Frame",
53
+ "RustoBindingError",
54
+ "ImageSource",
55
+ "OutputGranularity",
56
+ "TextResult",
57
+ "DetectTextResult",
58
+ ]
Binary file