tablas-python 0.1.5__tar.gz → 0.1.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.
- {tablas_python-0.1.5 → tablas_python-0.1.6}/PKG-INFO +1 -1
- {tablas_python-0.1.5 → tablas_python-0.1.6}/helpers/__init__.py +4 -1
- {tablas_python-0.1.5 → tablas_python-0.1.6}/pyproject.toml +1 -1
- {tablas_python-0.1.5 → tablas_python-0.1.6}/tablas_python/__init__.py +3 -1
- {tablas_python-0.1.5 → tablas_python-0.1.6}/tablas_python.egg-info/PKG-INFO +1 -1
- {tablas_python-0.1.5 → tablas_python-0.1.6}/utils/__init__.py +2 -0
- {tablas_python-0.1.5 → tablas_python-0.1.6}/utils/data_helpers.py +18 -2
- {tablas_python-0.1.5 → tablas_python-0.1.6}/LICENSE +0 -0
- {tablas_python-0.1.5 → tablas_python-0.1.6}/README.md +0 -0
- {tablas_python-0.1.5 → tablas_python-0.1.6}/helpers/display_helper.py +0 -0
- {tablas_python-0.1.5 → tablas_python-0.1.6}/helpers/table_manager.py +0 -0
- {tablas_python-0.1.5 → tablas_python-0.1.6}/setup.cfg +0 -0
- {tablas_python-0.1.5 → tablas_python-0.1.6}/tablas_python/cli.py +0 -0
- {tablas_python-0.1.5 → tablas_python-0.1.6}/tablas_python.egg-info/SOURCES.txt +0 -0
- {tablas_python-0.1.5 → tablas_python-0.1.6}/tablas_python.egg-info/dependency_links.txt +0 -0
- {tablas_python-0.1.5 → tablas_python-0.1.6}/tablas_python.egg-info/entry_points.txt +0 -0
- {tablas_python-0.1.5 → tablas_python-0.1.6}/tablas_python.egg-info/requires.txt +0 -0
- {tablas_python-0.1.5 → tablas_python-0.1.6}/tablas_python.egg-info/top_level.txt +0 -0
- {tablas_python-0.1.5 → tablas_python-0.1.6}/utils/batch_processor.py +0 -0
- {tablas_python-0.1.5 → tablas_python-0.1.6}/utils/excel_extractor.py +0 -0
- {tablas_python-0.1.5 → tablas_python-0.1.6}/utils/excel_writer.py +0 -0
- {tablas_python-0.1.5 → tablas_python-0.1.6}/utils/exporter.py +0 -0
- {tablas_python-0.1.5 → tablas_python-0.1.6}/utils/file_utils.py +0 -0
- {tablas_python-0.1.5 → tablas_python-0.1.6}/utils/pdf_extractor.py +0 -0
- {tablas_python-0.1.5 → tablas_python-0.1.6}/utils/sqlite_extractor.py +0 -0
- {tablas_python-0.1.5 → tablas_python-0.1.6}/utils/table_cleaner.py +0 -0
- {tablas_python-0.1.5 → tablas_python-0.1.6}/utils/validator.py +0 -0
|
@@ -7,7 +7,7 @@ from .display_helper import DisplayHelper, mostrar_tabla
|
|
|
7
7
|
from utils.batch_processor import unir_archivos_carpeta
|
|
8
8
|
from utils.excel_writer import escribir_en_excel
|
|
9
9
|
from utils.validator import validar_dataframe, reporte_calidad, detectar_duplicados
|
|
10
|
-
from utils.data_helpers import buscar_v, conciliar_tablas, obtener_celda, modificar_celda
|
|
10
|
+
from utils.data_helpers import buscar_v, conciliar_tablas, obtener_celda, modificar_celda, formato_clp, formato_porcentaje, formato_moneda
|
|
11
11
|
|
|
12
12
|
__all__ = [
|
|
13
13
|
"TableManager",
|
|
@@ -23,6 +23,9 @@ __all__ = [
|
|
|
23
23
|
"conciliar_tablas",
|
|
24
24
|
"obtener_celda",
|
|
25
25
|
"modificar_celda",
|
|
26
|
+
"formato_clp",
|
|
27
|
+
"formato_porcentaje",
|
|
28
|
+
"formato_moneda",
|
|
26
29
|
"DisplayHelper",
|
|
27
30
|
"mostrar_tabla",
|
|
28
31
|
]
|
|
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
|
|
|
4
4
|
|
|
5
5
|
[project]
|
|
6
6
|
name = "tablas-python"
|
|
7
|
-
version = "0.1.
|
|
7
|
+
version = "0.1.6"
|
|
8
8
|
description = "Suite modular para extraer, transformar, conciliar y exportar tablas desde PDF, Excel y SQLite a pandas."
|
|
9
9
|
readme = "README.md"
|
|
10
10
|
authors = [
|
|
@@ -18,6 +18,7 @@ from utils.data_helpers import (
|
|
|
18
18
|
limpiar_columnas_numericas,
|
|
19
19
|
normalizar_fechas,
|
|
20
20
|
formato_moneda,
|
|
21
|
+
formato_clp,
|
|
21
22
|
formato_porcentaje,
|
|
22
23
|
formato_miles,
|
|
23
24
|
formatear_dataframe,
|
|
@@ -32,7 +33,7 @@ from utils.data_helpers import (
|
|
|
32
33
|
conciliar_tablas,
|
|
33
34
|
)
|
|
34
35
|
|
|
35
|
-
__version__ = "0.1.
|
|
36
|
+
__version__ = "0.1.6"
|
|
36
37
|
|
|
37
38
|
__all__ = [
|
|
38
39
|
"TableManager",
|
|
@@ -54,6 +55,7 @@ __all__ = [
|
|
|
54
55
|
"limpiar_columnas_numericas",
|
|
55
56
|
"normalizar_fechas",
|
|
56
57
|
"formato_moneda",
|
|
58
|
+
"formato_clp",
|
|
57
59
|
"formato_porcentaje",
|
|
58
60
|
"formato_miles",
|
|
59
61
|
"formatear_dataframe",
|
|
@@ -17,6 +17,7 @@ from .data_helpers import (
|
|
|
17
17
|
limpiar_columnas_numericas,
|
|
18
18
|
normalizar_fechas,
|
|
19
19
|
formato_moneda,
|
|
20
|
+
formato_clp,
|
|
20
21
|
formato_porcentaje,
|
|
21
22
|
formato_miles,
|
|
22
23
|
formatear_dataframe,
|
|
@@ -56,6 +57,7 @@ __all__ = [
|
|
|
56
57
|
"limpiar_columnas_numericas",
|
|
57
58
|
"normalizar_fechas",
|
|
58
59
|
"formato_moneda",
|
|
60
|
+
"formato_clp",
|
|
59
61
|
"formato_porcentaje",
|
|
60
62
|
"formato_miles",
|
|
61
63
|
"formatear_dataframe",
|
|
@@ -146,6 +146,18 @@ def formato_moneda(val: Any, simbolo: str = "$", decimales: int = 0, separador_m
|
|
|
146
146
|
return f"{simbolo} {texto}" if simbolo else texto
|
|
147
147
|
|
|
148
148
|
|
|
149
|
+
def formato_clp(val: Any, simbolo: str = "$") -> str:
|
|
150
|
+
"""
|
|
151
|
+
Formatea un número o texto a Pesos Chilenos (CLP) con separador de miles y sin decimales.
|
|
152
|
+
|
|
153
|
+
Ejemplos:
|
|
154
|
+
formato_clp(1500000) -> "$ 1.500.000"
|
|
155
|
+
formato_clp("1500000") -> "$ 1.500.000"
|
|
156
|
+
formato_clp(250000, simbolo="CLP") -> "CLP 250.000"
|
|
157
|
+
"""
|
|
158
|
+
return formato_moneda(val, simbolo=simbolo, decimales=0, separador_miles=".")
|
|
159
|
+
|
|
160
|
+
|
|
149
161
|
def formato_porcentaje(
|
|
150
162
|
val: Any,
|
|
151
163
|
decimales: Optional[int] = None,
|
|
@@ -224,10 +236,14 @@ def formatear_dataframe(
|
|
|
224
236
|
for col, tipo in reglas.items():
|
|
225
237
|
if col not in df_out.columns:
|
|
226
238
|
continue
|
|
227
|
-
if tipo
|
|
228
|
-
df_out[col] = df_out[col].apply(lambda x:
|
|
239
|
+
if tipo in ['moneda', 'clp', 'moneda_clp']:
|
|
240
|
+
df_out[col] = df_out[col].apply(lambda x: formato_clp(x))
|
|
229
241
|
elif tipo == 'moneda_2dec':
|
|
230
242
|
df_out[col] = df_out[col].apply(lambda x: formato_moneda(x, decimales=2))
|
|
243
|
+
elif tipo == 'usd':
|
|
244
|
+
df_out[col] = df_out[col].apply(lambda x: formato_moneda(x, simbolo="USD $", decimales=2, separador_miles=","))
|
|
245
|
+
elif tipo == 'uf':
|
|
246
|
+
df_out[col] = df_out[col].apply(lambda x: formato_moneda(x, simbolo="UF", decimales=2, separador_miles="."))
|
|
231
247
|
elif tipo == 'porcentaje':
|
|
232
248
|
df_out[col] = df_out[col].apply(lambda x: formato_porcentaje(x))
|
|
233
249
|
elif tipo == 'porcentaje_1dec':
|
|
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
|