pyflutter-app 0.2.2__tar.gz → 0.2.3__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.
- {pyflutter_app-0.2.2 → pyflutter_app-0.2.3}/PKG-INFO +2 -1
- {pyflutter_app-0.2.2 → pyflutter_app-0.2.3}/converter/util.py +2 -4
- {pyflutter_app-0.2.2 → pyflutter_app-0.2.3}/local_build/send.sh +1 -1
- pyflutter_app-0.2.3/main.py +20 -0
- pyflutter_app-0.2.3/ocrlib/export_ocr.sh +60 -0
- pyflutter_app-0.2.3/ocrlib/modules.py +178 -0
- pyflutter_app-0.2.3/ocrlib/pdf_convert.py +1259 -0
- pyflutter_app-0.2.3/ocrlib/recognize.py +1034 -0
- pyflutter_app-0.2.3/ocrlib/util.py +6 -0
- {pyflutter_app-0.2.2 → pyflutter_app-0.2.3}/pyproject.toml +2 -1
- {pyflutter_app-0.2.2 → pyflutter_app-0.2.3}/table_stream/__init__.py +8 -2
- {pyflutter_app-0.2.2 → pyflutter_app-0.2.3}/table_stream/notifier.py +37 -0
- {pyflutter_app-0.2.2 → pyflutter_app-0.2.3}/table_stream/sysfiles.py +107 -21
- pyflutter_app-0.2.3/test.py +63 -0
- {pyflutter_app-0.2.2 → pyflutter_app-0.2.3}/uv.lock +22 -1
- pyflutter_app-0.2.3/whatsapp_files/__init__.py +0 -0
- pyflutter_app-0.2.3/whatsapp_files/file_names.py +678 -0
- pyflutter_app-0.2.3/whatsapp_files/stream_files.py +417 -0
- pyflutter_app-0.2.2/main.py +0 -63
- pyflutter_app-0.2.2/table_stream/file_names.py +0 -539
- {pyflutter_app-0.2.2 → pyflutter_app-0.2.3}/.gitignore +0 -0
- {pyflutter_app-0.2.2 → pyflutter_app-0.2.3}/.idea/.gitignore +0 -0
- {pyflutter_app-0.2.2 → pyflutter_app-0.2.3}/.idea/inspectionProfiles/Project_Default.xml +0 -0
- {pyflutter_app-0.2.2 → pyflutter_app-0.2.3}/.idea/inspectionProfiles/profiles_settings.xml +0 -0
- {pyflutter_app-0.2.2 → pyflutter_app-0.2.3}/.idea/misc.xml +0 -0
- {pyflutter_app-0.2.2 → pyflutter_app-0.2.3}/.idea/modules.xml +0 -0
- {pyflutter_app-0.2.2 → pyflutter_app-0.2.3}/.idea/pyflutter_app.iml +0 -0
- {pyflutter_app-0.2.2 → pyflutter_app-0.2.3}/.idea/vcs.xml +0 -0
- {pyflutter_app-0.2.2 → pyflutter_app-0.2.3}/README.md +0 -0
- {pyflutter_app-0.2.2 → pyflutter_app-0.2.3}/converter/__init__.py +0 -0
- {pyflutter_app-0.2.2 → pyflutter_app-0.2.3}/converter/__main__.py +0 -0
- {pyflutter_app-0.2.2 → pyflutter_app-0.2.3}/converter/assets/forms_config.json +0 -0
- {pyflutter_app-0.2.2 → pyflutter_app-0.2.3}/converter/config_app.py +0 -0
- {pyflutter_app-0.2.2 → pyflutter_app-0.2.3}/converter/home_page/__init__.py +0 -0
- {pyflutter_app-0.2.2 → pyflutter_app-0.2.3}/converter/home_page/_page_edit.py +0 -0
- {pyflutter_app-0.2.2 → pyflutter_app-0.2.3}/converter/home_page/controller.py +0 -0
- {pyflutter_app-0.2.2 → pyflutter_app-0.2.3}/converter/home_page/model.py +0 -0
- {pyflutter_app-0.2.2 → pyflutter_app-0.2.3}/converter/home_page/view.py +0 -0
- {pyflutter_app-0.2.2 → pyflutter_app-0.2.3}/converter/lib_toi.py +0 -0
- {pyflutter_app-0.2.2 → pyflutter_app-0.2.3}/converter/page_forms/__init__.py +0 -0
- {pyflutter_app-0.2.2 → pyflutter_app-0.2.3}/converter/page_forms/common.py +0 -0
- {pyflutter_app-0.2.2 → pyflutter_app-0.2.3}/converter/page_forms/config.py +0 -0
- {pyflutter_app-0.2.2 → pyflutter_app-0.2.3}/converter/page_forms/controller_forms.py +0 -0
- {pyflutter_app-0.2.2 → pyflutter_app-0.2.3}/converter/page_forms/model_forms.py +0 -0
- {pyflutter_app-0.2.2 → pyflutter_app-0.2.3}/converter/page_forms/service.py +0 -0
- {pyflutter_app-0.2.2 → pyflutter_app-0.2.3}/converter/run.py +0 -0
- {pyflutter_app-0.2.2 → pyflutter_app-0.2.3}/converter/table_widget.py +0 -0
- {pyflutter_app-0.2.2 → pyflutter_app-0.2.3}/converter/whatsapp/__init__.py +0 -0
- {pyflutter_app-0.2.2 → pyflutter_app-0.2.3}/converter/whatsapp/model.py +0 -0
- {pyflutter_app-0.2.2 → pyflutter_app-0.2.3}/export_app.sh +0 -0
- {pyflutter_app-0.2.2 → pyflutter_app-0.2.3}/local_build/linux.sh +0 -0
- {pyflutter_app-0.2.2 → pyflutter_app-0.2.3}/pyflutter_ui/__init__.py +0 -0
- {pyflutter_app-0.2.2 → pyflutter_app-0.2.3}/pyflutter_ui/app.py +0 -0
- {pyflutter_app-0.2.2 → pyflutter_app-0.2.3}/pyflutter_ui/file_picker.py +0 -0
- {pyflutter_app-0.2.2 → pyflutter_app-0.2.3}/pyflutter_ui/navigator.py +0 -0
- {pyflutter_app-0.2.2 → pyflutter_app-0.2.3}/pyflutter_ui/scheduler.py +0 -0
- {pyflutter_app-0.2.2 → pyflutter_app-0.2.3}/pyflutter_ui/theme.py +0 -0
- {pyflutter_app-0.2.2 → pyflutter_app-0.2.3}/pyflutter_ui/ui/__init__.py +0 -0
- {pyflutter_app-0.2.2 → pyflutter_app-0.2.3}/pyflutter_ui/ui/buttons.py +0 -0
- {pyflutter_app-0.2.2 → pyflutter_app-0.2.3}/pyflutter_ui/ui/container.py +0 -0
- {pyflutter_app-0.2.2 → pyflutter_app-0.2.3}/pyflutter_ui/ui/core.py +0 -0
- {pyflutter_app-0.2.2 → pyflutter_app-0.2.3}/pyflutter_ui/ui/list_builder.py +0 -0
- {pyflutter_app-0.2.2 → pyflutter_app-0.2.3}/pyflutter_ui/ui/progress.py +0 -0
- {pyflutter_app-0.2.2 → pyflutter_app-0.2.3}/pyflutter_ui/ui/tables.py +0 -0
- {pyflutter_app-0.2.2 → pyflutter_app-0.2.3}/pyflutter_ui/ui/widgets.py +0 -0
- {pyflutter_app-0.2.2 → pyflutter_app-0.2.3}/table_stream/erros.py +0 -0
- {pyflutter_app-0.2.2 → pyflutter_app-0.2.3}/table_stream/hash_map.py +0 -0
- {pyflutter_app-0.2.2 → pyflutter_app-0.2.3}/table_stream/pattner/__init__.py +0 -0
- {pyflutter_app-0.2.2 → pyflutter_app-0.2.3}/table_stream/pattner/adapter.py +0 -0
- {pyflutter_app-0.2.2 → pyflutter_app-0.2.3}/table_stream/sheet/__init__.py +0 -0
- {pyflutter_app-0.2.2 → pyflutter_app-0.2.3}/table_stream/sheet/check_mod.py +0 -0
- {pyflutter_app-0.2.2 → pyflutter_app-0.2.3}/table_stream/sheet/load.py +0 -0
- {pyflutter_app-0.2.2 → pyflutter_app-0.2.3}/table_stream/sheet/options.py +0 -0
- {pyflutter_app-0.2.2 → pyflutter_app-0.2.3}/table_stream/sheet/parse.py +0 -0
- {pyflutter_app-0.2.2 → pyflutter_app-0.2.3}/table_stream/sheet/save.py +0 -0
- {pyflutter_app-0.2.2 → pyflutter_app-0.2.3}/table_stream/state.py +0 -0
- {pyflutter_app-0.2.2 → pyflutter_app-0.2.3}/table_stream/thread.py +0 -0
- {pyflutter_app-0.2.2 → pyflutter_app-0.2.3}/table_stream/workbook.py +0 -0
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
Metadata-Version: 2.5
|
|
2
2
|
Name: pyflutter_app
|
|
3
|
-
Version: 0.2.
|
|
3
|
+
Version: 0.2.3
|
|
4
4
|
Summary: Bibliotecas Python para conversão de documentos, interface e processamento de tabelas.
|
|
5
5
|
Requires-Python: >=3.12
|
|
6
|
+
Requires-Dist: opencv-python>=5.0.0.93
|
|
6
7
|
Requires-Dist: openpyxl>=3.1.5
|
|
7
8
|
Requires-Dist: pandas-stubs~=3.0.3
|
|
8
9
|
Requires-Dist: pandas>=3.0.0
|
|
@@ -10,10 +10,8 @@ from table_stream.thread import (
|
|
|
10
10
|
from table_stream.hash_map import (
|
|
11
11
|
HashMapDict, HashMapDataFrame, ArrayList, hashMapName
|
|
12
12
|
)
|
|
13
|
-
from
|
|
14
|
-
ColumnsWhatsApp,
|
|
15
|
-
FactoryNameDocument, load_whatsapp_txt, NameDocumentOrganizable, ORGANIZABLE_DOC_NAME,
|
|
16
|
-
OrganizeDocumentsNames,
|
|
13
|
+
from whatsapp_files.file_names import (
|
|
14
|
+
ColumnsWhatsApp, load_whatsapp_txt, NameDocumentOrganizable, ORGANIZABLE_DOC_NAME,
|
|
17
15
|
)
|
|
18
16
|
from table_stream.notifier import Listener, Notifier
|
|
19
17
|
from table_stream.state import (
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
"""
|
|
2
|
+
dependencies = [
|
|
3
|
+
"opencv-python>=5.0.0.93",
|
|
4
|
+
"openpyxl>=3.1.5",
|
|
5
|
+
"pandas>=3.0.0",
|
|
6
|
+
"pandas-stubs~=3.0.3",
|
|
7
|
+
"pymupdf>=1.28.2",
|
|
8
|
+
"pytesseract>=0.3.13",
|
|
9
|
+
]
|
|
10
|
+
|
|
11
|
+
"""
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
def main() -> None:
|
|
16
|
+
from converter import run_ui
|
|
17
|
+
run_ui()
|
|
18
|
+
|
|
19
|
+
if __name__ == '__main__':
|
|
20
|
+
main()
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
#!/bin/bash
|
|
2
|
+
|
|
3
|
+
THIS=$0
|
|
4
|
+
THIS_DIR=$(dirname $(readlink -f $THIS))
|
|
5
|
+
APPNAME='ocrlib'
|
|
6
|
+
PREFIX_OUTDIR="Documentos/PROMPTS/Fonte-de-Dados/Python"
|
|
7
|
+
LIB_DIR="$THIS_DIR"
|
|
8
|
+
|
|
9
|
+
# Arquivo final
|
|
10
|
+
OUTPUT_DIR="${HOME}/${PREFIX_OUTDIR}"
|
|
11
|
+
OUTPUT_FILE_CORE="${OUTPUT_DIR}/${APPNAME}.py"
|
|
12
|
+
|
|
13
|
+
function start(){
|
|
14
|
+
mkdir -p "$OUTPUT_DIR"
|
|
15
|
+
# limpa o arquivo se já existir
|
|
16
|
+
echo "" > "$OUTPUT_FILE_CORE"
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
function save_dir(){
|
|
20
|
+
[[ -z $1 ]] && {
|
|
21
|
+
echo -e " * save_dir: diretório nulo"
|
|
22
|
+
return 1
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
[[ -z $2 ]] && {
|
|
26
|
+
echo -e "* save_dir: arquivo nulo"
|
|
27
|
+
return 1
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
[[ ! -d $1 ]] && {
|
|
31
|
+
echo -e "* save_dir: diretório inexistente ... $1"
|
|
32
|
+
return 1
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
[[ ! -f $2 ]] && {
|
|
36
|
+
echo -e "* save_dir: arquivo inexistente ... $2"
|
|
37
|
+
return 1
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
echo -e "[*] Iniciando cópia dos arquivos *.py ... $1"
|
|
41
|
+
# encontra todos os .py e concatena
|
|
42
|
+
local CURRENT_DIR=$1
|
|
43
|
+
local EXPORT_DIR=$2
|
|
44
|
+
|
|
45
|
+
find "$CURRENT_DIR" -type f -name "*.py" | sort | while read file; do
|
|
46
|
+
echo -e "#===[ $(date) FILE: $file ===]\n" >> "$EXPORT_DIR"
|
|
47
|
+
cat "$file" >> "$EXPORT_DIR"
|
|
48
|
+
echo -e "\n\n" >> "$EXPORT_DIR"
|
|
49
|
+
done
|
|
50
|
+
echo -e "[OK] arquivo gerado: $EXPORT_DIR"
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
|
|
54
|
+
function main(){
|
|
55
|
+
start
|
|
56
|
+
save_dir "$LIB_DIR" "$OUTPUT_FILE_CORE"
|
|
57
|
+
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
main $@
|
|
@@ -0,0 +1,178 @@
|
|
|
1
|
+
#!/usr/bin/env python3
|
|
2
|
+
# -*- coding: utf-8 -*-
|
|
3
|
+
from __future__ import annotations
|
|
4
|
+
from typing import TypeAlias, Union, NewType, TypeVar, Any
|
|
5
|
+
from enum import StrEnum, Enum
|
|
6
|
+
from table_stream.sysfiles import load_file_hash
|
|
7
|
+
from table_stream.hash_map import HashMapDict, ArrayList
|
|
8
|
+
|
|
9
|
+
# ================================================================ #
|
|
10
|
+
# Controle dos módulos opcionais
|
|
11
|
+
# ================================================================ #
|
|
12
|
+
|
|
13
|
+
MOD_IMG_PIL: bool = False
|
|
14
|
+
MOD_IMG_OPENCV: bool = False
|
|
15
|
+
MOD_PYPDF: bool = False
|
|
16
|
+
MOD_FITZ: bool = False
|
|
17
|
+
MOD_CANVAS: bool = False
|
|
18
|
+
MOD_PYTESSERACT: bool = False
|
|
19
|
+
|
|
20
|
+
# ================================================================ #
|
|
21
|
+
# Módulos de imagem: PIL e OpenCV
|
|
22
|
+
# ================================================================ #
|
|
23
|
+
|
|
24
|
+
try:
|
|
25
|
+
import cv2
|
|
26
|
+
import cv2.typing
|
|
27
|
+
|
|
28
|
+
MOD_IMG_OPENCV = True
|
|
29
|
+
|
|
30
|
+
except ImportError:
|
|
31
|
+
pass
|
|
32
|
+
|
|
33
|
+
|
|
34
|
+
try:
|
|
35
|
+
from PIL import Image
|
|
36
|
+
from PIL import ImageOps, ImageFilter
|
|
37
|
+
MOD_IMG_PIL = True
|
|
38
|
+
except ImportError:
|
|
39
|
+
pass
|
|
40
|
+
|
|
41
|
+
|
|
42
|
+
# ================================================================ #
|
|
43
|
+
# PyMuPDF e pypdf
|
|
44
|
+
# ================================================================ #
|
|
45
|
+
|
|
46
|
+
try:
|
|
47
|
+
from pymupdf import Page, Document, DocumentWriter
|
|
48
|
+
MOD_FITZ = True
|
|
49
|
+
except ImportError:
|
|
50
|
+
pass
|
|
51
|
+
|
|
52
|
+
|
|
53
|
+
try:
|
|
54
|
+
from pypdf import PdfWriter, PdfReader, PageObject
|
|
55
|
+
MOD_PYPDF = True
|
|
56
|
+
except ImportError:
|
|
57
|
+
pass
|
|
58
|
+
|
|
59
|
+
|
|
60
|
+
realPagePdf: TypeAlias = Union["Page", "PageObject"]
|
|
61
|
+
realDocument: TypeAlias = Union["Document", "PdfWriter", "PdfReader"]
|
|
62
|
+
|
|
63
|
+
# ================================================================ #
|
|
64
|
+
# ReportLab
|
|
65
|
+
# ================================================================ #
|
|
66
|
+
|
|
67
|
+
try:
|
|
68
|
+
from reportlab.pdfgen import canvas
|
|
69
|
+
from reportlab.pdfgen.canvas import Canvas
|
|
70
|
+
from reportlab.lib.pagesizes import letter
|
|
71
|
+
from reportlab.lib.utils import ImageReader
|
|
72
|
+
|
|
73
|
+
MOD_CANVAS = True
|
|
74
|
+
|
|
75
|
+
except ImportError:
|
|
76
|
+
letter = (612, 792)
|
|
77
|
+
|
|
78
|
+
# ================================================================ #
|
|
79
|
+
# pytesseract
|
|
80
|
+
# ================================================================ #
|
|
81
|
+
|
|
82
|
+
try:
|
|
83
|
+
from pytesseract import pytesseract
|
|
84
|
+
MOD_PYTESSERACT = True
|
|
85
|
+
except:
|
|
86
|
+
pass
|
|
87
|
+
|
|
88
|
+
|
|
89
|
+
# ================================================================ #
|
|
90
|
+
# Colunas de tabelas e Enums
|
|
91
|
+
# ================================================================ #
|
|
92
|
+
|
|
93
|
+
|
|
94
|
+
class ColumnsPdf(StrEnum):
|
|
95
|
+
|
|
96
|
+
NUM_PAGE = "PÁGINA"
|
|
97
|
+
LINE_PAGE = "LINHA"
|
|
98
|
+
TEXT = "TEXTO"
|
|
99
|
+
|
|
100
|
+
|
|
101
|
+
class ColumnsOcr(StrEnum):
|
|
102
|
+
|
|
103
|
+
ID = "ID"
|
|
104
|
+
HASH_FILE = "HASH_FILE"
|
|
105
|
+
NUM_PAG = "PÁGINA"
|
|
106
|
+
NUM_LINHA = "LINHA"
|
|
107
|
+
TEXT = "TEXTO"
|
|
108
|
+
FILENAME = "NOME_ARQUIVO"
|
|
109
|
+
FILE_EXTENSION = "TIPO_ARQUIVO"
|
|
110
|
+
FILE_PATH = "ARQUIVO"
|
|
111
|
+
|
|
112
|
+
|
|
113
|
+
class LibPDF(StrEnum):
|
|
114
|
+
|
|
115
|
+
PYPDF = 'pypdf'
|
|
116
|
+
FITZ = 'fitz'
|
|
117
|
+
NOT_IMPLEMENTED = 'null'
|
|
118
|
+
|
|
119
|
+
|
|
120
|
+
class LibImage(StrEnum):
|
|
121
|
+
|
|
122
|
+
PIL = 'pil'
|
|
123
|
+
OPENCV = 'opencv'
|
|
124
|
+
NOT_IMPLEMENTED = 'null'
|
|
125
|
+
|
|
126
|
+
|
|
127
|
+
class RotationAngle(Enum):
|
|
128
|
+
|
|
129
|
+
ROTATION_90 = 90
|
|
130
|
+
ROTATION_180 = 180
|
|
131
|
+
ROTATION_270 = 270
|
|
132
|
+
|
|
133
|
+
# ================================================================ #
|
|
134
|
+
# Map para guardar dados Globais
|
|
135
|
+
# ================================================================ #
|
|
136
|
+
|
|
137
|
+
T = TypeVar("T")
|
|
138
|
+
|
|
139
|
+
|
|
140
|
+
class GlobalMap(HashMapDict):
|
|
141
|
+
"""
|
|
142
|
+
Fornece o caminho absoluto do tesseract instalado no sistema, se
|
|
143
|
+
disponível. Você pode usar um binário alternativo, basta informar
|
|
144
|
+
o caminho do binário desejado no construtor.
|
|
145
|
+
"""
|
|
146
|
+
_instance = None # Atributo de classe para armazenar a instância singleton
|
|
147
|
+
|
|
148
|
+
def __new__(cls, *args, **kwargs):
|
|
149
|
+
if cls._instance is None:
|
|
150
|
+
cls._instance = super(GlobalMap, cls).__new__(cls)
|
|
151
|
+
return cls._instance
|
|
152
|
+
|
|
153
|
+
def __init__(self) -> None:
|
|
154
|
+
super().__init__(None)
|
|
155
|
+
# Garante que __init__ não será executado mais de uma vez
|
|
156
|
+
if hasattr(self, '_initialized') and self._initialized:
|
|
157
|
+
return
|
|
158
|
+
|
|
159
|
+
self._initialized: bool = True
|
|
160
|
+
|
|
161
|
+
def __repr__(self) -> str:
|
|
162
|
+
return f"{__class__.__name__}(): {super().__repr__()}"
|
|
163
|
+
|
|
164
|
+
def read(self, type_key: type[T]) -> T:
|
|
165
|
+
return self.get_value(type_key)
|
|
166
|
+
|
|
167
|
+
@classmethod
|
|
168
|
+
def get_or_create(cls) -> GlobalMap:
|
|
169
|
+
|
|
170
|
+
if cls._instance is None:
|
|
171
|
+
instance = cls()
|
|
172
|
+
else:
|
|
173
|
+
instance = cls._instance
|
|
174
|
+
return instance
|
|
175
|
+
|
|
176
|
+
|
|
177
|
+
|
|
178
|
+
|