Skip to main content

👼 Melek Routine (melek-routine)

PyPI version Python 3.7+ License: MIT

Melek Routine, harici ağır kütüphanelere (APScheduler, dateutil, Celery vb.) bağımlı OLMADAN, yalnızca Python'ın yerel standart kütüphaneleri kullanılarak geliştirilmiş akıllı bir zamanlayıcı, Türkçe Doğal Dil (NLP) zaman çözücü ve SQLite kalıcılık destekli görev dağıtım motorudur.


🚀 Öne Çıkan Özellikler

  • %0 CPU Kullanımı: threading.Condition tabanlı dinamik uyanma mekanizması sayesinde görev vakti gelene kadar CPU harcamaz, derin uykuda bekler.
  • Gelişmiş Türkçe Doğal Dil (NLP) Zaman Çözücü:
    • Bağıl zamanlar: "5 saniye sonra", "10 dakika sonra", "2 saat sonra"
    • Uzun vadeli zamanlar: "2 hafta sonra", "3 ay sonra", "20 yıl sonra"
    • Göreceli gün belirteçleri: "yarın saat 15:00", "öbür gün sabah 10'da", "haftaya"
    • Belirli takvim & doğum günleri: "29 Ekim 2030 saat 14:00", "15 Ocak saat 14:00", "10.11.2026 09:05"
    • Geleneksel saat dilimleri: "saat 10'u 15 geçe", "üçe beş kala", "akşam 8'de"
    • Yazım hatası toleransı (Fuzzy Match): "onbiri iki geve" -> "geçe" olarak otomatik düzeltilir.
  • SQLite Kalıcılık (Task Persistence): Görevler ve 20 yıllık hatırlatıcılar melek_routine.db içine kaydedilir; bilgisayar kapansa veya yeniden başlasa bile hiçbir görev kaybolmaz.
  • Thread-Safe Öncelik Kuyruğu: Görevler heapq ve threading.Lock ile güvenli şekilde yönetilir. Aynı zamana denk gelen görevlerde HIGH öncelikli olanlar önce çalıştırılır.
  • Esnek Zamanlama Çeşitleri: Tek seferlik (ONETIME), periyodik (PERIODIC) veya cron-benzeri günlük/haftalık (CRON) görevler.
  • Gelişmiş Kontroller: Görev erteleme (snooze_task), iptal etme (cancel_task) ve aktif görev listeleme.
  • Sistem Meşguliyet Filtresi: is_system_busy filtresi ile sistem meşgulken düşük öncelikli görevler ötelenir, HIGH öncelikli görevler her koşulda çalışır.

📦 Kurulum

pip install melek-routine

🛠️ Kullanım Örnekleri

1. Türkçe Doğal Dil Zaman Çözücü (TurkceZamanCozucu)

from melek_routine import TurkceZamanCozucu
from datetime import datetime

cozucu = TurkceZamanCozucu()

# 20 Yıllık Hatırlatıcı
zaman1 = cozucu.coz("20 yıl sonra")
print(zaman1)  # 2046-...

# Doğum Günü & Özel Gün
zaman2 = cozucu.coz("29 Ekim saat 14:00")
print(zaman2)

# Yarın & Öbür Gün
zaman3 = cozucu.coz("yarın saat 15:30")
print(zaman3)

# Fuzzy Yazım Hatası Toleransı
zaman4 = cozucu.coz("onbiri iki geve") # geve -> geçe
print(zaman4)

2. Kalıcı Görev ve Hatırlatıcı Yöneticisi (MelekRoutineController)

from melek_routine import MelekRoutineController, Priority

def hatirlatici(mesaj):
    print(f"🔔 [BİLDİRİM] {mesaj}")

# SQLite kalıcılık ile başlat (Bilgisayar yeniden başlasa da görevler korunur)
controller = MelekRoutineController(db_path="melek_routine.db")
controller.start()

# Doğal dil ile görev ekleme
task_id = controller.add_task_natural(
    callback=hatirlatici,
    natural_text="yarın saat 09:00",
    name="Sabah Toplantısı",
    priority=Priority.HIGH,
    args=("Sabah toplantısı vakti geldi!",)
)

# 20 yıllık doğum günü hatırlatıcısı
bday_id = controller.add_task_natural(
    callback=hatirlatici,
    natural_text="15 ocak saat 10:00",
    name="Ahmet Doğum Günü",
    args=("Ahmet'in doğum gününü kutla!",)
)

# Periyodik görev (Her saat başı)
controller.add_periodic_task(
    callback=lambda: print("Su içmeyi unutma!"),
    interval_seconds=3600.0,
    name="Su Hatırlatıcı"
)

# Görev erteleme (10 dakika ertele)
yeni_id = controller.snooze_task(task_id, delay_seconds=600.0)

# Görev iptal etme
controller.cancel_task(task_id)

# Durdurma
controller.stop()

📄 Lisans

Bu proje MIT Lisansı altında lisanslanmıştır.

Metadata

Release files for melek-routine 1.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for melek-routine 1.1.0
File Size Uploaded Provenance Actions
melek_routine-1.1.0.tar.gz 22.2 kB Without provenance Details for melek_routine-1.1.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for melek-routine 1.1.0
File Interpreter ABI Platform Actions
melek_routine-1.1.0-py3-none-any.whl Python 3 none any Details for melek_routine-1.1.0-py3-none-any.whl

Total release size: 41.6 kB

Release files / melek_routine-1.1.0.tar.gz

Download URL melek_routine-1.1.0.tar.gz
Size 22.2 kB
Tags Source
SHA-256 checksum
How to use checksums
f7388db9e832cd265cde5ab340fcba54e5a3e823aec6bcb15f22b3f38cec383b
BLAKE2b-256 checksum
How to use checksums
f414f9afb46d6f8583e17c041bf99fa49f99f8963e7c71722a7c2e23b0837168
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.11.0

Release files / melek_routine-1.1.0-py3-none-any.whl

Download URL melek_routine-1.1.0-py3-none-any.whl
Size 19.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
fdfa1d12c09a869730fba968e02a8d11b4fb659f5176dba4b90792e471f756e4
BLAKE2b-256 checksum
How to use checksums
5473d30a62345997ac9491b172d3bfd80c4fbc16523e80811d43059449a114ba
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.11.0

Security for melek-routine 1.1.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

1.1.0 This release

2 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page