libretificacaotjcore 0.1.6__tar.gz → 0.1.7__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.
Potentially problematic release.
This version of libretificacaotjcore might be problematic. Click here for more details.
- {libretificacaotjcore-0.1.6 → libretificacaotjcore-0.1.7}/PKG-INFO +2 -1
- libretificacaotjcore-0.1.7/libretificacaotjcore/services/file_service.py +53 -0
- {libretificacaotjcore-0.1.6 → libretificacaotjcore-0.1.7}/libretificacaotjcore.egg-info/PKG-INFO +2 -1
- {libretificacaotjcore-0.1.6 → libretificacaotjcore-0.1.7}/libretificacaotjcore.egg-info/SOURCES.txt +1 -0
- {libretificacaotjcore-0.1.6 → libretificacaotjcore-0.1.7}/libretificacaotjcore.egg-info/requires.txt +1 -0
- {libretificacaotjcore-0.1.6 → libretificacaotjcore-0.1.7}/pyproject.toml +2 -1
- {libretificacaotjcore-0.1.6 → libretificacaotjcore-0.1.7}/README.md +0 -0
- {libretificacaotjcore-0.1.6 → libretificacaotjcore-0.1.7}/libretificacaotjcore/__init__.py +0 -0
- {libretificacaotjcore-0.1.6 → libretificacaotjcore-0.1.7}/libretificacaotjcore/database/__init__.py +0 -0
- {libretificacaotjcore-0.1.6 → libretificacaotjcore-0.1.7}/libretificacaotjcore/database/arquivo_repository.py +0 -0
- {libretificacaotjcore-0.1.6 → libretificacaotjcore-0.1.7}/libretificacaotjcore/database/config_db.py +0 -0
- {libretificacaotjcore-0.1.6 → libretificacaotjcore-0.1.7}/libretificacaotjcore/dtos/solicitacao_dto.py +0 -0
- {libretificacaotjcore-0.1.6 → libretificacaotjcore-0.1.7}/libretificacaotjcore/services/__init__.py +0 -0
- {libretificacaotjcore-0.1.6 → libretificacaotjcore-0.1.7}/libretificacaotjcore/services/rabbitmq_consumer.py +0 -0
- {libretificacaotjcore-0.1.6 → libretificacaotjcore-0.1.7}/libretificacaotjcore/services/s3_service.py +0 -0
- {libretificacaotjcore-0.1.6 → libretificacaotjcore-0.1.7}/libretificacaotjcore.egg-info/dependency_links.txt +0 -0
- {libretificacaotjcore-0.1.6 → libretificacaotjcore-0.1.7}/libretificacaotjcore.egg-info/top_level.txt +0 -0
- {libretificacaotjcore-0.1.6 → libretificacaotjcore-0.1.7}/setup.cfg +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: libretificacaotjcore
|
|
3
|
-
Version: 0.1.
|
|
3
|
+
Version: 0.1.7
|
|
4
4
|
Summary: Biblioteca para centralizar conexao com filas no rabbit e banco de dados no mongodb para os servicos de retificacao da TJ
|
|
5
5
|
Author-email: Jhonatan Azevedo <dev.azevedo@outlook.com>
|
|
6
6
|
Project-URL: Homepage, https://github.com/seu-usuario/libretificacaotjcore
|
|
@@ -21,6 +21,7 @@ Classifier: Programming Language :: Python :: 3.13
|
|
|
21
21
|
Classifier: Operating System :: OS Independent
|
|
22
22
|
Requires-Python: >=3.12
|
|
23
23
|
Description-Content-Type: text/markdown
|
|
24
|
+
Requires-Dist: aiofiles>=24.1.0
|
|
24
25
|
Requires-Dist: boto3>=1.39.16
|
|
25
26
|
Requires-Dist: motor>=3.7.1
|
|
26
27
|
Requires-Dist: pika>=1.3.2
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import asyncio
|
|
2
|
+
from io import BytesIO
|
|
3
|
+
import os
|
|
4
|
+
import shutil
|
|
5
|
+
import zipfile
|
|
6
|
+
from pathlib import Path
|
|
7
|
+
import aiofiles
|
|
8
|
+
import aiofiles.os
|
|
9
|
+
|
|
10
|
+
class FileService:
|
|
11
|
+
async def zip_folder(self, folder_path: str, output_path: str):
|
|
12
|
+
buffer = BytesIO()
|
|
13
|
+
|
|
14
|
+
with zipfile.ZipFile(buffer, "w", zipfile.ZIP_DEFLATED) as zip_file:
|
|
15
|
+
for root, _, files in os.walk(folder_path):
|
|
16
|
+
for file in files:
|
|
17
|
+
full_path = os.path.join(root, file)
|
|
18
|
+
arcname = os.path.relpath(full_path, folder_path)
|
|
19
|
+
|
|
20
|
+
async with aiofiles.open(full_path, "rb") as f:
|
|
21
|
+
content = await f.read()
|
|
22
|
+
zip_file.writestr(arcname, content)
|
|
23
|
+
|
|
24
|
+
async with aiofiles.open(output_path, "wb") as f:
|
|
25
|
+
await f.write(buffer.getvalue())
|
|
26
|
+
|
|
27
|
+
|
|
28
|
+
async def extract_zip(self, folder_path_zip: str, output_path: str):
|
|
29
|
+
if not await aiofiles.os.path.exists(folder_path_zip):
|
|
30
|
+
raise FileNotFoundError(
|
|
31
|
+
f"Arquivo ZIP não encontrado: {folder_path_zip}"
|
|
32
|
+
)
|
|
33
|
+
|
|
34
|
+
if not await aiofiles.os.path.exists(output_path):
|
|
35
|
+
await aiofiles.os.makedirs(output_path, exist_ok=True)
|
|
36
|
+
|
|
37
|
+
loop = asyncio.get_event_loop()
|
|
38
|
+
await loop.run_in_executor(
|
|
39
|
+
None, self._extrair_zip, folder_path_zip, output_path
|
|
40
|
+
)
|
|
41
|
+
|
|
42
|
+
async def remove_file(self, file_path: str):
|
|
43
|
+
if await aiofiles.os.path.exists(file_path):
|
|
44
|
+
await aiofiles.os.remove(file_path)
|
|
45
|
+
|
|
46
|
+
async def remove_folder(self, folder_path: str):
|
|
47
|
+
if await aiofiles.os.path.exists(folder_path):
|
|
48
|
+
loop = asyncio.get_running_loop()
|
|
49
|
+
await loop.run_in_executor(None, shutil.rmtree, folder_path)
|
|
50
|
+
|
|
51
|
+
def _extrair_zip(self, folder_path_zip: str, output_path: str):
|
|
52
|
+
with zipfile.ZipFile(folder_path_zip, "r") as zip_ref:
|
|
53
|
+
zip_ref.extractall(output_path)
|
{libretificacaotjcore-0.1.6 → libretificacaotjcore-0.1.7}/libretificacaotjcore.egg-info/PKG-INFO
RENAMED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: libretificacaotjcore
|
|
3
|
-
Version: 0.1.
|
|
3
|
+
Version: 0.1.7
|
|
4
4
|
Summary: Biblioteca para centralizar conexao com filas no rabbit e banco de dados no mongodb para os servicos de retificacao da TJ
|
|
5
5
|
Author-email: Jhonatan Azevedo <dev.azevedo@outlook.com>
|
|
6
6
|
Project-URL: Homepage, https://github.com/seu-usuario/libretificacaotjcore
|
|
@@ -21,6 +21,7 @@ Classifier: Programming Language :: Python :: 3.13
|
|
|
21
21
|
Classifier: Operating System :: OS Independent
|
|
22
22
|
Requires-Python: >=3.12
|
|
23
23
|
Description-Content-Type: text/markdown
|
|
24
|
+
Requires-Dist: aiofiles>=24.1.0
|
|
24
25
|
Requires-Dist: boto3>=1.39.16
|
|
25
26
|
Requires-Dist: motor>=3.7.1
|
|
26
27
|
Requires-Dist: pika>=1.3.2
|
{libretificacaotjcore-0.1.6 → libretificacaotjcore-0.1.7}/libretificacaotjcore.egg-info/SOURCES.txt
RENAMED
|
@@ -11,5 +11,6 @@ libretificacaotjcore/database/arquivo_repository.py
|
|
|
11
11
|
libretificacaotjcore/database/config_db.py
|
|
12
12
|
libretificacaotjcore/dtos/solicitacao_dto.py
|
|
13
13
|
libretificacaotjcore/services/__init__.py
|
|
14
|
+
libretificacaotjcore/services/file_service.py
|
|
14
15
|
libretificacaotjcore/services/rabbitmq_consumer.py
|
|
15
16
|
libretificacaotjcore/services/s3_service.py
|
|
@@ -11,7 +11,7 @@ keywords = ["tj", "tributo justo", "retificação", "automação", "pydantic", "
|
|
|
11
11
|
name = "libretificacaotjcore"
|
|
12
12
|
readme = "README.md"
|
|
13
13
|
requires-python = ">=3.12"
|
|
14
|
-
version = "0.1.
|
|
14
|
+
version = "0.1.7"
|
|
15
15
|
|
|
16
16
|
classifiers = [
|
|
17
17
|
"Development Status :: 3 - Alpha",
|
|
@@ -29,6 +29,7 @@ classifiers = [
|
|
|
29
29
|
]
|
|
30
30
|
|
|
31
31
|
dependencies = [
|
|
32
|
+
"aiofiles>=24.1.0",
|
|
32
33
|
"boto3>=1.39.16",
|
|
33
34
|
"motor>=3.7.1",
|
|
34
35
|
"pika>=1.3.2",
|
|
File without changes
|
|
File without changes
|
{libretificacaotjcore-0.1.6 → libretificacaotjcore-0.1.7}/libretificacaotjcore/database/__init__.py
RENAMED
|
File without changes
|
|
File without changes
|
{libretificacaotjcore-0.1.6 → libretificacaotjcore-0.1.7}/libretificacaotjcore/database/config_db.py
RENAMED
|
File without changes
|
|
File without changes
|
{libretificacaotjcore-0.1.6 → libretificacaotjcore-0.1.7}/libretificacaotjcore/services/__init__.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|