Kekik 1.6.7__tar.gz → 1.6.9__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.

Potentially problematic release.


This version of Kekik might be problematic. Click here for more details.

Files changed (48) hide show
  1. {kekik-1.6.7 → kekik-1.6.9}/Kekik/cache.py +27 -10
  2. {kekik-1.6.7 → kekik-1.6.9}/Kekik.egg-info/PKG-INFO +1 -1
  3. {kekik-1.6.7 → kekik-1.6.9}/PKG-INFO +1 -1
  4. {kekik-1.6.7 → kekik-1.6.9}/setup.py +1 -1
  5. {kekik-1.6.7 → kekik-1.6.9}/Kekik/BIST.py +0 -0
  6. {kekik-1.6.7 → kekik-1.6.9}/Kekik/Domain2IP.py +0 -0
  7. {kekik-1.6.7 → kekik-1.6.9}/Kekik/Nesne.py +0 -0
  8. {kekik-1.6.7 → kekik-1.6.9}/Kekik/Sifreleme/AESManager.py +0 -0
  9. {kekik-1.6.7 → kekik-1.6.9}/Kekik/Sifreleme/CryptoJS.py +0 -0
  10. {kekik-1.6.7 → kekik-1.6.9}/Kekik/Sifreleme/HexCodec.py +0 -0
  11. {kekik-1.6.7 → kekik-1.6.9}/Kekik/Sifreleme/NaysHash.py +0 -0
  12. {kekik-1.6.7 → kekik-1.6.9}/Kekik/Sifreleme/Packer.py +0 -0
  13. {kekik-1.6.7 → kekik-1.6.9}/Kekik/Sifreleme/StringCodec.py +0 -0
  14. {kekik-1.6.7 → kekik-1.6.9}/Kekik/Sifreleme/__init__.py +0 -0
  15. {kekik-1.6.7 → kekik-1.6.9}/Kekik/__init__.py +0 -0
  16. {kekik-1.6.7 → kekik-1.6.9}/Kekik/cli.py +0 -0
  17. {kekik-1.6.7 → kekik-1.6.9}/Kekik/csv2dict.py +0 -0
  18. {kekik-1.6.7 → kekik-1.6.9}/Kekik/dict2csv.py +0 -0
  19. {kekik-1.6.7 → kekik-1.6.9}/Kekik/dict2json.py +0 -0
  20. {kekik-1.6.7 → kekik-1.6.9}/Kekik/dosya2set.py +0 -0
  21. {kekik-1.6.7 → kekik-1.6.9}/Kekik/dosya_indir.py +0 -0
  22. {kekik-1.6.7 → kekik-1.6.9}/Kekik/hwid_kontrol.py +0 -0
  23. {kekik-1.6.7 → kekik-1.6.9}/Kekik/kisi_ver/__init__.py +0 -0
  24. {kekik-1.6.7 → kekik-1.6.9}/Kekik/kisi_ver/biyografiler.py +0 -0
  25. {kekik-1.6.7 → kekik-1.6.9}/Kekik/kisi_ver/isimler.py +0 -0
  26. {kekik-1.6.7 → kekik-1.6.9}/Kekik/kisi_ver/soyisimler.py +0 -0
  27. {kekik-1.6.7 → kekik-1.6.9}/Kekik/link_islemleri.py +0 -0
  28. {kekik-1.6.7 → kekik-1.6.9}/Kekik/list2html.py +0 -0
  29. {kekik-1.6.7 → kekik-1.6.9}/Kekik/liste_fetis.py +0 -0
  30. {kekik-1.6.7 → kekik-1.6.9}/Kekik/mail_gonder.py +0 -0
  31. {kekik-1.6.7 → kekik-1.6.9}/Kekik/okunabilir_byte.py +0 -0
  32. {kekik-1.6.7 → kekik-1.6.9}/Kekik/proxy_ver.py +0 -0
  33. {kekik-1.6.7 → kekik-1.6.9}/Kekik/qr_ver.py +0 -0
  34. {kekik-1.6.7 → kekik-1.6.9}/Kekik/ses_fetis.py +0 -0
  35. {kekik-1.6.7 → kekik-1.6.9}/Kekik/slugify.py +0 -0
  36. {kekik-1.6.7 → kekik-1.6.9}/Kekik/terminal_baslik.py +0 -0
  37. {kekik-1.6.7 → kekik-1.6.9}/Kekik/txt_fetis.py +0 -0
  38. {kekik-1.6.7 → kekik-1.6.9}/Kekik/unicode_tr.py +0 -0
  39. {kekik-1.6.7 → kekik-1.6.9}/Kekik/zaman_donustur.py +0 -0
  40. {kekik-1.6.7 → kekik-1.6.9}/Kekik.egg-info/SOURCES.txt +0 -0
  41. {kekik-1.6.7 → kekik-1.6.9}/Kekik.egg-info/dependency_links.txt +0 -0
  42. {kekik-1.6.7 → kekik-1.6.9}/Kekik.egg-info/entry_points.txt +0 -0
  43. {kekik-1.6.7 → kekik-1.6.9}/Kekik.egg-info/requires.txt +0 -0
  44. {kekik-1.6.7 → kekik-1.6.9}/Kekik.egg-info/top_level.txt +0 -0
  45. {kekik-1.6.7 → kekik-1.6.9}/LICENSE +0 -0
  46. {kekik-1.6.7 → kekik-1.6.9}/MANIFEST.in +0 -0
  47. {kekik-1.6.7 → kekik-1.6.9}/README.md +0 -0
  48. {kekik-1.6.7 → kekik-1.6.9}/setup.cfg +0 -0
