pyflutter-app 0.3.5__tar.gz → 0.3.6__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.
Files changed (68) hide show
  1. {pyflutter_app-0.3.5 → pyflutter_app-0.3.6}/PKG-INFO +1 -1
  2. {pyflutter_app-0.3.5 → pyflutter_app-0.3.6}/pyproject.toml +1 -1
  3. {pyflutter_app-0.3.5 → pyflutter_app-0.3.6}/table_stream/__init__.py +81 -11
  4. pyflutter_app-0.3.6/teste_ocr.py +28 -0
  5. {pyflutter_app-0.3.5 → pyflutter_app-0.3.6}/uv.lock +1 -1
  6. pyflutter_app-0.3.5/teste_ocr.py +0 -44
  7. {pyflutter_app-0.3.5 → pyflutter_app-0.3.6}/.gitignore +0 -0
  8. {pyflutter_app-0.3.5 → pyflutter_app-0.3.6}/.idea/.gitignore +0 -0
  9. {pyflutter_app-0.3.5 → pyflutter_app-0.3.6}/.idea/inspectionProfiles/Project_Default.xml +0 -0
  10. {pyflutter_app-0.3.5 → pyflutter_app-0.3.6}/.idea/inspectionProfiles/profiles_settings.xml +0 -0
  11. {pyflutter_app-0.3.5 → pyflutter_app-0.3.6}/.idea/misc.xml +0 -0
  12. {pyflutter_app-0.3.5 → pyflutter_app-0.3.6}/.idea/modules.xml +0 -0
  13. {pyflutter_app-0.3.5 → pyflutter_app-0.3.6}/.idea/pyflutter_app.iml +0 -0
  14. {pyflutter_app-0.3.5 → pyflutter_app-0.3.6}/.idea/vcs.xml +0 -0
  15. {pyflutter_app-0.3.5 → pyflutter_app-0.3.6}/README.md +0 -0
  16. {pyflutter_app-0.3.5 → pyflutter_app-0.3.6}/cartas/__init__.py +0 -0
  17. {pyflutter_app-0.3.5 → pyflutter_app-0.3.6}/cartas/origin.py +0 -0
  18. {pyflutter_app-0.3.5 → pyflutter_app-0.3.6}/converter/__init__.py +0 -0
  19. {pyflutter_app-0.3.5 → pyflutter_app-0.3.6}/converter/__main__.py +0 -0
  20. {pyflutter_app-0.3.5 → pyflutter_app-0.3.6}/converter/assets/forms_config.json +0 -0
  21. {pyflutter_app-0.3.5 → pyflutter_app-0.3.6}/converter/config_app.py +0 -0
  22. {pyflutter_app-0.3.5 → pyflutter_app-0.3.6}/converter/home_page/__init__.py +0 -0
  23. {pyflutter_app-0.3.5 → pyflutter_app-0.3.6}/converter/home_page/_page_edit.py +0 -0
  24. {pyflutter_app-0.3.5 → pyflutter_app-0.3.6}/converter/home_page/controller.py +0 -0
  25. {pyflutter_app-0.3.5 → pyflutter_app-0.3.6}/converter/home_page/model.py +0 -0
  26. {pyflutter_app-0.3.5 → pyflutter_app-0.3.6}/converter/home_page/view.py +0 -0
  27. {pyflutter_app-0.3.5 → pyflutter_app-0.3.6}/converter/lib_toi.py +0 -0
  28. {pyflutter_app-0.3.5 → pyflutter_app-0.3.6}/converter/page_forms/Diagnorstico.txt +0 -0
  29. {pyflutter_app-0.3.5 → pyflutter_app-0.3.6}/converter/page_forms/__init__.py +0 -0
  30. {pyflutter_app-0.3.5 → pyflutter_app-0.3.6}/converter/page_forms/common.py +0 -0
  31. {pyflutter_app-0.3.5 → pyflutter_app-0.3.6}/converter/page_forms/config.py +0 -0
  32. {pyflutter_app-0.3.5 → pyflutter_app-0.3.6}/converter/page_forms/controller_forms.py +0 -0
  33. {pyflutter_app-0.3.5 → pyflutter_app-0.3.6}/converter/page_forms/diagnose_forms.py +0 -0
  34. {pyflutter_app-0.3.5 → pyflutter_app-0.3.6}/converter/page_forms/master_forms.py +0 -0
  35. {pyflutter_app-0.3.5 → pyflutter_app-0.3.6}/converter/page_forms/model_forms.py +0 -0
  36. {pyflutter_app-0.3.5 → pyflutter_app-0.3.6}/converter/page_forms/service.py +0 -0
  37. {pyflutter_app-0.3.5 → pyflutter_app-0.3.6}/converter/page_forms/view_forms.py +0 -0
  38. {pyflutter_app-0.3.5 → pyflutter_app-0.3.6}/converter/run_app_convert.py +0 -0
  39. {pyflutter_app-0.3.5 → pyflutter_app-0.3.6}/converter/table_widget.py +0 -0
  40. {pyflutter_app-0.3.5 → pyflutter_app-0.3.6}/converter/util.py +0 -0
  41. {pyflutter_app-0.3.5 → pyflutter_app-0.3.6}/converter/whatsapp/__init__.py +0 -0
  42. {pyflutter_app-0.3.5 → pyflutter_app-0.3.6}/converter/whatsapp/model.py +0 -0
  43. {pyflutter_app-0.3.5 → pyflutter_app-0.3.6}/local_build/linux.sh +0 -0
  44. {pyflutter_app-0.3.5 → pyflutter_app-0.3.6}/local_build/send.sh +0 -0
  45. {pyflutter_app-0.3.5 → pyflutter_app-0.3.6}/main.py +0 -0
  46. {pyflutter_app-0.3.5 → pyflutter_app-0.3.6}/mvc/controller.py +0 -0
  47. {pyflutter_app-0.3.5 → pyflutter_app-0.3.6}/mvc/model.py +0 -0
  48. {pyflutter_app-0.3.5 → pyflutter_app-0.3.6}/mvc/view.py +0 -0
  49. {pyflutter_app-0.3.5 → pyflutter_app-0.3.6}/new-export_app.sh +0 -0
  50. {pyflutter_app-0.3.5 → pyflutter_app-0.3.6}/ocrlib/__init__.py +0 -0
  51. {pyflutter_app-0.3.5 → pyflutter_app-0.3.6}/pdflib/__init__.py +0 -0
  52. {pyflutter_app-0.3.5 → pyflutter_app-0.3.6}/pyflutter_ui/__init__.py +0 -0
  53. {pyflutter_app-0.3.5 → pyflutter_app-0.3.6}/pyflutter_ui/app.py +0 -0
  54. {pyflutter_app-0.3.5 → pyflutter_app-0.3.6}/pyflutter_ui/file_picker.py +0 -0
  55. {pyflutter_app-0.3.5 → pyflutter_app-0.3.6}/pyflutter_ui/navigator.py +0 -0
  56. {pyflutter_app-0.3.5 → pyflutter_app-0.3.6}/pyflutter_ui/scheduler.py +0 -0
  57. {pyflutter_app-0.3.5 → pyflutter_app-0.3.6}/pyflutter_ui/theme.py +0 -0
  58. {pyflutter_app-0.3.5 → pyflutter_app-0.3.6}/pyflutter_ui/ui/__init__.py +0 -0
  59. {pyflutter_app-0.3.5 → pyflutter_app-0.3.6}/pyflutter_ui/ui/buttons.py +0 -0
  60. {pyflutter_app-0.3.5 → pyflutter_app-0.3.6}/pyflutter_ui/ui/container.py +0 -0
  61. {pyflutter_app-0.3.5 → pyflutter_app-0.3.6}/pyflutter_ui/ui/core.py +0 -0
  62. {pyflutter_app-0.3.5 → pyflutter_app-0.3.6}/pyflutter_ui/ui/list_builder.py +0 -0
  63. {pyflutter_app-0.3.5 → pyflutter_app-0.3.6}/pyflutter_ui/ui/progress.py +0 -0
  64. {pyflutter_app-0.3.5 → pyflutter_app-0.3.6}/pyflutter_ui/ui/tables.py +0 -0
  65. {pyflutter_app-0.3.5 → pyflutter_app-0.3.6}/pyflutter_ui/ui/widgets.py +0 -0
  66. {pyflutter_app-0.3.5 → pyflutter_app-0.3.6}/test_claude.py +0 -0
  67. {pyflutter_app-0.3.5 → pyflutter_app-0.3.6}/update.sh +0 -0
  68. {pyflutter_app-0.3.5 → pyflutter_app-0.3.6}/whatsapp_files/__init__.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.5
