bbdd-utils 0.3.13__py3-none-any.whl → 0.3.15__py3-none-any.whl

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.
bbdd_utils/utils.py CHANGED
@@ -18,7 +18,9 @@ def Conector_bbdd(tipo='sqlite', nombre='mi_base_de_datos', host='localhost', pu
18
18
  import os
19
19
  nombre_db = f"{nombre}.db"
20
20
  conn = sqlite3.connect(nombre_db)
21
+ print(f"Base de datos SQLite '{nombre_db}' creada exitosamente.")
21
22
  return conn
23
+
22
24
 
23
25
  elif tipo == 'mysql':
24
26
  import mysql.connector
@@ -30,7 +32,7 @@ def Conector_bbdd(tipo='sqlite', nombre='mi_base_de_datos', host='localhost', pu
30
32
  # Crear la base de datos
31
33
  cursor = conn.cursor()
32
34
  cursor.execute(f"CREATE DATABASE IF NOT EXISTS {nombre}")
33
- print(f"Base de datos '{nombre}' creada exitosamente.")
35
+ print(f"Base de datos Mysql '{nombre}' creada exitosamente.")
34
36
  return conn
35
37
 
36
38
  elif tipo == 'mongodb':
@@ -41,7 +43,7 @@ def Conector_bbdd(tipo='sqlite', nombre='mi_base_de_datos', host='localhost', pu
41
43
  port=puerto,
42
44
  username=usuario,
43
45
  password=password)
44
- print("Conectado a MongoDB")
46
+ print(f"Conexión exitosa a MongoDB en {host}:{puerto}.")
45
47
  return cliente[nombre]
46
48
 
47
49
  else:
@@ -66,10 +68,6 @@ def Insert(conn, tabla, data):
66
68
  import mysql.connector
67
69
  from pymongo.database import Database
68
70
 
69
- # Extraer las claves y valores del diccionario
70
- columnas = data.keys()
71
- valores = tuple(data.values())
72
-
73
71
  ############# SQLite ################
74
72
  if isinstance(conn, sqlite3.Connection):
75
73
  print("Conexión exitosa a la base de datos SQL.")
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: bbdd_utils
3
- Version: 0.3.13
3
+ Version: 0.3.15
4
4
  Summary: insertar datos en una base de datos SQL o NoSQL
5
5
  Author: Luis_J_Domingo
6
6
  Description-Content-Type: text/markdown
@@ -0,0 +1,7 @@
1
+ bbdd_utils/__init__.py,sha256=mjRX7GqWkOJq66KqghZ4MZE0Aai6R89LPeu1mjq4lD4,121
2
+ bbdd_utils/utils.py,sha256=jNlSRZDS-Gtu4bDIeAA-U4AJxpnPIr6fGBT8PYSgwlg,5242
3
+ bbdd_utils-0.3.15.dist-info/licenses/LICENSE,sha256=D4uqg6QX0fapLNcdUznOuGaRIUPnypOdeE2zIyYq7xY,217
4
+ bbdd_utils-0.3.15.dist-info/METADATA,sha256=xOKF55KUzE2easD8nhun-58cW65O1KdLGYu41O7OmXY,694
5
+ bbdd_utils-0.3.15.dist-info/WHEEL,sha256=DnLRTWE75wApRYVsjgc6wsVswC54sMSJhAEd4xhDpBk,91
6
+ bbdd_utils-0.3.15.dist-info/top_level.txt,sha256=bBGkVkxnOw7tZ2zRcyCM3lgVgYo1hFbcmwkGdKAj9Gk,11
7
+ bbdd_utils-0.3.15.dist-info/RECORD,,
@@ -1,7 +0,0 @@
1
- bbdd_utils/__init__.py,sha256=mjRX7GqWkOJq66KqghZ4MZE0Aai6R89LPeu1mjq4lD4,121
2
- bbdd_utils/utils.py,sha256=eDco-IZrcw-vgzvAo6r9KMTrQ2YGC4IDRokR5A8yPjc,5244
3
- bbdd_utils-0.3.13.dist-info/licenses/LICENSE,sha256=D4uqg6QX0fapLNcdUznOuGaRIUPnypOdeE2zIyYq7xY,217
4
- bbdd_utils-0.3.13.dist-info/METADATA,sha256=oiJ2Lk6tBq-PWaC-ndrTJiHno-a8fCYFIqq-khqJAjI,694
5
- bbdd_utils-0.3.13.dist-info/WHEEL,sha256=DnLRTWE75wApRYVsjgc6wsVswC54sMSJhAEd4xhDpBk,91
6
- bbdd_utils-0.3.13.dist-info/top_level.txt,sha256=bBGkVkxnOw7tZ2zRcyCM3lgVgYo1hFbcmwkGdKAj9Gk,11
7
- bbdd_utils-0.3.13.dist-info/RECORD,,