@@ -174,28 +174,41 @@ async def make_cache_key(args, kwargs, is_fastapi=False):
174
174
  def kekik_cache(ttl=UNLIMITED, unless=None, is_fastapi=False):
175
175
  """
176
176
  Bir fonksiyon veya coroutine'in sonucunu cache'ler.
177
-
178
- :param ttl: Cache’in geçerlilik süresi (saniye). UNLIMITED ise süresizdir.
179
- :param unless: Fonksiyonun sonucunu argüman olarak alan bir callable.
180
- Eğer True dönerse, sonuç cache'e alınmaz.
181
- :param is_fastapi: Eğer True ise, cache key'i oluştururken FastAPI request nesnesine özel şekilde davranır.
182
177
 
183
- Örnek kullanım:
178
+ Args:
179
+ ttl (int, optional): Cache’in geçerlilik süresi (saniye).
180
+ Eğer `UNLIMITED` ise süresizdir. Varsayılan olarak `UNLIMITED`'dir.
181
+ unless (callable, optional): Fonksiyonun sonucunu argüman olarak alan bir callable.
182
+ Eğer `True` dönerse, sonuç cache'e alınmaz. Varsayılan olarak `None`'dır.
183
+ is_fastapi (bool, optional): Eğer `True` ise, cache key'i oluştururken FastAPI request nesnesine özel şekilde davranır.
184
+ Varsayılan olarak `False`'tır.
185
+
186
+ Notlar:
187
+ -------
188
+ Normalde yalnızca Redis cache kullanılmak istenir.
189
+ Ancak Redis'e ulaşılamayan durumlarda RAM fallback kullanılır.
190
+
191
+ ---
192
+
193
+ Örn.:
184
194
 
185
- @kekik_cache(ttl=15, unless=lambda res: res is None)
195
+ @kekik_cache(ttl=15, unless=lambda sonuc: bool(sonuc is None))
186
196
  async def bakalim(param):
187
- ...
197
+ # Burada cache işlemi yapılır.
198
+ return param
188
199
  """
189
200
  # Parametresiz kullanıldığında
190
201
  if callable(ttl):
191
202
  return kekik_cache(UNLIMITED, unless=unless, is_fastapi=is_fastapi)(ttl)
192
203
 
193
204
  def decorator(func):
194
- func.__cache = AsyncCache(ttl)
195
-
196
205
  if asyncio.iscoroutinefunction(func):
197
206
  @wraps(func)
198
207
  async def async_wrapper(*args, **kwargs):
208
+ # Lazy initialization: İlk çağrıda cache oluşturuluyor
209
+ if not hasattr(func, "__cache"):
210
+ func.__cache = AsyncCache(ttl)
211
+
199
212
  key = await make_cache_key(args, kwargs, is_fastapi)
200
213
 
201
214
  try:
@@ -207,6 +220,10 @@ def kekik_cache(ttl=UNLIMITED, unless=None, is_fastapi=False):
207
220
  else:
208
221
  @wraps(func)
209
222
  def sync_wrapper(*args, **kwargs):
223
+ # Lazy initialization: İlk çağrıda cache oluşturuluyor
224
+ if not hasattr(func, "__cache"):
225
+ func.__cache = AsyncCache(ttl)
226
+
210
227
  key = (args, tuple(sorted(kwargs.items())))
211
228
 
212
229
  try:
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.2
2
2
  Name: Kekik
3
- Version: 1.6.7
3
+ Version: 1.6.9
4
4
  Summary: İşlerimizi kolaylaştıracak fonksiyonların el altında durduğu kütüphane..
5
5
  Home-page: https://github.com/keyiflerolsun/Kekik
6
6
  Author: keyiflerolsun
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.2
2
2
  Name: Kekik
3
- Version: 1.6.7
3
+ Version: 1.6.9
4
4
  Summary: İşlerimizi kolaylaştıracak fonksiyonların el altında durduğu kütüphane..
5
5
  Home-page: https://github.com/keyiflerolsun/Kekik
6
6
  Author: keyiflerolsun
@@ -6,7 +6,7 @@ from io import open
6
6
  setup(
7
7
  # ? Genel Bilgiler
8
8
  name = "Kekik",
9
- version = "1.6.7",
9
+ version = "1.6.9",
10
10
  url = "https://github.com/keyiflerolsun/Kekik",
11
11
  description = "İşlerimizi kolaylaştıracak fonksiyonların el altında durduğu kütüphane..",
12
12
  keywords = ["Kekik", "KekikAkademi", "keyiflerolsun"],
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
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