Qwael 0.1.3__tar.gz → 3.1.0__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.
- qwael-3.1.0/LICENSE +0 -0
- qwael-3.1.0/PKG-INFO +94 -0
- qwael-3.1.0/Qwael/DR/304/260VE.py +396 -0
- qwael-3.1.0/Qwael/__init__.py +5 -0
- qwael-3.1.0/Qwael.egg-info/PKG-INFO +94 -0
- {Qwael-0.1.3 → qwael-3.1.0}/Qwael.egg-info/SOURCES.txt +1 -2
- {Qwael-0.1.3 → qwael-3.1.0}/Qwael.egg-info/requires.txt +2 -3
- qwael-3.1.0/README.md +61 -0
- {Qwael-0.1.3 → qwael-3.1.0}/setup.cfg +4 -4
- qwael-3.1.0/setup.py +33 -0
- Qwael-0.1.3/LICENSE +0 -25
- Qwael-0.1.3/PKG-INFO +0 -33
- Qwael-0.1.3/Qwael/DR/304/260VE_OPEN.py +0 -376
- Qwael-0.1.3/Qwael/Easy_app.py +0 -25
- Qwael-0.1.3/Qwael/__init__.py +0 -2
- Qwael-0.1.3/Qwael.egg-info/PKG-INFO +0 -33
- Qwael-0.1.3/README.md +0 -18
- Qwael-0.1.3/setup.py +0 -30
- {Qwael-0.1.3 → qwael-3.1.0}/Qwael.egg-info/dependency_links.txt +0 -0
- {Qwael-0.1.3 → qwael-3.1.0}/Qwael.egg-info/top_level.txt +0 -0
qwael-3.1.0/LICENSE
ADDED
|
File without changes
|
qwael-3.1.0/PKG-INFO
ADDED
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: Qwael
|
|
3
|
+
Version: 3.1.0
|
|
4
|
+
Summary: Qwael: İşlevsel ve kolaylaştırılmış Python kütüphanesi
|
|
5
|
+
Author: Bedirhan
|
|
6
|
+
Author-email: bedirhan.oytpass@gmail.com
|
|
7
|
+
License: MIT
|
|
8
|
+
Keywords: Kolay kod,drive,basitleştirilmiş
|
|
9
|
+
Classifier: License :: OSI Approved :: MIT License
|
|
10
|
+
Classifier: Programming Language :: Python :: 3
|
|
11
|
+
Classifier: Programming Language :: Python :: 3.6
|
|
12
|
+
Classifier: Programming Language :: Python :: 3.7
|
|
13
|
+
Classifier: Programming Language :: Python :: 3.8
|
|
14
|
+
Classifier: Programming Language :: Python :: 3.9
|
|
15
|
+
Classifier: Programming Language :: Python :: 3.10
|
|
16
|
+
Description-Content-Type: text/markdown
|
|
17
|
+
License-File: LICENSE
|
|
18
|
+
Requires-Dist: google-api-python-client
|
|
19
|
+
Requires-Dist: google-auth
|
|
20
|
+
Requires-Dist: google-auth-oauthlib
|
|
21
|
+
Requires-Dist: google-auth-httplib2
|
|
22
|
+
Requires-Dist: Pillow
|
|
23
|
+
Dynamic: author
|
|
24
|
+
Dynamic: author-email
|
|
25
|
+
Dynamic: classifier
|
|
26
|
+
Dynamic: description
|
|
27
|
+
Dynamic: description-content-type
|
|
28
|
+
Dynamic: keywords
|
|
29
|
+
Dynamic: license
|
|
30
|
+
Dynamic: license-file
|
|
31
|
+
Dynamic: requires-dist
|
|
32
|
+
Dynamic: summary
|
|
33
|
+
|
|
34
|
+
# Qwael
|
|
35
|
+
|
|
36
|
+
Qwael, Google Drive üzerinde veri yönetimini kolaylaştıran ve basit işlevleri Python ile hızlıca kullanmanıza olanak sağlayan bir kütüphanedir.
|
|
37
|
+
Başlık ekleme, veri ekleme, silme, okuma ve kontrol etme gibi işlemleri tek satırda yapabilirsiniz.
|
|
38
|
+
|
|
39
|
+
## Kullanım
|
|
40
|
+
|
|
41
|
+
- Info
|
|
42
|
+
|
|
43
|
+
DRİVE.info()
|
|
44
|
+
|
|
45
|
+
- Control
|
|
46
|
+
|
|
47
|
+
DRİVE.Control(
|
|
48
|
+
ID="dosya adı",
|
|
49
|
+
ge="kontrol etmek istediğin metin",
|
|
50
|
+
dax="başlık",
|
|
51
|
+
dex_ID="metin başlığı"
|
|
52
|
+
fop="onay değişkeni",
|
|
53
|
+
es="drive hesap bilgileri",
|
|
54
|
+
os="drive klasör id'si"
|
|
55
|
+
)
|
|
56
|
+
|
|
57
|
+
- give
|
|
58
|
+
|
|
59
|
+
DRİVE.give(
|
|
60
|
+
dex="eklemek istediğin metin",
|
|
61
|
+
dax="başlık",
|
|
62
|
+
dex_ID="metin başlığı",
|
|
63
|
+
fop="onay değişkeni",
|
|
64
|
+
es="drive hesap bilgileri",
|
|
65
|
+
os="drive klasör id'si"
|
|
66
|
+
)
|
|
67
|
+
|
|
68
|
+
- get
|
|
69
|
+
|
|
70
|
+
DRİVE.get(
|
|
71
|
+
ID="dosya adı",
|
|
72
|
+
Hup=("çekmek istediğin metinin olduğu başlığı","çekmek istediğin metin başlığı"),
|
|
73
|
+
go="çekilen metinin ekleneceği değişken",
|
|
74
|
+
es="drive hesap bilgileri",
|
|
75
|
+
os="drive klasör id'si"
|
|
76
|
+
)
|
|
77
|
+
|
|
78
|
+
- delete
|
|
79
|
+
|
|
80
|
+
DRİVE.delete(
|
|
81
|
+
ID="dosya adı",
|
|
82
|
+
delete_header="silmek istediğin başlık",
|
|
83
|
+
fop="Öney değişkeni",
|
|
84
|
+
es="drive hesap bilgileri",
|
|
85
|
+
os="drive klasör id'si"
|
|
86
|
+
)
|
|
87
|
+
|
|
88
|
+
|
|
89
|
+
|
|
90
|
+
|
|
91
|
+
### 🚀 Kurulum
|
|
92
|
+
|
|
93
|
+
```bash
|
|
94
|
+
pip install Qwael
|
|
@@ -0,0 +1,396 @@
|
|
|
1
|
+
import tkinter as tk
|
|
2
|
+
from google.oauth2 import service_account
|
|
3
|
+
from googleapiclient.discovery import build
|
|
4
|
+
from googleapiclient.http import MediaIoBaseDownload, MediaFileUpload, MediaIoBaseUpload
|
|
5
|
+
from PIL import Image, ImageTk
|
|
6
|
+
import io
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
def info():
|
|
10
|
+
infoc = "Prihops: Sürüm 1.01"
|
|
11
|
+
print(infoc)
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
def Control(ID, ge, dax=None, fop=None, es=None, os=None, girp=None, girpx=None, girp_header=None, girpx_header=None, dex_ID=None):
|
|
15
|
+
import io
|
|
16
|
+
from google.oauth2 import service_account
|
|
17
|
+
from googleapiclient.discovery import build
|
|
18
|
+
from googleapiclient.http import MediaIoBaseDownload
|
|
19
|
+
|
|
20
|
+
creds = service_account.Credentials.from_service_account_info(es)
|
|
21
|
+
service = build('drive', 'v3', credentials=creds)
|
|
22
|
+
|
|
23
|
+
query = f"'{os}' in parents and name='{ID}'"
|
|
24
|
+
results = service.files().list(q=query, fields="files(id)").execute()
|
|
25
|
+
files = results.get('files', [])
|
|
26
|
+
|
|
27
|
+
if not files:
|
|
28
|
+
print(f"{ID} dosyası bulunamadı.")
|
|
29
|
+
if isinstance(fop, list):
|
|
30
|
+
fop.append(False)
|
|
31
|
+
return
|
|
32
|
+
|
|
33
|
+
file_id = files[0]['id']
|
|
34
|
+
request = service.files().get_media(fileId=file_id)
|
|
35
|
+
file_io = io.BytesIO()
|
|
36
|
+
downloader = MediaIoBaseDownload(file_io, request)
|
|
37
|
+
done = False
|
|
38
|
+
while not done:
|
|
39
|
+
_, done = downloader.next_chunk()
|
|
40
|
+
|
|
41
|
+
content = file_io.getvalue().decode('utf-8')
|
|
42
|
+
lines = content.strip().split('\n')
|
|
43
|
+
|
|
44
|
+
# Veriyi işleme
|
|
45
|
+
real_ge = ge
|
|
46
|
+
if girpx and not real_ge.startswith(girpx):
|
|
47
|
+
real_ge = girpx + real_ge
|
|
48
|
+
if girp and not real_ge.endswith(girp):
|
|
49
|
+
real_ge = real_ge + girp
|
|
50
|
+
if dex_ID:
|
|
51
|
+
real_ge = f"{dex_ID}; {real_ge}"
|
|
52
|
+
|
|
53
|
+
# Başlığı işleme
|
|
54
|
+
real_dax = dax
|
|
55
|
+
if girpx_header and real_dax and not real_dax.startswith(girpx_header):
|
|
56
|
+
real_dax = girpx_header + real_dax
|
|
57
|
+
if girp_header and real_dax and not real_dax.endswith(girp_header):
|
|
58
|
+
real_dax = real_dax + girp_header
|
|
59
|
+
|
|
60
|
+
current_header = None
|
|
61
|
+
in_target_header = False
|
|
62
|
+
|
|
63
|
+
for line in lines:
|
|
64
|
+
stripped = line.strip()
|
|
65
|
+
if stripped.endswith(':'):
|
|
66
|
+
current_header = stripped[:-1]
|
|
67
|
+
in_target_header = (current_header == real_dax) if real_dax else True
|
|
68
|
+
elif in_target_header:
|
|
69
|
+
if stripped == real_ge:
|
|
70
|
+
print(f"Veri '{real_ge}' başlık '{current_header}' içinde bulundu.")
|
|
71
|
+
if isinstance(fop, list):
|
|
72
|
+
fop.append(True)
|
|
73
|
+
return
|
|
74
|
+
|
|
75
|
+
if dax:
|
|
76
|
+
print(f"Veri '{real_ge}' başlık '{real_dax}' içinde bulunamadı.")
|
|
77
|
+
else:
|
|
78
|
+
print(f"Veri '{real_ge}' hiçbir başlık altında bulunamadı.")
|
|
79
|
+
if isinstance(fop, list):
|
|
80
|
+
fop.append(False)
|
|
81
|
+
|
|
82
|
+
def delete(ID, delete_header=None, dex_ID=None, fop=None, es=None, os=None):
|
|
83
|
+
import io
|
|
84
|
+
from google.oauth2 import service_account
|
|
85
|
+
from googleapiclient.discovery import build
|
|
86
|
+
from googleapiclient.http import MediaIoBaseDownload, MediaIoBaseUpload
|
|
87
|
+
|
|
88
|
+
creds = service_account.Credentials.from_service_account_info(es)
|
|
89
|
+
service = build('drive', 'v3', credentials=creds)
|
|
90
|
+
|
|
91
|
+
query = f"'{os}' in parents and name='{ID}'"
|
|
92
|
+
results = service.files().list(q=query, fields="files(id)").execute()
|
|
93
|
+
files = results.get('files', [])
|
|
94
|
+
|
|
95
|
+
if not files:
|
|
96
|
+
print(f"{ID} dosyası bulunamadı.")
|
|
97
|
+
if isinstance(fop, list):
|
|
98
|
+
fop.append(False)
|
|
99
|
+
return
|
|
100
|
+
|
|
101
|
+
file_id = files[0]['id']
|
|
102
|
+
|
|
103
|
+
request = service.files().get_media(fileId=file_id)
|
|
104
|
+
file_io = io.BytesIO()
|
|
105
|
+
downloader = MediaIoBaseDownload(file_io, request)
|
|
106
|
+
done = False
|
|
107
|
+
while not done:
|
|
108
|
+
_, done = downloader.next_chunk()
|
|
109
|
+
content = file_io.getvalue().decode('utf-8')
|
|
110
|
+
|
|
111
|
+
lines = content.strip().split('\n')
|
|
112
|
+
new_lines = []
|
|
113
|
+
skip = False
|
|
114
|
+
found = False
|
|
115
|
+
|
|
116
|
+
if delete_header:
|
|
117
|
+
# Klasik başlık silme modu
|
|
118
|
+
for line in lines:
|
|
119
|
+
if line.strip().endswith(':'):
|
|
120
|
+
if line.strip()[:-1] == delete_header:
|
|
121
|
+
skip = True
|
|
122
|
+
found = True
|
|
123
|
+
continue
|
|
124
|
+
else:
|
|
125
|
+
skip = False
|
|
126
|
+
if not skip:
|
|
127
|
+
new_lines.append(line)
|
|
128
|
+
|
|
129
|
+
if not found:
|
|
130
|
+
print(f"'{delete_header}' başlığı bulunamadı.")
|
|
131
|
+
if isinstance(fop, list):
|
|
132
|
+
fop.append(False)
|
|
133
|
+
return
|
|
134
|
+
else:
|
|
135
|
+
print(f"'{delete_header}' başlığı ve altındaki veriler silindi.")
|
|
136
|
+
|
|
137
|
+
elif dex_ID:
|
|
138
|
+
# Belirli başlık altındaki bir veriyi silme modu
|
|
139
|
+
target_header = dex_ID[0]
|
|
140
|
+
target_data = dex_ID[1]
|
|
141
|
+
in_target_header = False
|
|
142
|
+
header_found = False
|
|
143
|
+
data_found = False
|
|
144
|
+
|
|
145
|
+
for i, line in enumerate(lines):
|
|
146
|
+
stripped = line.strip()
|
|
147
|
+
if stripped.endswith(':'):
|
|
148
|
+
if stripped[:-1] == target_header:
|
|
149
|
+
in_target_header = True
|
|
150
|
+
header_found = True
|
|
151
|
+
new_lines.append(line)
|
|
152
|
+
continue
|
|
153
|
+
else:
|
|
154
|
+
in_target_header = False
|
|
155
|
+
|
|
156
|
+
if in_target_header:
|
|
157
|
+
if stripped.startswith(f"{target_data};"):
|
|
158
|
+
data_found = True
|
|
159
|
+
continue # bu satırı atlıyoruz (siliyoruz)
|
|
160
|
+
else:
|
|
161
|
+
new_lines.append(line)
|
|
162
|
+
else:
|
|
163
|
+
new_lines.append(line)
|
|
164
|
+
|
|
165
|
+
if not header_found:
|
|
166
|
+
print(f"'{target_header}' başlığı bulunamadı.")
|
|
167
|
+
if isinstance(fop, list):
|
|
168
|
+
fop.append(False)
|
|
169
|
+
return
|
|
170
|
+
if not data_found:
|
|
171
|
+
print(f"'{target_data}' verisi bulunamadı.")
|
|
172
|
+
if isinstance(fop, list):
|
|
173
|
+
fop.append(False)
|
|
174
|
+
return
|
|
175
|
+
else:
|
|
176
|
+
print(f"'{target_header}' başlığı altındaki '{target_data}' verisi silindi.")
|
|
177
|
+
|
|
178
|
+
else:
|
|
179
|
+
print("Hiçbir işlem yapılmadı. 'delete_header' veya 'dex_ID' parametresi girilmelidir.")
|
|
180
|
+
if isinstance(fop, list):
|
|
181
|
+
fop.append(False)
|
|
182
|
+
return
|
|
183
|
+
|
|
184
|
+
updated_content = '\n'.join(new_lines)
|
|
185
|
+
|
|
186
|
+
updated_file = io.BytesIO(updated_content.encode('utf-8'))
|
|
187
|
+
media = MediaIoBaseUpload(updated_file, mimetype='text/plain')
|
|
188
|
+
service.files().update(fileId=file_id, media_body=media).execute()
|
|
189
|
+
|
|
190
|
+
if isinstance(fop, list):
|
|
191
|
+
fop.append(True)
|
|
192
|
+
|
|
193
|
+
def get(ID="dosya.txt", Hup=None, Pen=None, go=None, fop=None, es=None, os=None):
|
|
194
|
+
import io, re
|
|
195
|
+
from google.oauth2 import service_account
|
|
196
|
+
from googleapiclient.discovery import build
|
|
197
|
+
from googleapiclient.http import MediaIoBaseDownload
|
|
198
|
+
|
|
199
|
+
creds = service_account.Credentials.from_service_account_info(es)
|
|
200
|
+
service = build('drive', 'v3', credentials=creds)
|
|
201
|
+
|
|
202
|
+
query = f"'{os}' in parents and name='{ID}'"
|
|
203
|
+
results = service.files().list(q=query, fields="files(id)").execute()
|
|
204
|
+
files = results.get('files', [])
|
|
205
|
+
|
|
206
|
+
if not files:
|
|
207
|
+
if Pen is not None:
|
|
208
|
+
Pen.append(None)
|
|
209
|
+
if isinstance(fop, list):
|
|
210
|
+
fop.append(False)
|
|
211
|
+
return
|
|
212
|
+
|
|
213
|
+
file_id = files[0]['id']
|
|
214
|
+
request = service.files().get_media(fileId=file_id)
|
|
215
|
+
file_io = io.BytesIO()
|
|
216
|
+
downloader = MediaIoBaseDownload(file_io, request)
|
|
217
|
+
done = False
|
|
218
|
+
while not done:
|
|
219
|
+
_, done = downloader.next_chunk()
|
|
220
|
+
|
|
221
|
+
content = file_io.getvalue().decode('utf-8')
|
|
222
|
+
lines = content.splitlines()
|
|
223
|
+
|
|
224
|
+
def is_header_line(s: str) -> bool:
|
|
225
|
+
return s.strip().endswith(":")
|
|
226
|
+
|
|
227
|
+
def is_key_line(s: str) -> bool:
|
|
228
|
+
return re.match(r'^\s*[^;\s][^;:]*;\s*', s) is not None
|
|
229
|
+
|
|
230
|
+
if isinstance(Hup, tuple) and len(Hup) == 2:
|
|
231
|
+
header, target = Hup
|
|
232
|
+
in_header = False
|
|
233
|
+
i = 0
|
|
234
|
+
result = None
|
|
235
|
+
|
|
236
|
+
while i < len(lines):
|
|
237
|
+
line = lines[i]
|
|
238
|
+
stripped = line.strip()
|
|
239
|
+
|
|
240
|
+
if is_header_line(line):
|
|
241
|
+
in_header = (stripped[:-1].strip() == header)
|
|
242
|
+
i += 1
|
|
243
|
+
continue
|
|
244
|
+
|
|
245
|
+
if in_header and stripped.startswith(f"{target};"):
|
|
246
|
+
first = line.split(";", 1)[1].lstrip() if ";" in line else ""
|
|
247
|
+
acc = [first]
|
|
248
|
+
i += 1
|
|
249
|
+
while i < len(lines):
|
|
250
|
+
nxt = lines[i]
|
|
251
|
+
if is_header_line(nxt) or is_key_line(nxt):
|
|
252
|
+
break
|
|
253
|
+
acc.append(nxt.strip())
|
|
254
|
+
i += 1
|
|
255
|
+
result = " ".join(acc).strip()
|
|
256
|
+
break
|
|
257
|
+
|
|
258
|
+
i += 1
|
|
259
|
+
|
|
260
|
+
if Pen is not None:
|
|
261
|
+
Pen.append(result if result is not None else "")
|
|
262
|
+
if isinstance(go, list) and result is not None:
|
|
263
|
+
go.append(result)
|
|
264
|
+
if isinstance(fop, list):
|
|
265
|
+
fop.append(result is not None)
|
|
266
|
+
|
|
267
|
+
elif isinstance(Hup, str):
|
|
268
|
+
header = Hup
|
|
269
|
+
in_header = False
|
|
270
|
+
result_lines = []
|
|
271
|
+
found = False
|
|
272
|
+
|
|
273
|
+
for line in lines:
|
|
274
|
+
if is_header_line(line):
|
|
275
|
+
name = line.strip()[:-1].strip()
|
|
276
|
+
if in_header:
|
|
277
|
+
break
|
|
278
|
+
in_header = (name == header)
|
|
279
|
+
if in_header:
|
|
280
|
+
found = True
|
|
281
|
+
continue
|
|
282
|
+
if in_header:
|
|
283
|
+
result_lines.append(line.strip())
|
|
284
|
+
|
|
285
|
+
if Pen is not None:
|
|
286
|
+
Pen.append(" ".join(result_lines).strip())
|
|
287
|
+
if isinstance(fop, list):
|
|
288
|
+
fop.append(found)
|
|
289
|
+
|
|
290
|
+
else:
|
|
291
|
+
if Pen is not None:
|
|
292
|
+
Pen.append(content)
|
|
293
|
+
if isinstance(fop, list):
|
|
294
|
+
fop.append(True)
|
|
295
|
+
|
|
296
|
+
def give(dex, dax, dox, es, os, fop=None, girp=None, girpx=None, girp_header=None, girpx_header=None, dex_ID=None):
|
|
297
|
+
import io
|
|
298
|
+
from google.oauth2 import service_account
|
|
299
|
+
from googleapiclient.discovery import build
|
|
300
|
+
from googleapiclient.http import MediaIoBaseDownload, MediaIoBaseUpload
|
|
301
|
+
|
|
302
|
+
# === dex verisi düzenleme ===
|
|
303
|
+
real_dex = dex
|
|
304
|
+
if girpx and not real_dex.startswith(girpx):
|
|
305
|
+
real_dex = girpx + real_dex
|
|
306
|
+
if girp and not real_dex.endswith(girp):
|
|
307
|
+
real_dex = real_dex + girp
|
|
308
|
+
|
|
309
|
+
# === dax başlık düzenleme ===
|
|
310
|
+
real_dax = dax
|
|
311
|
+
if girpx_header and not real_dax.startswith(girpx_header):
|
|
312
|
+
real_dax = girpx_header + real_dax
|
|
313
|
+
if girp_header and not real_dax.endswith(girp_header):
|
|
314
|
+
real_dax = real_dax + girp_header
|
|
315
|
+
|
|
316
|
+
creds = service_account.Credentials.from_service_account_info(es)
|
|
317
|
+
service = build('drive', 'v3', credentials=creds)
|
|
318
|
+
|
|
319
|
+
query = f"'{os}' in parents and name='{dox}'"
|
|
320
|
+
results = service.files().list(q=query, fields="files(id)").execute()
|
|
321
|
+
files = results.get('files', [])
|
|
322
|
+
|
|
323
|
+
if not files:
|
|
324
|
+
print(f"{dox} dosyası bulunamadı.")
|
|
325
|
+
if isinstance(fop, list):
|
|
326
|
+
fop.append(False)
|
|
327
|
+
return
|
|
328
|
+
|
|
329
|
+
file_id = files[0]['id']
|
|
330
|
+
request = service.files().get_media(fileId=file_id)
|
|
331
|
+
file_io = io.BytesIO()
|
|
332
|
+
downloader = MediaIoBaseDownload(file_io, request)
|
|
333
|
+
done = False
|
|
334
|
+
while not done:
|
|
335
|
+
_, done = downloader.next_chunk()
|
|
336
|
+
|
|
337
|
+
content = file_io.getvalue().decode('utf-8')
|
|
338
|
+
lines = content.strip().split('\n')
|
|
339
|
+
|
|
340
|
+
found_header = False
|
|
341
|
+
updated = False
|
|
342
|
+
new_lines = []
|
|
343
|
+
i = 0
|
|
344
|
+
while i < len(lines):
|
|
345
|
+
line = lines[i]
|
|
346
|
+
new_lines.append(line)
|
|
347
|
+
if line.strip() == real_dax + ":":
|
|
348
|
+
found_header = True
|
|
349
|
+
i += 1
|
|
350
|
+
while i < len(lines):
|
|
351
|
+
current_line = lines[i].strip()
|
|
352
|
+
if current_line.endswith(":"):
|
|
353
|
+
break
|
|
354
|
+
|
|
355
|
+
# === Yeni: dex_ID eşleşmesi kontrolü ===
|
|
356
|
+
if dex_ID and current_line.startswith(f"{dex_ID};"):
|
|
357
|
+
parts = lines[i].split(";", 1)
|
|
358
|
+
if len(parts) == 2:
|
|
359
|
+
# Aynı satıra ekle
|
|
360
|
+
existing_data = parts[1].strip()
|
|
361
|
+
new_data = f"{parts[0]}; {existing_data} {real_dex}".strip()
|
|
362
|
+
new_lines.append(new_data)
|
|
363
|
+
updated = True
|
|
364
|
+
i += 1
|
|
365
|
+
continue
|
|
366
|
+
|
|
367
|
+
# === Eski sistemde: Aynı veri varsa tekrar ekleme ===
|
|
368
|
+
if lines[i].strip() == real_dex:
|
|
369
|
+
updated = True
|
|
370
|
+
|
|
371
|
+
new_lines.append(lines[i])
|
|
372
|
+
i += 1
|
|
373
|
+
|
|
374
|
+
if not updated:
|
|
375
|
+
if dex_ID:
|
|
376
|
+
new_lines.append(f"{dex_ID}; {real_dex}")
|
|
377
|
+
else:
|
|
378
|
+
new_lines.append(real_dex)
|
|
379
|
+
continue
|
|
380
|
+
i += 1
|
|
381
|
+
|
|
382
|
+
if not found_header:
|
|
383
|
+
new_lines.append(f"{real_dax}:")
|
|
384
|
+
if dex_ID:
|
|
385
|
+
new_lines.append(f"{dex_ID}; {real_dex}")
|
|
386
|
+
else:
|
|
387
|
+
new_lines.append(real_dex)
|
|
388
|
+
|
|
389
|
+
new_content = '\n'.join(new_lines)
|
|
390
|
+
file_io = io.BytesIO(new_content.encode('utf-8'))
|
|
391
|
+
media = MediaIoBaseUpload(file_io, mimetype='text/plain', resumable=True)
|
|
392
|
+
|
|
393
|
+
service.files().update(fileId=file_id, media_body=media).execute()
|
|
394
|
+
|
|
395
|
+
if isinstance(fop, list):
|
|
396
|
+
fop.append(True if not updated else False)
|
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: Qwael
|
|
3
|
+
Version: 3.1.0
|
|
4
|
+
Summary: Qwael: İşlevsel ve kolaylaştırılmış Python kütüphanesi
|
|
5
|
+
Author: Bedirhan
|
|
6
|
+
Author-email: bedirhan.oytpass@gmail.com
|
|
7
|
+
License: MIT
|
|
8
|
+
Keywords: Kolay kod,drive,basitleştirilmiş
|
|
9
|
+
Classifier: License :: OSI Approved :: MIT License
|
|
10
|
+
Classifier: Programming Language :: Python :: 3
|
|
11
|
+
Classifier: Programming Language :: Python :: 3.6
|
|
12
|
+
Classifier: Programming Language :: Python :: 3.7
|
|
13
|
+
Classifier: Programming Language :: Python :: 3.8
|
|
14
|
+
Classifier: Programming Language :: Python :: 3.9
|
|
15
|
+
Classifier: Programming Language :: Python :: 3.10
|
|
16
|
+
Description-Content-Type: text/markdown
|
|
17
|
+
License-File: LICENSE
|
|
18
|
+
Requires-Dist: google-api-python-client
|
|
19
|
+
Requires-Dist: google-auth
|
|
20
|
+
Requires-Dist: google-auth-oauthlib
|
|
21
|
+
Requires-Dist: google-auth-httplib2
|
|
22
|
+
Requires-Dist: Pillow
|
|
23
|
+
Dynamic: author
|
|
24
|
+
Dynamic: author-email
|
|
25
|
+
Dynamic: classifier
|
|
26
|
+
Dynamic: description
|
|
27
|
+
Dynamic: description-content-type
|
|
28
|
+
Dynamic: keywords
|
|
29
|
+
Dynamic: license
|
|
30
|
+
Dynamic: license-file
|
|
31
|
+
Dynamic: requires-dist
|
|
32
|
+
Dynamic: summary
|
|
33
|
+
|
|
34
|
+
# Qwael
|
|
35
|
+
|
|
36
|
+
Qwael, Google Drive üzerinde veri yönetimini kolaylaştıran ve basit işlevleri Python ile hızlıca kullanmanıza olanak sağlayan bir kütüphanedir.
|
|
37
|
+
Başlık ekleme, veri ekleme, silme, okuma ve kontrol etme gibi işlemleri tek satırda yapabilirsiniz.
|
|
38
|
+
|
|
39
|
+
## Kullanım
|
|
40
|
+
|
|
41
|
+
- Info
|
|
42
|
+
|
|
43
|
+
DRİVE.info()
|
|
44
|
+
|
|
45
|
+
- Control
|
|
46
|
+
|
|
47
|
+
DRİVE.Control(
|
|
48
|
+
ID="dosya adı",
|
|
49
|
+
ge="kontrol etmek istediğin metin",
|
|
50
|
+
dax="başlık",
|
|
51
|
+
dex_ID="metin başlığı"
|
|
52
|
+
fop="onay değişkeni",
|
|
53
|
+
es="drive hesap bilgileri",
|
|
54
|
+
os="drive klasör id'si"
|
|
55
|
+
)
|
|
56
|
+
|
|
57
|
+
- give
|
|
58
|
+
|
|
59
|
+
DRİVE.give(
|
|
60
|
+
dex="eklemek istediğin metin",
|
|
61
|
+
dax="başlık",
|
|
62
|
+
dex_ID="metin başlığı",
|
|
63
|
+
fop="onay değişkeni",
|
|
64
|
+
es="drive hesap bilgileri",
|
|
65
|
+
os="drive klasör id'si"
|
|
66
|
+
)
|
|
67
|
+
|
|
68
|
+
- get
|
|
69
|
+
|
|
70
|
+
DRİVE.get(
|
|
71
|
+
ID="dosya adı",
|
|
72
|
+
Hup=("çekmek istediğin metinin olduğu başlığı","çekmek istediğin metin başlığı"),
|
|
73
|
+
go="çekilen metinin ekleneceği değişken",
|
|
74
|
+
es="drive hesap bilgileri",
|
|
75
|
+
os="drive klasör id'si"
|
|
76
|
+
)
|
|
77
|
+
|
|
78
|
+
- delete
|
|
79
|
+
|
|
80
|
+
DRİVE.delete(
|
|
81
|
+
ID="dosya adı",
|
|
82
|
+
delete_header="silmek istediğin başlık",
|
|
83
|
+
fop="Öney değişkeni",
|
|
84
|
+
es="drive hesap bilgileri",
|
|
85
|
+
os="drive klasör id'si"
|
|
86
|
+
)
|
|
87
|
+
|
|
88
|
+
|
|
89
|
+
|
|
90
|
+
|
|
91
|
+
### 🚀 Kurulum
|
|
92
|
+
|
|
93
|
+
```bash
|
|
94
|
+
pip install Qwael
|
qwael-3.1.0/README.md
ADDED
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
# Qwael
|
|
2
|
+
|
|
3
|
+
Qwael, Google Drive üzerinde veri yönetimini kolaylaştıran ve basit işlevleri Python ile hızlıca kullanmanıza olanak sağlayan bir kütüphanedir.
|
|
4
|
+
Başlık ekleme, veri ekleme, silme, okuma ve kontrol etme gibi işlemleri tek satırda yapabilirsiniz.
|
|
5
|
+
|
|
6
|
+
## Kullanım
|
|
7
|
+
|
|
8
|
+
- Info
|
|
9
|
+
|
|
10
|
+
DRİVE.info()
|
|
11
|
+
|
|
12
|
+
- Control
|
|
13
|
+
|
|
14
|
+
DRİVE.Control(
|
|
15
|
+
ID="dosya adı",
|
|
16
|
+
ge="kontrol etmek istediğin metin",
|
|
17
|
+
dax="başlık",
|
|
18
|
+
dex_ID="metin başlığı"
|
|
19
|
+
fop="onay değişkeni",
|
|
20
|
+
es="drive hesap bilgileri",
|
|
21
|
+
os="drive klasör id'si"
|
|
22
|
+
)
|
|
23
|
+
|
|
24
|
+
- give
|
|
25
|
+
|
|
26
|
+
DRİVE.give(
|
|
27
|
+
dex="eklemek istediğin metin",
|
|
28
|
+
dax="başlık",
|
|
29
|
+
dex_ID="metin başlığı",
|
|
30
|
+
fop="onay değişkeni",
|
|
31
|
+
es="drive hesap bilgileri",
|
|
32
|
+
os="drive klasör id'si"
|
|
33
|
+
)
|
|
34
|
+
|
|
35
|
+
- get
|
|
36
|
+
|
|
37
|
+
DRİVE.get(
|
|
38
|
+
ID="dosya adı",
|
|
39
|
+
Hup=("çekmek istediğin metinin olduğu başlığı","çekmek istediğin metin başlığı"),
|
|
40
|
+
go="çekilen metinin ekleneceği değişken",
|
|
41
|
+
es="drive hesap bilgileri",
|
|
42
|
+
os="drive klasör id'si"
|
|
43
|
+
)
|
|
44
|
+
|
|
45
|
+
- delete
|
|
46
|
+
|
|
47
|
+
DRİVE.delete(
|
|
48
|
+
ID="dosya adı",
|
|
49
|
+
delete_header="silmek istediğin başlık",
|
|
50
|
+
fop="Öney değişkeni",
|
|
51
|
+
es="drive hesap bilgileri",
|
|
52
|
+
os="drive klasör id'si"
|
|
53
|
+
)
|
|
54
|
+
|
|
55
|
+
|
|
56
|
+
|
|
57
|
+
|
|
58
|
+
### 🚀 Kurulum
|
|
59
|
+
|
|
60
|
+
```bash
|
|
61
|
+
pip install Qwael
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
[egg_info]
|
|
2
|
-
tag_build =
|
|
3
|
-
tag_date = 0
|
|
4
|
-
|
|
1
|
+
[egg_info]
|
|
2
|
+
tag_build =
|
|
3
|
+
tag_date = 0
|
|
4
|
+
|
qwael-3.1.0/setup.py
ADDED
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
from setuptools import setup, find_packages
|
|
2
|
+
|
|
3
|
+
with open("README.md", "r", encoding="utf-8") as f:
|
|
4
|
+
README = f.read()
|
|
5
|
+
|
|
6
|
+
setup(
|
|
7
|
+
name="Qwael",
|
|
8
|
+
version="3.1.0",
|
|
9
|
+
packages=find_packages(),
|
|
10
|
+
install_requires=[
|
|
11
|
+
"google-api-python-client",
|
|
12
|
+
"google-auth",
|
|
13
|
+
"google-auth-oauthlib",
|
|
14
|
+
"google-auth-httplib2",
|
|
15
|
+
"Pillow"
|
|
16
|
+
],
|
|
17
|
+
description="Qwael: İşlevsel ve kolaylaştırılmış Python kütüphanesi",
|
|
18
|
+
long_description=README,
|
|
19
|
+
long_description_content_type="text/markdown",
|
|
20
|
+
author="Bedirhan",
|
|
21
|
+
author_email="bedirhan.oytpass@gmail.com",
|
|
22
|
+
license="MIT",
|
|
23
|
+
keywords=["Kolay kod", "drive", "basitleştirilmiş"],
|
|
24
|
+
classifiers=[
|
|
25
|
+
"License :: OSI Approved :: MIT License",
|
|
26
|
+
"Programming Language :: Python :: 3",
|
|
27
|
+
"Programming Language :: Python :: 3.6",
|
|
28
|
+
"Programming Language :: Python :: 3.7",
|
|
29
|
+
"Programming Language :: Python :: 3.8",
|
|
30
|
+
"Programming Language :: Python :: 3.9",
|
|
31
|
+
"Programming Language :: Python :: 3.10"
|
|
32
|
+
],
|
|
33
|
+
)
|
Qwael-0.1.3/LICENSE
DELETED
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
Custom Software License for Qwael
|
|
2
|
-
|
|
3
|
-
Copyright © 2025 Bedirhan
|
|
4
|
-
All rights reserved.
|
|
5
|
-
|
|
6
|
-
Software Name: Prihops
|
|
7
|
-
|
|
8
|
-
This software is provided under the following license terms:
|
|
9
|
-
|
|
10
|
-
1. Prihops may be freely used and integrated into any software project, application, or platform, whether commercial or non-commercial.
|
|
11
|
-
|
|
12
|
-
2. Applications or systems using Prihops *may be distributed or sold, provided that the **core functionality offered by Prihops itself is not monetized*.
|
|
13
|
-
|
|
14
|
-
3. Specifically, you may not charge users for:
|
|
15
|
-
- Access to any features or outputs that are directly provided by Prihops.
|
|
16
|
-
- Any result generated by Prihops (e.g., images, text, data, etc.).
|
|
17
|
-
|
|
18
|
-
4. Prihops may not be modified, reverse engineered, or redistributed in its original or modified form without explicit written permission from the author.
|
|
19
|
-
|
|
20
|
-
5. This software is provided "as is", without warranty of any kind.
|
|
21
|
-
|
|
22
|
-
Violations of this license may result in legal action or revocation of usage rights.
|
|
23
|
-
|
|
24
|
-
Author: Bedirhan
|
|
25
|
-
Contact: bedirhan.oytpass@gmail.com
|
Qwael-0.1.3/PKG-INFO
DELETED
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
Metadata-Version: 2.1
|
|
2
|
-
Name: Qwael
|
|
3
|
-
Version: 0.1.3
|
|
4
|
-
Summary: Easy Coding
|
|
5
|
-
Home-page:
|
|
6
|
-
Author: Bedirhan
|
|
7
|
-
Author-email: bedirhan.oytpass@gmail.com
|
|
8
|
-
License: Proprietary
|
|
9
|
-
Keywords: Google,coding,Easy
|
|
10
|
-
Classifier: Programming Language :: Python :: 3
|
|
11
|
-
Classifier: License :: Other/Proprietary License
|
|
12
|
-
Classifier: Operating System :: OS Independent
|
|
13
|
-
Description-Content-Type: text/markdown
|
|
14
|
-
License-File: LICENSE
|
|
15
|
-
|
|
16
|
-
# DRIVE: Google Drive File Management Library
|
|
17
|
-
|
|
18
|
-
DRIVE is a Python library that allows you to interact with files on Google Drive. With simple function calls, you can download, upload, update, delete, and retrieve file content in a structured format. This library leverages the Google Drive API and allows seamless integration into your applications.
|
|
19
|
-
|
|
20
|
-
## Features
|
|
21
|
-
|
|
22
|
-
- *Download* files from Google Drive.
|
|
23
|
-
- *Upload* updated files back to Google Drive.
|
|
24
|
-
- *Update* file content by adding or modifying data.
|
|
25
|
-
- *Delete* specific sections of a file.
|
|
26
|
-
- *Search* for specific data within files based on headers.
|
|
27
|
-
|
|
28
|
-
## Installation
|
|
29
|
-
|
|
30
|
-
To install DRIVE, you can use pip:
|
|
31
|
-
|
|
32
|
-
```bash
|
|
33
|
-
pip install Qwael
|
|
@@ -1,376 +0,0 @@
|
|
|
1
|
-
import tkinter as tk
|
|
2
|
-
from google.oauth2 import service_account
|
|
3
|
-
from googleapiclient.discovery import build
|
|
4
|
-
from googleapiclient.http import MediaIoBaseDownload, MediaFileUpload, MediaIoBaseUpload
|
|
5
|
-
from PIL import Image, ImageTk
|
|
6
|
-
import io
|
|
7
|
-
|
|
8
|
-
class DRİVE:
|
|
9
|
-
|
|
10
|
-
def info():
|
|
11
|
-
infoc = "Prihops: 0.1"
|
|
12
|
-
print(infoc)
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
def Control(ID, ge, dax=None, fop=None, es=None, os=None, girp=None, girpx=None, girp_header=None, girpx_header=None, dex_ID=None):
|
|
16
|
-
import io
|
|
17
|
-
from google.oauth2 import service_account
|
|
18
|
-
from googleapiclient.discovery import build
|
|
19
|
-
from googleapiclient.http import MediaIoBaseDownload
|
|
20
|
-
|
|
21
|
-
creds = service_account.Credentials.from_service_account_info(es)
|
|
22
|
-
service = build('drive', 'v3', credentials=creds)
|
|
23
|
-
|
|
24
|
-
query = f"'{os}' in parents and name='{ID}'"
|
|
25
|
-
results = service.files().list(q=query, fields="files(id)").execute()
|
|
26
|
-
files = results.get('files', [])
|
|
27
|
-
|
|
28
|
-
if not files:
|
|
29
|
-
print(f"{ID} dosyası bulunamadı.")
|
|
30
|
-
if isinstance(fop, list):
|
|
31
|
-
fop.append(False)
|
|
32
|
-
return
|
|
33
|
-
|
|
34
|
-
file_id = files[0]['id']
|
|
35
|
-
request = service.files().get_media(fileId=file_id)
|
|
36
|
-
file_io = io.BytesIO()
|
|
37
|
-
downloader = MediaIoBaseDownload(file_io, request)
|
|
38
|
-
done = False
|
|
39
|
-
while not done:
|
|
40
|
-
_, done = downloader.next_chunk()
|
|
41
|
-
|
|
42
|
-
content = file_io.getvalue().decode('utf-8')
|
|
43
|
-
lines = content.strip().split('\n')
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
real_ge = ge
|
|
47
|
-
if girpx and not real_ge.startswith(girpx):
|
|
48
|
-
real_ge = girpx + real_ge
|
|
49
|
-
if girp and not real_ge.endswith(girp):
|
|
50
|
-
real_ge = real_ge + girp
|
|
51
|
-
if dex_ID:
|
|
52
|
-
real_ge = f"{dex_ID}; {real_ge}"
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
real_dax = dax
|
|
56
|
-
if girpx_header and real_dax and not real_dax.startswith(girpx_header):
|
|
57
|
-
real_dax = girpx_header + real_dax
|
|
58
|
-
if girp_header and real_dax and not real_dax.endswith(girp_header):
|
|
59
|
-
real_dax = real_dax + girp_header
|
|
60
|
-
|
|
61
|
-
current_header = None
|
|
62
|
-
in_target_header = False
|
|
63
|
-
|
|
64
|
-
for line in lines:
|
|
65
|
-
stripped = line.strip()
|
|
66
|
-
if stripped.endswith(':'):
|
|
67
|
-
current_header = stripped[:-1]
|
|
68
|
-
in_target_header = (current_header == real_dax) if real_dax else True
|
|
69
|
-
elif in_target_header:
|
|
70
|
-
if stripped == real_ge:
|
|
71
|
-
print(f"Veri '{real_ge}' başlık '{current_header}' içinde bulundu.")
|
|
72
|
-
if isinstance(fop, list):
|
|
73
|
-
fop.append(True)
|
|
74
|
-
return
|
|
75
|
-
|
|
76
|
-
if dax:
|
|
77
|
-
print(f"Veri '{real_ge}' başlık '{real_dax}' içinde bulunamadı.")
|
|
78
|
-
else:
|
|
79
|
-
print(f"Veri '{real_ge}' hiçbir başlık altında bulunamadı.")
|
|
80
|
-
if isinstance(fop, list):
|
|
81
|
-
fop.append(False)
|
|
82
|
-
|
|
83
|
-
def delete(ID, delete_header=None, dex_ID=None, fop=None, es=None, os=None):
|
|
84
|
-
import io
|
|
85
|
-
from google.oauth2 import service_account
|
|
86
|
-
from googleapiclient.discovery import build
|
|
87
|
-
from googleapiclient.http import MediaIoBaseDownload, MediaIoBaseUpload
|
|
88
|
-
|
|
89
|
-
creds = service_account.Credentials.from_service_account_info(es)
|
|
90
|
-
service = build('drive', 'v3', credentials=creds)
|
|
91
|
-
|
|
92
|
-
query = f"'{os}' in parents and name='{ID}'"
|
|
93
|
-
results = service.files().list(q=query, fields="files(id)").execute()
|
|
94
|
-
files = results.get('files', [])
|
|
95
|
-
|
|
96
|
-
if not files:
|
|
97
|
-
print(f"{ID} dosyası bulunamadı.")
|
|
98
|
-
if isinstance(fop, list):
|
|
99
|
-
fop.append(False)
|
|
100
|
-
return
|
|
101
|
-
|
|
102
|
-
file_id = files[0]['id']
|
|
103
|
-
|
|
104
|
-
request = service.files().get_media(fileId=file_id)
|
|
105
|
-
file_io = io.BytesIO()
|
|
106
|
-
downloader = MediaIoBaseDownload(file_io, request)
|
|
107
|
-
done = False
|
|
108
|
-
while not done:
|
|
109
|
-
_, done = downloader.next_chunk()
|
|
110
|
-
content = file_io.getvalue().decode('utf-8')
|
|
111
|
-
|
|
112
|
-
lines = content.strip().split('\n')
|
|
113
|
-
new_lines = []
|
|
114
|
-
skip = False
|
|
115
|
-
found = False
|
|
116
|
-
|
|
117
|
-
if delete_header:
|
|
118
|
-
|
|
119
|
-
for line in lines:
|
|
120
|
-
if line.strip().endswith(':'):
|
|
121
|
-
if line.strip()[:-1] == delete_header:
|
|
122
|
-
skip = True
|
|
123
|
-
found = True
|
|
124
|
-
continue
|
|
125
|
-
else:
|
|
126
|
-
skip = False
|
|
127
|
-
if not skip:
|
|
128
|
-
new_lines.append(line)
|
|
129
|
-
|
|
130
|
-
if not found:
|
|
131
|
-
print(f"'{delete_header}' başlığı bulunamadı.")
|
|
132
|
-
if isinstance(fop, list):
|
|
133
|
-
fop.append(False)
|
|
134
|
-
return
|
|
135
|
-
else:
|
|
136
|
-
print(f"'{delete_header}' başlığı ve altındaki veriler silindi.")
|
|
137
|
-
|
|
138
|
-
elif dex_ID:
|
|
139
|
-
|
|
140
|
-
target_header = dex_ID[0]
|
|
141
|
-
target_data = dex_ID[1]
|
|
142
|
-
in_target_header = False
|
|
143
|
-
header_found = False
|
|
144
|
-
data_found = False
|
|
145
|
-
|
|
146
|
-
for i, line in enumerate(lines):
|
|
147
|
-
stripped = line.strip()
|
|
148
|
-
if stripped.endswith(':'):
|
|
149
|
-
if stripped[:-1] == target_header:
|
|
150
|
-
in_target_header = True
|
|
151
|
-
header_found = True
|
|
152
|
-
new_lines.append(line)
|
|
153
|
-
continue
|
|
154
|
-
else:
|
|
155
|
-
in_target_header = False
|
|
156
|
-
|
|
157
|
-
if in_target_header:
|
|
158
|
-
if stripped.startswith(f"{target_data};"):
|
|
159
|
-
data_found = True
|
|
160
|
-
continue
|
|
161
|
-
else:
|
|
162
|
-
new_lines.append(line)
|
|
163
|
-
else:
|
|
164
|
-
new_lines.append(line)
|
|
165
|
-
|
|
166
|
-
if not header_found:
|
|
167
|
-
print(f"'{target_header}' başlığı bulunamadı.")
|
|
168
|
-
if isinstance(fop, list):
|
|
169
|
-
fop.append(False)
|
|
170
|
-
return
|
|
171
|
-
if not data_found:
|
|
172
|
-
print(f"'{target_data}' verisi bulunamadı.")
|
|
173
|
-
if isinstance(fop, list):
|
|
174
|
-
fop.append(False)
|
|
175
|
-
return
|
|
176
|
-
else:
|
|
177
|
-
print(f"'{target_header}' başlığı altındaki '{target_data}' verisi silindi.")
|
|
178
|
-
|
|
179
|
-
else:
|
|
180
|
-
print("Hiçbir işlem yapılmadı. 'delete_header' veya 'dex_ID' parametresi girilmelidir.")
|
|
181
|
-
if isinstance(fop, list):
|
|
182
|
-
fop.append(False)
|
|
183
|
-
return
|
|
184
|
-
|
|
185
|
-
updated_content = '\n'.join(new_lines)
|
|
186
|
-
|
|
187
|
-
updated_file = io.BytesIO(updated_content.encode('utf-8'))
|
|
188
|
-
media = MediaIoBaseUpload(updated_file, mimetype='text/plain')
|
|
189
|
-
service.files().update(fileId=file_id, media_body=media).execute()
|
|
190
|
-
|
|
191
|
-
if isinstance(fop, list):
|
|
192
|
-
fop.append(True)
|
|
193
|
-
|
|
194
|
-
def get(ID="dosya.txt", Hup=None, Pen=None, go=None, fop=None, es=None, os=None):
|
|
195
|
-
import io
|
|
196
|
-
from google.oauth2 import service_account
|
|
197
|
-
from googleapiclient.discovery import build
|
|
198
|
-
from googleapiclient.http import MediaIoBaseDownload
|
|
199
|
-
|
|
200
|
-
creds = service_account.Credentials.from_service_account_info(es)
|
|
201
|
-
service = build('drive', 'v3', credentials=creds)
|
|
202
|
-
|
|
203
|
-
query = f"'{os}' in parents and name='{ID}'"
|
|
204
|
-
results = service.files().list(q=query, fields="files(id)").execute()
|
|
205
|
-
files = results.get('files', [])
|
|
206
|
-
|
|
207
|
-
if not files:
|
|
208
|
-
print(f"{ID} dosyası bulunamadı.")
|
|
209
|
-
if Pen is not None:
|
|
210
|
-
Pen.append(None)
|
|
211
|
-
if isinstance(fop, list):
|
|
212
|
-
fop.append(False)
|
|
213
|
-
return
|
|
214
|
-
|
|
215
|
-
file_id = files[0]['id']
|
|
216
|
-
request = service.files().get_media(fileId=file_id)
|
|
217
|
-
file_io = io.BytesIO()
|
|
218
|
-
downloader = MediaIoBaseDownload(file_io, request)
|
|
219
|
-
done = False
|
|
220
|
-
while not done:
|
|
221
|
-
_, done = downloader.next_chunk()
|
|
222
|
-
|
|
223
|
-
content = file_io.getvalue().decode('utf-8')
|
|
224
|
-
lines = content.splitlines()
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
if isinstance(Hup, tuple) and len(Hup) == 2:
|
|
228
|
-
header = Hup[0]
|
|
229
|
-
target = Hup[1]
|
|
230
|
-
capture = False
|
|
231
|
-
result = None
|
|
232
|
-
for line in lines:
|
|
233
|
-
if line.strip().endswith(":"):
|
|
234
|
-
capture = (line.strip()[:-1] == header)
|
|
235
|
-
continue
|
|
236
|
-
if capture:
|
|
237
|
-
if line.strip().startswith(f"{target};"):
|
|
238
|
-
parts = line.split(";", 1)
|
|
239
|
-
if len(parts) == 2:
|
|
240
|
-
result = parts[1].strip()
|
|
241
|
-
break
|
|
242
|
-
|
|
243
|
-
if Pen is not None:
|
|
244
|
-
Pen.append(result if result else "")
|
|
245
|
-
if isinstance(go, list) and result is not None:
|
|
246
|
-
go.append(result)
|
|
247
|
-
if isinstance(fop, list):
|
|
248
|
-
fop.append(result is not None)
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
elif isinstance(Hup, str):
|
|
252
|
-
capture = False
|
|
253
|
-
result = ""
|
|
254
|
-
found = False
|
|
255
|
-
for line in lines:
|
|
256
|
-
if line.strip().startswith(Hup + ":"):
|
|
257
|
-
capture = True
|
|
258
|
-
found = True
|
|
259
|
-
continue
|
|
260
|
-
elif capture and ":" in line:
|
|
261
|
-
break
|
|
262
|
-
elif capture:
|
|
263
|
-
result += line + "\n"
|
|
264
|
-
if Pen is not None:
|
|
265
|
-
Pen.append(result.strip())
|
|
266
|
-
if isinstance(fop, list):
|
|
267
|
-
fop.append(found)
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
else:
|
|
271
|
-
if Pen is not None:
|
|
272
|
-
Pen.append(content)
|
|
273
|
-
if isinstance(fop, list):
|
|
274
|
-
fop.append(True)
|
|
275
|
-
|
|
276
|
-
def give(dex, dax, dox, es, os, fop=None, girp=None, girpx=None, girp_header=None, girpx_header=None, dex_ID=None):
|
|
277
|
-
import io
|
|
278
|
-
from google.oauth2 import service_account
|
|
279
|
-
from googleapiclient.discovery import build
|
|
280
|
-
from googleapiclient.http import MediaIoBaseDownload, MediaIoBaseUpload
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
real_dex = dex
|
|
284
|
-
if girpx and not real_dex.startswith(girpx):
|
|
285
|
-
real_dex = girpx + real_dex
|
|
286
|
-
if girp and not real_dex.endswith(girp):
|
|
287
|
-
real_dex = real_dex + girp
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
real_dax = dax
|
|
291
|
-
if girpx_header and not real_dax.startswith(girpx_header):
|
|
292
|
-
real_dax = girpx_header + real_dax
|
|
293
|
-
if girp_header and not real_dax.endswith(girp_header):
|
|
294
|
-
real_dax = real_dax + girp_header
|
|
295
|
-
|
|
296
|
-
creds = service_account.Credentials.from_service_account_info(es)
|
|
297
|
-
service = build('drive', 'v3', credentials=creds)
|
|
298
|
-
|
|
299
|
-
query = f"'{os}' in parents and name='{dox}'"
|
|
300
|
-
results = service.files().list(q=query, fields="files(id)").execute()
|
|
301
|
-
files = results.get('files', [])
|
|
302
|
-
|
|
303
|
-
if not files:
|
|
304
|
-
print(f"{dox} dosyası bulunamadı.")
|
|
305
|
-
if isinstance(fop, list):
|
|
306
|
-
fop.append(False)
|
|
307
|
-
return
|
|
308
|
-
|
|
309
|
-
file_id = files[0]['id']
|
|
310
|
-
request = service.files().get_media(fileId=file_id)
|
|
311
|
-
file_io = io.BytesIO()
|
|
312
|
-
downloader = MediaIoBaseDownload(file_io, request)
|
|
313
|
-
done = False
|
|
314
|
-
while not done:
|
|
315
|
-
_, done = downloader.next_chunk()
|
|
316
|
-
|
|
317
|
-
content = file_io.getvalue().decode('utf-8')
|
|
318
|
-
lines = content.strip().split('\n')
|
|
319
|
-
|
|
320
|
-
found_header = False
|
|
321
|
-
updated = False
|
|
322
|
-
new_lines = []
|
|
323
|
-
i = 0
|
|
324
|
-
while i < len(lines):
|
|
325
|
-
line = lines[i]
|
|
326
|
-
new_lines.append(line)
|
|
327
|
-
if line.strip() == real_dax + ":":
|
|
328
|
-
found_header = True
|
|
329
|
-
i += 1
|
|
330
|
-
while i < len(lines):
|
|
331
|
-
current_line = lines[i].strip()
|
|
332
|
-
if current_line.endswith(":"):
|
|
333
|
-
break
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
if dex_ID and current_line.startswith(f"{dex_ID};"):
|
|
337
|
-
parts = lines[i].split(";", 1)
|
|
338
|
-
if len(parts) == 2:
|
|
339
|
-
|
|
340
|
-
existing_data = parts[1].strip()
|
|
341
|
-
new_data = f"{parts[0]}; {existing_data} {real_dex}".strip()
|
|
342
|
-
new_lines.append(new_data)
|
|
343
|
-
updated = True
|
|
344
|
-
i += 1
|
|
345
|
-
continue
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
if lines[i].strip() == real_dex:
|
|
349
|
-
updated = True
|
|
350
|
-
|
|
351
|
-
new_lines.append(lines[i])
|
|
352
|
-
i += 1
|
|
353
|
-
|
|
354
|
-
if not updated:
|
|
355
|
-
if dex_ID:
|
|
356
|
-
new_lines.append(f"{dex_ID}; {real_dex}")
|
|
357
|
-
else:
|
|
358
|
-
new_lines.append(real_dex)
|
|
359
|
-
continue
|
|
360
|
-
i += 1
|
|
361
|
-
|
|
362
|
-
if not found_header:
|
|
363
|
-
new_lines.append(f"{real_dax}:")
|
|
364
|
-
if dex_ID:
|
|
365
|
-
new_lines.append(f"{dex_ID}; {real_dex}")
|
|
366
|
-
else:
|
|
367
|
-
new_lines.append(real_dex)
|
|
368
|
-
|
|
369
|
-
new_content = '\n'.join(new_lines)
|
|
370
|
-
file_io = io.BytesIO(new_content.encode('utf-8'))
|
|
371
|
-
media = MediaIoBaseUpload(file_io, mimetype='text/plain', resumable=True)
|
|
372
|
-
|
|
373
|
-
service.files().update(fileId=file_id, media_body=media).execute()
|
|
374
|
-
|
|
375
|
-
if isinstance(fop, list):
|
|
376
|
-
fop.append(True if not updated else False)
|
Qwael-0.1.3/Qwael/Easy_app.py
DELETED
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
from kivy.app import App
|
|
2
|
-
from kivy.uix.label import Label
|
|
3
|
-
from kivy.uix.textinput import TextInput
|
|
4
|
-
from kivy.uix.gridlayout import GridLayout
|
|
5
|
-
from kivy.lang import Builder
|
|
6
|
-
from kivy.uix.widget import Widget
|
|
7
|
-
from kivy.uix.button import Button
|
|
8
|
-
from kivy.uix.boxlayout import BoxLayout
|
|
9
|
-
from kivy.uix.floatlayout import FloatLayout
|
|
10
|
-
|
|
11
|
-
class Easy_App:
|
|
12
|
-
def open(add=()):
|
|
13
|
-
if add():
|
|
14
|
-
def Labell(txt="", x=None,y=None, sizing=None):
|
|
15
|
-
class ekran(FloatLayout):
|
|
16
|
-
def __init__(self,**kwargs):
|
|
17
|
-
super(ekran,self).__init__(**kwargs)
|
|
18
|
-
layout = BoxLayout(orieentation="vertical",padding=(30),spacing=(20))
|
|
19
|
-
x = Label(text=txt, pos_hint={"x": 0.0, "y": 0.0}, size_hint=(None, None), size=(x, y), font_size=f"{sizing}sp")
|
|
20
|
-
class uygulama(App):
|
|
21
|
-
def build(self):
|
|
22
|
-
pass
|
|
23
|
-
if __name__ == "__main__":
|
|
24
|
-
uygulama().run()
|
|
25
|
-
|
Qwael-0.1.3/Qwael/__init__.py
DELETED
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
Metadata-Version: 2.1
|
|
2
|
-
Name: Qwael
|
|
3
|
-
Version: 0.1.3
|
|
4
|
-
Summary: Easy Coding
|
|
5
|
-
Home-page:
|
|
6
|
-
Author: Bedirhan
|
|
7
|
-
Author-email: bedirhan.oytpass@gmail.com
|
|
8
|
-
License: Proprietary
|
|
9
|
-
Keywords: Google,coding,Easy
|
|
10
|
-
Classifier: Programming Language :: Python :: 3
|
|
11
|
-
Classifier: License :: Other/Proprietary License
|
|
12
|
-
Classifier: Operating System :: OS Independent
|
|
13
|
-
Description-Content-Type: text/markdown
|
|
14
|
-
License-File: LICENSE
|
|
15
|
-
|
|
16
|
-
# DRIVE: Google Drive File Management Library
|
|
17
|
-
|
|
18
|
-
DRIVE is a Python library that allows you to interact with files on Google Drive. With simple function calls, you can download, upload, update, delete, and retrieve file content in a structured format. This library leverages the Google Drive API and allows seamless integration into your applications.
|
|
19
|
-
|
|
20
|
-
## Features
|
|
21
|
-
|
|
22
|
-
- *Download* files from Google Drive.
|
|
23
|
-
- *Upload* updated files back to Google Drive.
|
|
24
|
-
- *Update* file content by adding or modifying data.
|
|
25
|
-
- *Delete* specific sections of a file.
|
|
26
|
-
- *Search* for specific data within files based on headers.
|
|
27
|
-
|
|
28
|
-
## Installation
|
|
29
|
-
|
|
30
|
-
To install DRIVE, you can use pip:
|
|
31
|
-
|
|
32
|
-
```bash
|
|
33
|
-
pip install Qwael
|
Qwael-0.1.3/README.md
DELETED
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
# DRIVE: Google Drive File Management Library
|
|
2
|
-
|
|
3
|
-
DRIVE is a Python library that allows you to interact with files on Google Drive. With simple function calls, you can download, upload, update, delete, and retrieve file content in a structured format. This library leverages the Google Drive API and allows seamless integration into your applications.
|
|
4
|
-
|
|
5
|
-
## Features
|
|
6
|
-
|
|
7
|
-
- *Download* files from Google Drive.
|
|
8
|
-
- *Upload* updated files back to Google Drive.
|
|
9
|
-
- *Update* file content by adding or modifying data.
|
|
10
|
-
- *Delete* specific sections of a file.
|
|
11
|
-
- *Search* for specific data within files based on headers.
|
|
12
|
-
|
|
13
|
-
## Installation
|
|
14
|
-
|
|
15
|
-
To install DRIVE, you can use pip:
|
|
16
|
-
|
|
17
|
-
```bash
|
|
18
|
-
pip install Qwael
|
Qwael-0.1.3/setup.py
DELETED
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
from setuptools import setup, find_packages
|
|
2
|
-
|
|
3
|
-
setup(
|
|
4
|
-
name="Qwael",
|
|
5
|
-
version="0.1.3",
|
|
6
|
-
description="Easy Coding",
|
|
7
|
-
long_description=open("README.md", encoding="utf-8").read(),
|
|
8
|
-
long_description_content_type="text/markdown",
|
|
9
|
-
author="Bedirhan",
|
|
10
|
-
author_email="bedirhan.oytpass@gmail.com",
|
|
11
|
-
url="",
|
|
12
|
-
packages=find_packages(),
|
|
13
|
-
classifiers=[
|
|
14
|
-
"Programming Language :: Python :: 3",
|
|
15
|
-
"License :: Other/Proprietary License",
|
|
16
|
-
"Operating System :: OS Independent",
|
|
17
|
-
],
|
|
18
|
-
install_requires=[
|
|
19
|
-
'google-auth',
|
|
20
|
-
'google-api-python-client',
|
|
21
|
-
'google-auth-httplib2',
|
|
22
|
-
'google-auth-oauthlib',
|
|
23
|
-
'Pillow',
|
|
24
|
-
"kivy",
|
|
25
|
-
],
|
|
26
|
-
keywords=["Google", "coding","Easy"],
|
|
27
|
-
project_urls={},
|
|
28
|
-
license="Proprietary",
|
|
29
|
-
license_files=("LICENSE",)
|
|
30
|
-
)
|
|
File without changes
|
|
File without changes
|