2
2
  Name: pyflutter_app
3
- Version: 0.3.5
3
+ Version: 0.3.6
4
4
  Summary: Bibliotecas Python para conversão de documentos, interface e processamento de tabelas.
5
5
  Requires-Python: >=3.12
6
6
  Requires-Dist: opencv-python>=5.0.0.93
@@ -1,6 +1,6 @@
1
1
  [project]
2
2
  name = "pyflutter_app"
3
- version = "0.3.5"
3
+ version = "0.3.6"
4
4
  description = "Bibliotecas Python para conversão de documentos, interface e processamento de tabelas."
5
5
  readme = "README.md"
6
6
  requires-python = ">=3.12"
@@ -3219,8 +3219,11 @@ class DataStorage(Observable[pd.DataFrame]):
3219
3219
 
3220
3220
  class DataReader(object):
3221
3221
 
3222
- def __init__(self, store: DataStorage) -> None:
3222
+ def __init__(self, store: DataStorage | None = None) -> None:
3223
3223
  super().__init__()
3224
+ if store is None:
3225
+ store = DataStorage()
3226
+
3224
3227
  self._store = store
3225
3228
 
3226
3229
  def read(self, path: File) -> pd.DataFrame:
@@ -3239,9 +3242,9 @@ class DataSave(Observer[pd.DataFrame]):
3239
3242
  Salvar o DataFrame() em um arquivo sempre receber uma notificação.
