openconvert 1.0.0__py3-none-any.whl → 1.1.0__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- openconvert/__init__.py +53 -65
- openconvert/__main__.py +1 -1
- openconvert/openconvert_cli.py +1 -4
- {openconvert-1.0.0.dist-info → openconvert-1.1.0.dist-info}/METADATA +2 -2
- openconvert-1.1.0.dist-info/RECORD +10 -0
- openconvert-1.0.0.dist-info/RECORD +0 -10
- {openconvert-1.0.0.dist-info → openconvert-1.1.0.dist-info}/WHEEL +0 -0
- {openconvert-1.0.0.dist-info → openconvert-1.1.0.dist-info}/entry_points.txt +0 -0
- {openconvert-1.0.0.dist-info → openconvert-1.1.0.dist-info}/licenses/LICENSE +0 -0
- {openconvert-1.0.0.dist-info → openconvert-1.1.0.dist-info}/top_level.txt +0 -0
openconvert/__init__.py
CHANGED
@@ -9,13 +9,13 @@ import asyncio
|
|
9
9
|
from pathlib import Path
|
10
10
|
from typing import Optional, List
|
11
11
|
|
12
|
-
__version__ = "1.
|
12
|
+
__version__ = "1.1.0"
|
13
13
|
__author__ = "OpenAgents Team"
|
14
14
|
__email__ = "team@openagents.com"
|
15
15
|
|
16
16
|
# Import the async convert function
|
17
17
|
try:
|
18
|
-
from .openconvert_cli import convert as _async_convert
|
18
|
+
from openconvert.openconvert_cli import convert as _async_convert
|
19
19
|
except ImportError:
|
20
20
|
from openconvert_cli import convert as _async_convert
|
21
21
|
|
@@ -23,90 +23,78 @@ except ImportError:
|
|
23
23
|
def convert(
|
24
24
|
input_files: List[Path],
|
25
25
|
output_path: Path,
|
26
|
-
from_format: Optional[str] = None,
|
27
|
-
to_format: Optional[str] = None,
|
28
|
-
prompt: Optional[str] = None,
|
29
26
|
host: str = "network.openconvert.ai",
|
30
|
-
port: int = 8765
|
27
|
+
port: int = 8765,
|
31
28
|
) -> bool:
|
32
|
-
"""
|
33
|
-
|
34
|
-
This is a synchronous wrapper around the async convert function.
|
29
|
+
"""
|
30
|
+
Convert files using the OpenConvert network.
|
35
31
|
|
36
32
|
Args:
|
37
|
-
input_files: List of input file paths
|
38
|
-
output_path: Output file
|
39
|
-
|
40
|
-
|
41
|
-
prompt: Optional conversion prompt
|
42
|
-
host: Network host to connect to
|
43
|
-
port: Network port to connect to
|
33
|
+
input_files: List of input file paths to convert
|
34
|
+
output_path: Output file path
|
35
|
+
host: OpenConvert network host (default: network.openconvert.ai)
|
36
|
+
port: OpenConvert network port (default: 8765)
|
44
37
|
|
45
38
|
Returns:
|
46
|
-
bool: True if conversion
|
47
|
-
|
48
|
-
Example:
|
49
|
-
>>> from openconvert import convert
|
50
|
-
>>> from pathlib import Path
|
51
|
-
>>> success = convert(
|
52
|
-
... input_files=[Path("document.txt")],
|
53
|
-
... output_path=Path("document.pdf")
|
54
|
-
... )
|
39
|
+
bool: True if conversion successful, False otherwise
|
55
40
|
"""
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
41
|
+
try:
|
42
|
+
result = asyncio.run(_async_convert(
|
43
|
+
input_files=input_files,
|
44
|
+
output_path=output_path,
|
45
|
+
host=host,
|
46
|
+
port=port
|
47
|
+
))
|
48
|
+
return result
|
49
|
+
except Exception as e:
|
50
|
+
print(f"Conversion failed: {e}")
|
51
|
+
return False
|
65
52
|
|
66
53
|
|
67
54
|
def convert_file(
|
68
|
-
|
69
|
-
|
70
|
-
from_format: Optional[str] = None,
|
71
|
-
to_format: Optional[str] = None,
|
72
|
-
prompt: Optional[str] = None,
|
55
|
+
input_path: str,
|
56
|
+
output_path: str,
|
73
57
|
host: str = "network.openconvert.ai",
|
74
58
|
port: int = 8765
|
75
59
|
) -> bool:
|
76
|
-
"""
|
77
|
-
|
78
|
-
Convenience function for single file conversions with string paths.
|
60
|
+
"""
|
61
|
+
Convert a single file using the OpenConvert network.
|
79
62
|
|
80
63
|
Args:
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
prompt: Optional conversion prompt
|
86
|
-
host: Network host to connect to
|
87
|
-
port: Network port to connect to
|
64
|
+
input_path: Path to input file
|
65
|
+
output_path: Path for output file
|
66
|
+
host: OpenConvert network host (default: network.openconvert.ai)
|
67
|
+
port: OpenConvert network port (default: 8765)
|
88
68
|
|
89
69
|
Returns:
|
90
|
-
bool: True if conversion
|
70
|
+
bool: True if conversion successful, False otherwise
|
91
71
|
|
92
72
|
Example:
|
93
73
|
>>> from openconvert import convert_file
|
94
74
|
>>> success = convert_file("document.txt", "document.pdf")
|
95
|
-
>>> success
|
96
|
-
... "
|
97
|
-
... "report.pdf",
|
98
|
-
... prompt="Create a professional report"
|
99
|
-
... )
|
75
|
+
>>> if success:
|
76
|
+
... print("Conversion completed!")
|
100
77
|
"""
|
101
|
-
|
102
|
-
input_files=[Path(
|
103
|
-
|
104
|
-
|
105
|
-
|
106
|
-
|
107
|
-
|
108
|
-
|
109
|
-
|
78
|
+
try:
|
79
|
+
input_files = [Path(input_path)]
|
80
|
+
output_file = Path(output_path)
|
81
|
+
|
82
|
+
return convert(
|
83
|
+
input_files=input_files,
|
84
|
+
output_path=output_file,
|
85
|
+
host=host,
|
86
|
+
port=port
|
87
|
+
)
|
88
|
+
except Exception as e:
|
89
|
+
print(f"File conversion failed: {e}")
|
90
|
+
return False
|
110
91
|
|
111
92
|
|
112
|
-
|
93
|
+
# Export main functions
|
94
|
+
__all__ = [
|
95
|
+
"convert",
|
96
|
+
"convert_file",
|
97
|
+
"__version__",
|
98
|
+
"__author__",
|
99
|
+
"__email__",
|
100
|
+
]
|
openconvert/__main__.py
CHANGED
openconvert/openconvert_cli.py
CHANGED
@@ -25,10 +25,7 @@ current_dir = Path(__file__).resolve().parent
|
|
25
25
|
openagents_root = current_dir.parent.parent
|
26
26
|
sys.path.insert(0, str(openagents_root / "src"))
|
27
27
|
|
28
|
-
|
29
|
-
from .client import OpenConvertClient
|
30
|
-
except ImportError:
|
31
|
-
from client import OpenConvertClient
|
28
|
+
from openconvert.client import OpenConvertClient
|
32
29
|
|
33
30
|
# Set up logging
|
34
31
|
logging.basicConfig(
|
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.4
|
2
2
|
Name: openconvert
|
3
|
-
Version: 1.
|
3
|
+
Version: 1.1.0
|
4
4
|
Summary: CLI tool for connecting to OpenConvert OpenAgents network for file conversion
|
5
5
|
Home-page: https://github.com/acenta-ai/openconvert
|
6
6
|
Author: OpenAgents Team
|
@@ -35,7 +35,7 @@ Requires-Python: >=3.8
|
|
35
35
|
Description-Content-Type: text/markdown
|
36
36
|
License-File: LICENSE
|
37
37
|
Requires-Dist: pyyaml>=5.4.0
|
38
|
-
Requires-Dist: openagents>=0.5.
|
38
|
+
Requires-Dist: openagents>=0.5.1
|
39
39
|
Provides-Extra: dev
|
40
40
|
Requires-Dist: pytest>=6.0.0; extra == "dev"
|
41
41
|
Requires-Dist: pytest-asyncio>=0.18.0; extra == "dev"
|
@@ -0,0 +1,10 @@
|
|
1
|
+
openconvert/__init__.py,sha256=LS6gmyk28MmHmLzw5-FdemUxBvpl9Z9hF00qnC2ryps,2555
|
2
|
+
openconvert/__main__.py,sha256=IApP1DLv-K00aTUTB_yrNOnakkvq-6O1ackzJ25xbcQ,274
|
3
|
+
openconvert/client.py,sha256=qqidLnLDwF-4f5-WPutrZkNV-CGzFfm4C741NbKOIcE,14954
|
4
|
+
openconvert/openconvert_cli.py,sha256=Ip2PNJxyB-fJNxyNEBgWqYVI9MKLr2RLGzV5mNEMogU,18120
|
5
|
+
openconvert-1.1.0.dist-info/licenses/LICENSE,sha256=dHQW0DXhwJm5PhaWpJsZmcrC2OgU1sPDO66nVLmL8Ek,1072
|
6
|
+
openconvert-1.1.0.dist-info/METADATA,sha256=U4IEO1o_ER_yPR-WVGzw_k-AB0wxbZxsKt3QukpixM8,15307
|
7
|
+
openconvert-1.1.0.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
|
8
|
+
openconvert-1.1.0.dist-info/entry_points.txt,sha256=Jhi6MBetmmpMK_CpeEkzx44KFHPsuTBCZ0UzUrGZ5dM,65
|
9
|
+
openconvert-1.1.0.dist-info/top_level.txt,sha256=BQWm5PHwGlf1DRAcesIki9gKa0D27YCXJLeqj9DQ-es,12
|
10
|
+
openconvert-1.1.0.dist-info/RECORD,,
|
@@ -1,10 +0,0 @@
|
|
1
|
-
openconvert/__init__.py,sha256=jGaXnKh8u4eq3Ycq5d6G--AwYfs5PSw-MJbI1cPLw1U,3253
|
2
|
-
openconvert/__main__.py,sha256=9bqNhW4-s5yWNZGkvnUy6UCb8eaZiQAFfgeuNghDdxg,263
|
3
|
-
openconvert/client.py,sha256=qqidLnLDwF-4f5-WPutrZkNV-CGzFfm4C741NbKOIcE,14954
|
4
|
-
openconvert/openconvert_cli.py,sha256=HvWUc76dvzuoXcMWMLnh8LEXrMcT4pJCqY5bLvXaGuc,18179
|
5
|
-
openconvert-1.0.0.dist-info/licenses/LICENSE,sha256=dHQW0DXhwJm5PhaWpJsZmcrC2OgU1sPDO66nVLmL8Ek,1072
|
6
|
-
openconvert-1.0.0.dist-info/METADATA,sha256=HySK5XSYrR3EzQKvG_oTV7_TQiE9Ckt7G7kuLSUjZsk,15307
|
7
|
-
openconvert-1.0.0.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
|
8
|
-
openconvert-1.0.0.dist-info/entry_points.txt,sha256=Jhi6MBetmmpMK_CpeEkzx44KFHPsuTBCZ0UzUrGZ5dM,65
|
9
|
-
openconvert-1.0.0.dist-info/top_level.txt,sha256=BQWm5PHwGlf1DRAcesIki9gKa0D27YCXJLeqj9DQ-es,12
|
10
|
-
openconvert-1.0.0.dist-info/RECORD,,
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|