Skip to main content

A utility toolkit including logging, configuration, HuggingFace helpers and more.

Project description

OpenBuffet Toolkit

OpenBuffet ekosistemi için geliştirilmiş modüler bir Python araç kütüphanesidir. Bu toolkit; konfigürasyon yönetimi, loglama, zaman profilleme ve Hugging Face entegrasyonu gibi çok yönlü yardımcı bileşenler içerir.

Modern uygulamalarda yeniden kullanılabilirliği artırmak, entegrasyonları sadeleştirmek ve yazılım kalitesini yükseltmek amacıyla tasarlanmıştır.

Uyumluluk

  • Python Versiyonu: 3.8+
  • Platform Desteği: Tüm platformlar
  • Kullanım Alanları: FastAPI servisleri, veri işleme pipeline'ları, model tabanlı uygulamalar

Özellikler

  • Ortam değişkenlerini .env dosyasından yükleyebilme (ConfiguratorEnvironment)
  • Dosyaya ve konsola loglama yapan, thread-safe LoggerManager
  • Fonksiyonları çalışma süresine göre profilleyen Profiler
  • Hugging Face üzerinde model ve veri yükleme/indirme işlemleri yapan HuggingFaceHelper
  • Açık kaynak, genişletilebilir yapı

Kurulum

Pip ile Kurulum

pip install openbuffet-toolkit

Geliştirme Modunda Kurulum

git clone https://github.com/ferdikurnazdm/openbuffet_toolkit.git
cd openbuffet_toolkit
pip install -e .

Kullanım Örnekleri

LoggerManager Kullanımı

from openbuffet_toolkit.logger import LoggerManager

logger = LoggerManager().get_logger()
logger.info("Sistem başlatıldı.")

Ortam Değişkenlerini Yükleme

from openbuffet_toolkit.configurator import ConfiguratorEnvironment

config = ConfiguratorEnvironment()
api_key = config.get("API_KEY")

Profiler Dekoratörü

from openbuffet_toolkit.profiler import Profiler

@Profiler.time_taken(label="DEBUG: ")
def iş_yap():
    # İşlem kodları
    pass

HuggingFaceHelper ile Model Yönetimi

from openbuffet_toolkit.hfhelper import HuggingFaceHelper

hf = HuggingFaceHelper(
    hf_username="kullaniciadi",
    hf_token="hf_abc123",
    hf_reponame="proje-adi",
    local_dir="./model"
)

# Repository oluştur
hf.create_repo_if_not_exist()

# Dosya yükle
hf.upload_file("model_bundle.joblib")

# Dosya indir
hf.download_file("model_bundle.joblib", local_dir="./indirilenler")

TextOps ile Metin İşleme

pythonfrom openbuffet_toolkit.textops import TextOps

Türkçe karakterleri ASCII'ye çevirme

text = "Çok güzel bir gün! Şöyle böyle..."
clean_text = TextOps.transliterate_turkish(text)
print(clean_text)  # "Cok guzel bir gun! Soyle boyle..."

Unicode normalizasyon

normalized = TextOps.normalize_unicode("Café naïve résumé")

Noktalama işaretlerini kaldırma

no_punct = TextOps.remove_punctuation("Merhaba, dünya!")
print(no_punct)  # "Merhaba dünya"

Boşlukları düzenleme

clean_spaces = TextOps.simplify_spaces("Çok    fazla\n\nboşluk\t\tvar")
print(clean_spaces)  # "Çok fazla boşluk var"

Tümünü bir arada temizleme

messy_text = "  Çağdaş    Türkiye'de...  teknoloji!!!  \n\n"
clean_result = TextOps.clean(
    messy_text,
    use_transliterate=True,    # Türkçe karakterleri çevir
    use_unicode=True,          # Unicode normalize et
    use_punctuation=True,      # Noktalama kaldır
    use_spaces=True,           # Boşlukları düzenle
    strip_result=True          # Baş/son boşlukları temizle
)
print(clean_result)  # "Cagdas Turkiyede teknoloji"

Testler

Projeyi test etmek için:

pytest tests/

Katkı ve İletişim

Bu proje açık kaynaklıdır ve katkılara açıktır. Geri bildirim veya katkı için lütfen GitHub üzerinden issue oluşturun veya pull request gönderin.

Lisans

Bu proje MIT Lisansı ile lisanslanmıştır.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

openbuffet_toolkit-0.2.1.tar.gz (10.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

openbuffet_toolkit-0.2.1-py3-none-any.whl (10.7 kB view details)

Uploaded Python 3

File details

Details for the file openbuffet_toolkit-0.2.1.tar.gz.

File metadata

  • Download URL: openbuffet_toolkit-0.2.1.tar.gz
  • Upload date:
  • Size: 10.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.3

File hashes

Hashes for openbuffet_toolkit-0.2.1.tar.gz
Algorithm Hash digest
SHA256 b08e370574e47ab39ceb75538b4bcd6e5db1380cdc96267aac9bec137056b3fe
MD5 19697f6be82ffeae9c50c9b410f10067
BLAKE2b-256 daf8fe4084ba3eefcdd6cd9671944db846c551391e7ad40827af6356cb561cde

See more details on using hashes here.

File details

Details for the file openbuffet_toolkit-0.2.1-py3-none-any.whl.

File metadata

File hashes

Hashes for openbuffet_toolkit-0.2.1-py3-none-any.whl
Algorithm Hash digest
SHA256 c32e82b7a58624ad6c638cc7b15348abc3a61045b0411bb65fddaeba759f4f53
MD5 bbe9d57d3dadeb69490077b4ed956e81
BLAKE2b-256 2d53498cb2f078e0861156b1f05a4626e9b17d3512aa4e18845a9b91096cab62

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page