Qwael 4.0.4.3__py3-none-any.whl → 4.0.4.6__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.
- Qwael/adbfull.py +66 -23
- {qwael-4.0.4.3.dist-info → qwael-4.0.4.6.dist-info}/METADATA +4 -4
- {qwael-4.0.4.3.dist-info → qwael-4.0.4.6.dist-info}/RECORD +6 -6
- {qwael-4.0.4.3.dist-info → qwael-4.0.4.6.dist-info}/WHEEL +0 -0
- {qwael-4.0.4.3.dist-info → qwael-4.0.4.6.dist-info}/licenses/LICENSE +0 -0
- {qwael-4.0.4.3.dist-info → qwael-4.0.4.6.dist-info}/top_level.txt +0 -0
Qwael/adbfull.py
CHANGED
|
@@ -1,45 +1,88 @@
|
|
|
1
1
|
from supabase import create_client
|
|
2
|
+
import time
|
|
2
3
|
|
|
3
4
|
|
|
4
5
|
class ADB:
|
|
5
|
-
|
|
6
6
|
def __init__(self, url, key):
|
|
7
|
+
self.url = url
|
|
8
|
+
self.key = key
|
|
7
9
|
self.db = create_client(url, key)
|
|
10
|
+
self.oturum = None # kullanıcı session
|
|
8
11
|
|
|
9
|
-
#
|
|
12
|
+
# ================= AUTH =================
|
|
10
13
|
|
|
11
14
|
def a_kayit_ol(self, email, sifre):
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
15
|
+
try:
|
|
16
|
+
return self.db.auth.sign_up({
|
|
17
|
+
"email": email,
|
|
18
|
+
"password": sifre
|
|
19
|
+
})
|
|
20
|
+
except Exception as e:
|
|
21
|
+
print("Kayıt hatası:", e)
|
|
22
|
+
return None
|
|
16
23
|
|
|
17
24
|
def a_giris_yap(self, email, sifre):
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
25
|
+
try:
|
|
26
|
+
sonuc = self.db.auth.sign_in_with_password({
|
|
27
|
+
"email": email,
|
|
28
|
+
"password": sifre
|
|
29
|
+
})
|
|
30
|
+
|
|
31
|
+
self.oturum = sonuc.session # session sakla
|
|
32
|
+
return sonuc.user.id # uid döndür
|
|
33
|
+
|
|
34
|
+
except Exception as e:
|
|
35
|
+
print("Giriş hatası:", e)
|
|
36
|
+
return None
|
|
37
|
+
|
|
38
|
+
# Oturum düşerse yenile
|
|
39
|
+
def _kontrol_et(self):
|
|
40
|
+
try:
|
|
41
|
+
if self.oturum:
|
|
42
|
+
self.db.auth.set_session(
|
|
43
|
+
self.oturum.access_token,
|
|
44
|
+
self.oturum.refresh_token
|
|
45
|
+
)
|
|
46
|
+
except:
|
|
47
|
+
pass
|
|
23
48
|
|
|
24
|
-
#
|
|
49
|
+
# ================= TABLO =================
|
|
25
50
|
|
|
26
51
|
def add(self, tablo, uid, **veriler):
|
|
27
52
|
"""
|
|
28
53
|
Örnek:
|
|
29
54
|
add("users_data", uid, username="Ali Kaya", skor=34)
|
|
30
55
|
"""
|
|
31
|
-
|
|
32
|
-
|
|
56
|
+
self._kontrol_et()
|
|
57
|
+
|
|
58
|
+
try:
|
|
59
|
+
veriler["user_id"] = uid
|
|
60
|
+
return self.db.table(tablo).insert(veriler).execute()
|
|
61
|
+
except Exception as e:
|
|
62
|
+
print("Veri ekleme hatası:", e)
|
|
63
|
+
return None
|
|
33
64
|
|
|
34
65
|
def get(self, tablo, uid):
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
.
|
|
39
|
-
|
|
66
|
+
self._kontrol_et()
|
|
67
|
+
|
|
68
|
+
try:
|
|
69
|
+
return self.db.table(tablo) \
|
|
70
|
+
.select("*") \
|
|
71
|
+
.eq("user_id", uid) \
|
|
72
|
+
.single() \
|
|
73
|
+
.execute().data
|
|
74
|
+
except Exception as e:
|
|
75
|
+
print("Veri alma hatası:", e)
|
|
76
|
+
return None
|
|
40
77
|
|
|
41
78
|
def update(self, tablo, uid, **veriler):
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
.
|
|
79
|
+
self._kontrol_et()
|
|
80
|
+
|
|
81
|
+
try:
|
|
82
|
+
return self.db.table(tablo) \
|
|
83
|
+
.update(veriler) \
|
|
84
|
+
.eq("user_id", uid) \
|
|
85
|
+
.execute()
|
|
86
|
+
except Exception as e:
|
|
87
|
+
print("Güncelleme hatası:", e)
|
|
88
|
+
return None
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: Qwael
|
|
3
|
-
Version: 4.0.4.
|
|
3
|
+
Version: 4.0.4.6
|
|
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
|
|
@@ -23,9 +23,9 @@ Requires-Dist: Pillow
|
|
|
23
23
|
Requires-Dist: flask
|
|
24
24
|
Requires-Dist: pyyaml
|
|
25
25
|
Requires-Dist: requests
|
|
26
|
-
Requires-Dist: supabase
|
|
27
|
-
Requires-Dist: httpx
|
|
28
|
-
Requires-Dist: pydantic
|
|
26
|
+
Requires-Dist: supabase<3
|
|
27
|
+
Requires-Dist: httpx<0.28
|
|
28
|
+
Requires-Dist: pydantic<2
|
|
29
29
|
Dynamic: author
|
|
30
30
|
Dynamic: author-email
|
|
31
31
|
Dynamic: classifier
|
|
@@ -4,11 +4,11 @@ Qwael/EasyWeb.py,sha256=78XBEIuHjUm0j-TOPsN0sy0iXl8UywKAi0dNn-evWSY,1283
|
|
|
4
4
|
Qwael/MultiDB.py,sha256=glptDsH22TyklZrA_ywStnsT6bGnq7JsSR5NN_U1NII,17286
|
|
5
5
|
Qwael/Multidata.py,sha256=YBofvzcuT-F8RIljw3Z1tr3Qn7VbhXjfrY6BuGNPYw0,9496
|
|
6
6
|
Qwael/__init__.py,sha256=80N86isqJ_EhDy0-wlUe6BFO1CpJvb61wYgt14b4bEM,230
|
|
7
|
-
Qwael/adbfull.py,sha256=
|
|
7
|
+
Qwael/adbfull.py,sha256=2OFxvTUa2p9QWrBNniPzHtJsdHy2q0a-jPYGnWLqg7s,2349
|
|
8
8
|
Qwael/filesz.py,sha256=6XZ1GKzXcVs7uKAirImbBuZYGrRL_-WOtiOOYOdp_nU,2501
|
|
9
9
|
Qwael/pgif.py,sha256=stiVsn1DAJyHNsAHUWaWXdGiouQ2ZeRehn_WC30SK1A,1242
|
|
10
|
-
qwael-4.0.4.
|
|
11
|
-
qwael-4.0.4.
|
|
12
|
-
qwael-4.0.4.
|
|
13
|
-
qwael-4.0.4.
|
|
14
|
-
qwael-4.0.4.
|
|
10
|
+
qwael-4.0.4.6.dist-info/licenses/LICENSE,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
11
|
+
qwael-4.0.4.6.dist-info/METADATA,sha256=iQLYOQMQxY4uT-_Wa9czCTIA4Cxx7NiDNTbq-ggR5kk,2399
|
|
12
|
+
qwael-4.0.4.6.dist-info/WHEEL,sha256=wUyA8OaulRlbfwMtmQsvNngGrxQHAvkKcvRmdizlJi0,92
|
|
13
|
+
qwael-4.0.4.6.dist-info/top_level.txt,sha256=UtaXY8Mui4lwYNkGrplHcEVe8PjH553OT1Xu5V9bhg0,6
|
|
14
|
+
qwael-4.0.4.6.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|