convert-stream 2.3__tar.gz → 2.3.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.
- {convert_stream-2.3 → convert_stream-2.3.1}/PKG-INFO +1 -1
- {convert_stream-2.3 → convert_stream-2.3.1}/convert_stream/enum_libs/modules.py +30 -19
- {convert_stream-2.3 → convert_stream-2.3.1}/convert_stream.egg-info/PKG-INFO +1 -1
- {convert_stream-2.3 → convert_stream-2.3.1}/pyproject.toml +1 -1
- {convert_stream-2.3 → convert_stream-2.3.1}/README.md +0 -0
- {convert_stream-2.3 → convert_stream-2.3.1}/convert_stream/__init__.py +0 -0
- {convert_stream-2.3 → convert_stream-2.3.1}/convert_stream/__main__.py +0 -0
- {convert_stream-2.3 → convert_stream-2.3.1}/convert_stream/_version.py +0 -0
- {convert_stream-2.3 → convert_stream-2.3.1}/convert_stream/doc_stream.py +0 -0
- {convert_stream-2.3 → convert_stream-2.3.1}/convert_stream/enum_libs/__init__.py +0 -0
- {convert_stream-2.3 → convert_stream-2.3.1}/convert_stream/enum_libs/enums.py +0 -0
- {convert_stream-2.3 → convert_stream-2.3.1}/convert_stream/image/__init__.py +0 -0
- {convert_stream-2.3 → convert_stream-2.3.1}/convert_stream/image/img_object.py +0 -0
- {convert_stream-2.3 → convert_stream-2.3.1}/convert_stream/pdf/__init__.py +0 -0
- {convert_stream-2.3 → convert_stream-2.3.1}/convert_stream/pdf/image_to_pdf.py +0 -0
- {convert_stream-2.3 → convert_stream-2.3.1}/convert_stream/pdf/pdf_document.py +0 -0
- {convert_stream-2.3 → convert_stream-2.3.1}/convert_stream/pdf/pdf_page.py +0 -0
- {convert_stream-2.3 → convert_stream-2.3.1}/convert_stream/pdf/pdf_to_image.py +0 -0
- {convert_stream-2.3 → convert_stream-2.3.1}/convert_stream/sheets/__init__.py +0 -0
- {convert_stream-2.3 → convert_stream-2.3.1}/convert_stream/sheets/load.py +0 -0
- {convert_stream-2.3 → convert_stream-2.3.1}/convert_stream/sheets/parse.py +0 -0
- {convert_stream-2.3 → convert_stream-2.3.1}/convert_stream/sheets/save.py +0 -0
- {convert_stream-2.3 → convert_stream-2.3.1}/convert_stream/table_files.py +0 -0
- {convert_stream-2.3 → convert_stream-2.3.1}/convert_stream/text/__init__.py +0 -0
- {convert_stream-2.3 → convert_stream-2.3.1}/convert_stream/text/date.py +0 -0
- {convert_stream-2.3 → convert_stream-2.3.1}/convert_stream/text/string.py +0 -0
- {convert_stream-2.3 → convert_stream-2.3.1}/convert_stream/text/terminal.py +0 -0
- {convert_stream-2.3 → convert_stream-2.3.1}/convert_stream.egg-info/SOURCES.txt +0 -0
- {convert_stream-2.3 → convert_stream-2.3.1}/convert_stream.egg-info/dependency_links.txt +0 -0
- {convert_stream-2.3 → convert_stream-2.3.1}/convert_stream.egg-info/requires.txt +0 -0
- {convert_stream-2.3 → convert_stream-2.3.1}/convert_stream.egg-info/top_level.txt +0 -0
- {convert_stream-2.3 → convert_stream-2.3.1}/setup.cfg +0 -0
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
#!/usr/bin/env python3
|
|
2
2
|
# -*- coding: utf-8 -*-
|
|
3
3
|
from __future__ import annotations
|
|
4
|
-
from typing import Union, TypeAlias
|
|
4
|
+
from typing import Union, TypeAlias #, Any
|
|
5
5
|
from convert_stream.enum_libs.enums import *
|
|
6
6
|
|
|
7
7
|
MOD_IMG_PIL: bool = False
|
|
@@ -10,6 +10,17 @@ MOD_PYPDF: bool = False
|
|
|
10
10
|
MOD_FITZ: bool = False
|
|
11
11
|
MOD_CANVAS: bool = False
|
|
12
12
|
|
|
13
|
+
|
|
14
|
+
class FakeType(object):
|
|
15
|
+
Image = object
|
|
16
|
+
MatLike = object
|
|
17
|
+
TextPage = object
|
|
18
|
+
Page = object
|
|
19
|
+
|
|
20
|
+
def __init__(self):
|
|
21
|
+
pass
|
|
22
|
+
|
|
23
|
+
|
|
13
24
|
#=================================================================#
|
|
14
25
|
# Módulos de Imagen, PIL e opencv
|
|
15
26
|
#=================================================================#
|
|
@@ -18,16 +29,16 @@ try:
|
|
|
18
29
|
from cv2.typing import MatLike
|
|
19
30
|
MOD_IMG_OPENCV = True
|
|
20
31
|
except ImportError:
|
|
21
|
-
cv2.typing.MatLike =
|
|
22
|
-
MatLike =
|
|
32
|
+
#cv2.typing.MatLike = FakeType
|
|
33
|
+
MatLike = FakeType
|
|
23
34
|
|
|
24
35
|
try:
|
|
25
36
|
from PIL import Image
|
|
26
37
|
from PIL import ImageOps, ImageFilter
|
|
27
38
|
MOD_IMG_PIL = True
|
|
28
39
|
except ImportError:
|
|
29
|
-
Image =
|
|
30
|
-
Image.Image =
|
|
40
|
+
Image = FakeType
|
|
41
|
+
Image.Image = FakeType
|
|
31
42
|
|
|
32
43
|
if MOD_IMG_OPENCV and MOD_IMG_PIL:
|
|
33
44
|
ModuleImage: TypeAlias = Union[MatLike, Image.Image]
|
|
@@ -40,7 +51,7 @@ elif MOD_IMG_PIL:
|
|
|
40
51
|
DEFAULT_LIB_IMAGE = LibImage.PIL
|
|
41
52
|
else:
|
|
42
53
|
DEFAULT_LIB_IMAGE = LibImage.NOT_IMPLEMENTED
|
|
43
|
-
ModuleImage =
|
|
54
|
+
ModuleImage = FakeType # fallback para runtime
|
|
44
55
|
|
|
45
56
|
#=================================================================#
|
|
46
57
|
# Módulos para PDF fitz e pypdf
|
|
@@ -54,17 +65,17 @@ except ImportError:
|
|
|
54
65
|
import pymupdf as fitz
|
|
55
66
|
MOD_FITZ = True
|
|
56
67
|
except ImportError:
|
|
57
|
-
fitz =
|
|
58
|
-
fitz.Page =
|
|
59
|
-
fitz.TextPage =
|
|
68
|
+
fitz = FakeType
|
|
69
|
+
fitz.Page = FakeType
|
|
70
|
+
fitz.TextPage = FakeType
|
|
60
71
|
|
|
61
72
|
try:
|
|
62
73
|
from pypdf import PdfWriter, PdfReader, PageObject
|
|
63
74
|
MOD_PYPDF = True
|
|
64
75
|
except ImportError:
|
|
65
|
-
PageObject =
|
|
66
|
-
PdfReader =
|
|
67
|
-
PdfWriter =
|
|
76
|
+
PageObject = FakeType
|
|
77
|
+
PdfReader = FakeType
|
|
78
|
+
PdfWriter = FakeType
|
|
68
79
|
|
|
69
80
|
|
|
70
81
|
if MOD_FITZ and MOD_PYPDF:
|
|
@@ -80,8 +91,8 @@ elif MOD_PYPDF:
|
|
|
80
91
|
ModDocPdf = Union[PdfWriter]
|
|
81
92
|
DEFAULT_LIB_PDF = LibPDF.PYPDF
|
|
82
93
|
else:
|
|
83
|
-
ModPagePdf =
|
|
84
|
-
ModDocPdf =
|
|
94
|
+
ModPagePdf = FakeType # fallback para runtime
|
|
95
|
+
ModDocPdf = FakeType
|
|
85
96
|
DEFAULT_LIB_PDF = LibPDF.NOT_IMPLEMENTED
|
|
86
97
|
|
|
87
98
|
#=================================================================#
|
|
@@ -95,10 +106,10 @@ try:
|
|
|
95
106
|
from reportlab.lib.utils import ImageReader
|
|
96
107
|
MOD_CANVAS = True
|
|
97
108
|
except ImportError:
|
|
98
|
-
canvas =
|
|
99
|
-
Canvas =
|
|
109
|
+
canvas = FakeType
|
|
110
|
+
Canvas = FakeType
|
|
100
111
|
letter = (612, 792)
|
|
101
|
-
ImageReader =
|
|
112
|
+
ImageReader = FakeType
|
|
102
113
|
|
|
103
114
|
if MOD_CANVAS and MOD_FITZ and MOD_IMG_PIL:
|
|
104
115
|
ModImageToPdf: TypeAlias = Union[canvas, fitz.Page, Image]
|
|
@@ -113,7 +124,7 @@ elif MOD_IMG_PIL:
|
|
|
113
124
|
ModImageToPdf: TypeAlias = Union[Image]
|
|
114
125
|
DEFAULT_LIB_IMAGE_TO_PDF = LibImageToPdf.IMAGE_TO_PDF_PIL
|
|
115
126
|
else:
|
|
116
|
-
ModImageToPdf =
|
|
127
|
+
ModImageToPdf = FakeType
|
|
117
128
|
DEFAULT_LIB_IMAGE_TO_PDF = LibImageToPdf.NOT_IMPLEMENTED
|
|
118
129
|
|
|
119
130
|
#=================================================================#
|
|
@@ -125,4 +136,4 @@ if MOD_FITZ:
|
|
|
125
136
|
ModPdfToImage: TypeAlias = Union[fitz]
|
|
126
137
|
else:
|
|
127
138
|
DEFAULT_LIB_PDF_TO_IMG = LibPdfToImage.NOT_IMPLEMENTED
|
|
128
|
-
ModPdfToImage =
|
|
139
|
+
ModPdfToImage = FakeType
|
|
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
|