Skip to main content

turkce-harf

Türkçe harfler için büyük/küçük harf dönüşümü, alfabe sıralaması ve arama anahtarı yardımcıları. Bağımlılığı yoktur.

Python'un standart upper()/lower() fonksiyonları Türkçe'yi bilmez: "i".upper() "I" döndürür, oysa Türkçe'de "İ" olmalıdır.

Kurulum

pip install turkce-harf

Kullanım

from turkce_harf import tr_lower, tr_upper, tr_title, tr_sort_key, tr_fold

tr_upper("istanbul")        # 'İSTANBUL'
tr_lower("ISPARTA")         # 'ısparta'
tr_title("ılık su")         # 'Ilık Su'

sorted(["şapka", "sabun", "ırmak"], key=tr_sort_key)
# ['ırmak', 'sabun', 'şapka']

tr_fold("Kılıç")            # 'kilic'  (yalnızca arama için)

# İngilizce metin için lang="en" kullan
tr_lower("IBM", lang="en")       # 'ibm'
tr_upper("istanbul", lang="en")  # 'ISTANBUL'

Her fonksiyon lang parametresi alır: "tr" (varsayılan) Türkçe kurallarını, "en" standart İngilizce kurallarını uygular. Karışık ya da İngilizce metinde lang="en" kullanmak I harfinin ı'ya dönüşmesini önler.

Fonksiyonlar

Tüm fonksiyonlar lang="tr" (varsayılan) ya da lang="en" alır.

  • tr_lower(text): Türkçe kurallarıyla küçük harf (I → ı, İ → i).
  • tr_upper(text): Türkçe kurallarıyla büyük harf (i → İ, ı → I).
  • tr_title(text): Her kelimenin ilk harfini büyütür, geri kalanı küçültür.
  • tr_sort_key(text): Türkçe alfabe sırasına göre sıralama anahtarı. Alfabe dışı karakterler sona gider.
  • tr_fold(text): Kayıplı arama anahtarı (ı→i, ş→s, ç→c, ğ→g, ö→o, ü→u). Saklanan veri için değil, yalnızca karşılaştırma için kullanın.
  • tr_nfc(text): Metni NFC biçimine getirir.

Geliştirme

pip install -e ".[test]"
pytest

Lisans

MIT

Metadata

Release files for turkce-harf 0.1.1

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

Source distribution (sdist)

Source distribution for turkce-harf 0.1.1
File Size Uploaded Provenance Actions
turkce_harf-0.1.1.tar.gz 5.4 kB Without provenance Details for turkce_harf-0.1.1.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for turkce-harf 0.1.1
File Interpreter ABI Platform Actions
turkce_harf-0.1.1-py3-none-any.whl Python 3 none any Details for turkce_harf-0.1.1-py3-none-any.whl

Total release size: 9.9 kB

Release files / turkce_harf-0.1.1.tar.gz

Download URL turkce_harf-0.1.1.tar.gz
Size 5.4 kB
Tags Source
SHA-256 checksum
How to use checksums
7583a5b756aa8079a9909b3afc87f4e4a08f6504e932c96fd5904fc536250269
BLAKE2b-256 checksum
How to use checksums
132a6a3cf74bd98018a7c8ab3991700250d63d02f5e659bc20ca7736e000cb4d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.18

Release files / turkce_harf-0.1.1-py3-none-any.whl

Download URL turkce_harf-0.1.1-py3-none-any.whl
Size 4.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
8d34affe417a7799525e9ea51c54ac16d4cbe728f768c08ae1c5ae9a77a4e91f
BLAKE2b-256 checksum
How to use checksums
e1ebd0fd4b0638eb502b986288f053e48ec91586581bcc2108eb97590bf31233
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.18

Security for turkce-harf 0.1.1

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.

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