Skip to main content

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

Project description

OpenBuffet Toolkit

GitHub Tag PyPI - Version GitHub License GitHub code size in bytes

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.2.tar.gz (10.4 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.2-py3-none-any.whl (10.8 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: openbuffet_toolkit-0.2.2.tar.gz
  • Upload date:
  • Size: 10.4 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.2.tar.gz
Algorithm Hash digest
SHA256 d3a3c2d19b1be42c2dfbbdbeef6de2ee9bbd125a0f3a7c3dcba92ad9a78955eb
MD5 31e85fdf34be8891e54ed93538cc1091
BLAKE2b-256 742fe1503206aa32d401e8ef45e66bace8e94c276f5a15d4aa4d90c3f8c933f0

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for openbuffet_toolkit-0.2.2-py3-none-any.whl
Algorithm Hash digest
SHA256 44b84e8a1b7aedae4e33e36f3c0e7e72e061a541da63b2dade0d5203a6423fb9
MD5 dadd3d3fd0ec006fa5aa24573ab0fd40
BLAKE2b-256 301326becd6984ec483cd23d8e71e06a197a18bbcdd70b4667f5284267b13dcc

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