Qwael 3.9.2__tar.gz → 3.9.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.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: Qwael
3
- Version: 3.9.2
3
+ Version: 3.9.3
4
4
  Summary: Qwael: İşlevsel ve kolaylaştırılmış Python kütüphanesi
5
5
  Author: Bedirhan
6
6
  Author-email: bedirhan.oytpass@gmail.com
@@ -110,7 +110,6 @@ class MultiDB:
110
110
  return False
111
111
 
112
112
  if r == "small":
113
- # small kuralı artık tüm value için geçerli (domain dahil)
114
113
  if not all(ch.islower() or ch.isdigit() or ch in "@." for ch in value):
115
114
  return False
116
115
 
@@ -125,7 +124,7 @@ class MultiDB:
125
124
  return True
126
125
 
127
126
  # -----------------------------
128
- # GIVE (True/False destekli)
127
+ # GIVE
129
128
  # -----------------------------
130
129
  def give(self, table, values, output_list=None):
131
130
  try:
@@ -201,7 +200,7 @@ class MultiDB:
201
200
  return result
202
201
 
203
202
  # -----------------------------
204
- # CLEAR DATA (Keep structure)
203
+ # CLEAR DATA
205
204
  # -----------------------------
206
205
  def clear_full(self, table):
207
206
  self._lock()
@@ -322,4 +321,77 @@ class MultiDB:
322
321
  else:
323
322
  output_list.append(found)
324
323
 
325
- return found
324
+ return found
325
+
326
+ # -----------------------------
327
+ # FIND (koşula göre ID döndürür)
328
+ # -----------------------------
329
+ def find(self, table, conditions: dict, output_list=None):
330
+ lines = self._read()
331
+ tpos = self._find_table(lines, table)
332
+ if tpos == -1:
333
+ raise ValueError("Tablo bulunamadı!")
334
+
335
+ col_names = json.loads(lines[tpos + 1])
336
+ col_indexes = {k: col_names.index(k) for k in conditions}
337
+
338
+ found_id = None
339
+
340
+ idx = tpos + 3
341
+ while idx < len(lines) and not lines[idx].startswith("[TABLE"):
342
+ row = json.loads(lines[idx])
343
+ match = True
344
+ for key, val in conditions.items():
345
+ if row[col_indexes[key]] != val:
346
+ match = False
347
+ break
348
+
349
+ if match:
350
+ found_id = row[0]
351
+ break
352
+
353
+ idx += 1
354
+
355
+ if output_list is not None:
356
+ output_list.append(found_id)
357
+
358
+ return found_id
359
+
360
+ # -----------------------------
361
+ # PULL (ID’ye göre belirli sütun verisi getir)
362
+ # -----------------------------
363
+ def pull(self, row_id, columns: dict, output_list=None):
364
+ lines = self._read()
365
+
366
+ # Çekilecek sütun adı
367
+ col_name = list(columns.keys())[0]
368
+
369
+ # Tabloları tek tek kontrol ederek bu sütun hangi tabloda öğren
370
+ tpos = -1
371
+ for i, line in enumerate(lines):
372
+ if line.startswith("[TABLE"):
373
+ col_names = json.loads(lines[i + 1])
374
+ if col_name in col_names:
375
+ tpos = i
376
+ break
377
+
378
+ if tpos == -1:
379
+ raise ValueError("Bu sütun hiçbir tabloda bulunamadı!")
380
+
381
+ col_index = col_names.index(col_name)
382
+
383
+ # Satırı ID'ye göre bul
384
+ idx = tpos + 3
385
+ found_value = None
386
+
387
+ while idx < len(lines) and not lines[idx].startswith("[TABLE"):
388
+ row = json.loads(lines[idx])
389
+ if row[0] == str(row_id):
390
+ found_value = row[col_index]
391
+ break
392
+ idx += 1
393
+
394
+ if output_list is not None:
395
+ output_list.append(found_value)
396
+
397
+ return found_value
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: Qwael
3
- Version: 3.9.2
3
+ Version: 3.9.3
4
4
  Summary: Qwael: İşlevsel ve kolaylaştırılmış Python kütüphanesi
5
5
  Author: Bedirhan
6
6
  Author-email: bedirhan.oytpass@gmail.com
@@ -5,7 +5,7 @@ with open("README.md", "r", encoding="utf-8") as f:
5
5
 
6
6
  setup(
7
7
  name="Qwael",
8
- version="3.9.2",
8
+ version="3.9.3",
9
9
  packages=find_packages(),
10
10
  install_requires=[
11
11
  "google-api-python-client",
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