3240
3243
  """
3241
3244
 
3242
- def __init__(self, path_sheet: File) -> None:
3245
+ def __init__(self, path_sheet: File | None = None) -> None:
3243
3246
  super().__init__()
3244
- self.path_sheet: File = path_sheet
3247
+ self.path_sheet: File | None = path_sheet
3245
3248
  self.csv_options: CsvOptions = CsvOptions()
3246
3249
  self.debug: bool = True
3247
3250
 
@@ -3252,6 +3255,9 @@ class DataSave(Observer[pd.DataFrame]):
3252
3255
 
3253
3256
  def update(self, value: pd.DataFrame) -> None:
3254
3257
 
3258
+ if self.path_sheet is None:
3259
+ raise ValueError(f"{__class__.__name__} o arquivo de destino é nulo.")
3260
+
3255
3261
  self._show(f"Salvando ... {self.path_sheet.absolute()}")
3256
3262
 
3257
3263
  if self.path_sheet.is_csv():
@@ -3288,6 +3294,7 @@ class SplitterData(Notifier):
3288
3294
  def split(self, df: pd.DataFrame, output: Directory) -> None:
3289
3295
  if df.empty:
3290
3296
  return None
3297
+ df = df.astype(str)
3291
3298
 
3292
3299
  self.output_dir = output
3293
3300
  values_split = Set(df[self.col_split].drop_duplicates().values.tolist())
@@ -3312,16 +3319,42 @@ class SplitterData(Notifier):
3312
3319
  return super().notify_listeners()
3313
3320
 
3314
3321
 
3315
- class DataExport(Listener):
3322
+ class ListenerSplitter(Listener[SplitterData]):
3316
3323
 
3317
3324
  def __init__(self) -> None:
3318
3325
  super().__init__()
3319
- self.saver = DataSave(None)
3326
+ self.saver = DataSave()
3327
+
3328
+ def set_csv_options(self, opt: CsvOptions):
3329
+ self.saver.csv_options = opt
3320
3330
 
3321
3331
  def receiver_notifier(self) -> None:
3322
3332
  sp = self.read()
3323
3333
  self.update(sp)
3324
3334
 
3335
+ def create_export_files(self, d: Directory, filename: str) -> Set[File]:
3336
+ dir_excel = d.concat("EXCEL", True)
3337
+ dir_csv = d.concat("CSV", True)
3338
+
3339
+ path_excel = dir_excel.join_file(f"{filename}.xlsx")
3340
+ path_csv = dir_csv.join_file(f"{filename}.csv")
3341
+ return Set([path_excel, path_csv])
3342
+
3343
+ def _run_export(self, df: pd.DataFrame, files: Set[File]) -> None:
3344
+ """
3345
+ Exporta o mesmo DataFrame() para varios caminhos/arquivos
3346
+
3347
+ util para exportar csv/excel
3348
+ """
3349
+
3350
+ if files.empty():
3351
+ return None
3352
+
3353
+ f: File
3354
+ for f in files:
3355
+ self.saver.path_sheet = f
3356
+ self.saver.update(df)
3357
+
3325
3358
  def update(self, value: SplitterData) -> None:
3326
3359
  if value.output_dir is None:
3327
3360
  return
@@ -3331,12 +3364,49 @@ class DataExport(Listener):
3331
3364
  d = value.output_dir
3332
3365
  d.mkdir()
3333
3366
 
3334
- final_name = f"{value.current_file_name}.xlsx"
3367
+ final_filename: str = str(value.current_file_name)
3335
3368
 
3336
3369
  if value.current_prefix is not None:
3337
- final_name = f"{value.current_prefix}-{final_name}"
3370
+ final_filename = f"{value.current_prefix}-{final_filename}"
3371
+
3372
+ print(f"Progresso: [{value.done}/{value.total_export}]")
3373
+
3374
+ files = self.create_export_files(d, final_filename)
3375
+ df = value.storage.get_data()
3376
+ self._run_export(df, files)
3338
3377
 
3339
- path = d.join_file(final_name)
3340
- print(f"Exportando [{value.done}/{value.total_export}] ... {path}")
3341
- self.saver.path_sheet = path
3342
- self.saver.update(value.storage.get_data())
3378
+
3379
+ class ListenerSplitterQgiz(ListenerSplitter):
3380
+
3381
+ def __init__(self) -> None:
3382
+ super().__init__()
3383
+
3384
+ def create_export_files(self, d: Directory, filename: str) -> Set[File]:
3385
+ sp = self.read()
3386
+ current_data = sp.storage.get_data()
3387
+ cols = ArrayList(current_data.columns.to_list())
3388
+
3389
+ dir_excel = d.concat("EXCEL", True)
3390
+ dir_csv = d.concat("CSV", True)
3391
+
3392
+ col_ano = "numano"
3393
+ col_mes = "nummes"
3394
+
3395
+ if cols.contains(col_ano):
3396
+ ano = str(current_data[col_ano].values.tolist()[0])
3397
+
3398
+ dir_excel = dir_excel.concat(ano, True)
3399
+ dir_csv = dir_csv.concat(ano, True)
3400
+
3401
+ if cols.contains(col_mes):
3402
+ mes = str(current_data[col_mes].values.tolist()[0])
3403
+
3404
+ dir_excel = dir_excel.concat(mes, True)
3405
+ dir_csv = dir_csv.concat(mes, True)
3406
+
3407
+ return Set.from_list(
3408
+ [
3409
+ dir_excel.join_file(f"{filename}.xlsx"),
3410
+ dir_csv.join_file(f"{filename}.csv"),
3411
+ ]
3412
+ )
@@ -0,0 +1,28 @@
1
+ from table_stream import Directory, File, Set
2
+ from whatsapp_files import *
3
+ from table_stream import *
4
+ from ocrlib import *
5
+ from cartas import *
6
+ import pandas as pd
7
+
8
+ ufs = UserFileSystem()
9
+ cache_dir = ufs.get_user_downloads().concat("Teste", True)
10
+
11
+
12
+ def main():
13
+ src = File(
14
+ "/home/bruno/Documentos/QGIS/ANALITICO/LV 11 AO 18 ANALITICO ABR 2026.xlsx"
15
+ )
16
+ dest = Directory("/home/bruno/Documentos/QGIS/OUTPUT")
17
+
18
+ reader = DataReader(DataStorage())
19
+ df = reader.read(src)
20
+
21
+ sp = SplitterData("numliv")
22
+ listener = ListenerSplitterQgiz()
23
+ listener.watch(sp)
24
+
25
+ sp.split(df, dest)
26
+
27
+
28
+ main()
@@ -779,7 +779,7 @@ wheels = [
779
779
 
780
780
  [[package]]
781
781
  name = "pyflutter-app"
782
- version = "0.3.5"
782
+ version = "0.3.6"
783
783
  source = { editable = "." }
784
784
  dependencies = [
785
785
  { name = "opencv-python" },
@@ -1,44 +0,0 @@
1
- from whatsapp_files import *
2
- from table_stream import *
3
- from ocrlib import *
4
- from cartas import *
5
- import pandas as pd
6
-
7
- ufs = UserFileSystem()
8
- cache_dir = ufs.get_user_downloads().concat("Teste", True)
9
-
10
- d = Directory(
11
- "/home/bruno/Documentos/RFA/Cartas-TOI/Retorno-de-campo/CARTAS_UC_NAO_IDENTIFICADAS/2026/10/2026-10-24"
12
- )
13
-
14
-
15
- def get_files_teste() -> Set[File]:
16
- content = ContentFiles(d)
17
- files = content.get_images()
18
- files.extend(content.get_pdfs())
19
- return files.to_set()
20
-
21
-
22
- def get_tb_whatsapp_from_hashs(hashs: Set[hashFile]) -> TableData[HeaderWhatsApp]:
23
- tb = ReadWriteWhatsApp().load_table_whatsapp()
24
- final = tb.search_all(HeaderWhatsApp.hash_md5, hashs)
25
-
26
- if final is None:
27
- return BuilderTableWhatsApp().create_void()
28
- return final
29
-
30
-
31
- def main():
32
- f_json = cache_dir.join_file("Teste.json")
33
- f_excel = cache_dir.join_file("Teste.xlsx")
34
-
35
- files: Set[File] = get_files_teste()
36
- t = load_files_toi_v2(files, permitir_parcial=True)
37
-
38
- if t is None:
39
- return
40
- print(f"Salvando: {f_excel}")
41
- t.to_dataframe().to_excel(f_excel.absolute(), index=False)
42
-
43
-
44
- main()
File without changes
File without changes
File without changes
File without changes
File without changes