Skip to main content

trkit

CI PyPI Python License: MIT

Türkçe metin araçları ve Türkiye'ye özgü doğrulayıcılar. Bağımlılığı hafif, tip bilgisi tam, hem kütüphane hem komut satırı aracı olarak kullanılabilir.

Turkish text utilities and Türkiye-specific validators: locale-correct case conversion, slugify, national ID (TCKN) and IBAN validation, licence-plate lookup. Usable as a library or a CLI.

Neden?

Python'un yerleşik metotları Türkçe'nin noktalı/noktasız i ayrımını bilmez:

"istanbul".upper()   # 'ISTANBUL'  ← yanlış
"IĞDIR".lower()      # 'iğdır'     ← yanlış

trkit bu dönüşümleri doğru yapar ve yanına Türkiye'de sık gereken birkaç doğrulayıcı ekler.

Kurulum

pip install trkit

Kütüphane olarak kullanım

from trkit import upper, lower, title, slugify, asciify
from trkit import is_valid_tckn, is_valid_iban
from trkit import city_from_plate, plate_from_city

upper("istanbul")                 # 'İSTANBUL'
lower("IĞDIR")                    # 'ığdır'
title("izmir kuş cenneti")        # 'İzmir Kuş Cenneti'
asciify("Çiğdem Şahin")           # 'Cigdem Sahin'
slugify("Çığır Açan Şeyler")      # 'cigir-acan-seyler'
slugify("Merhaba Dünya", "_")     # 'merhaba_dunya'

is_valid_tckn("10000000146")                       # True
is_valid_iban("TR33 0006 1005 1978 6457 8413 26")  # True

city_from_plate(35)               # 'İzmir'
plate_from_city("İSTANBUL")       # 34

Komut satırından kullanım

$ trkit slug "Çığır Açan Şeyler"
cigir-acan-seyler

$ trkit upper istanbul
İSTANBUL

$ trkit plaka 35
İzmir

$ trkit plaka İzmir
35

$ trkit tckn 10000000146
geçerli

Doğrulama komutları anlamlı çıkış kodu döndürür (geçerli → 0, geçersiz → 1), böylece kabuk betiklerinde doğrudan kullanılabilir:

if trkit iban "$IBAN" > /dev/null; then
    echo "IBAN kabul edildi"
fi

Tüm komutlar için: trkit --help

API

Fonksiyon Açıklama
upper(text) Türkçe kurallarına göre BÜYÜK harf
lower(text) Türkçe kurallarına göre küçük harf
title(text) Her Kelimenin İlk Harfi Büyük
asciify(text) Türkçe harfleri ASCII'ye indirger
slugify(text, separator="-") URL'de kullanılabilir slug üretir
is_valid_tckn(value) TC kimlik no algoritma kontrolü
is_valid_iban(value) Türkiye IBAN mod-97 kontrolü
city_from_plate(code) Plaka kodu → il adı
plate_from_city(city) İl adı → plaka kodu
PLATES {kod: il} sözlüğü (81 il)

is_valid_tckn yalnızca matematiksel bir kontroldür; numaranın gerçekten birine ait olduğunu göstermez.

Geliştirme

git clone https://github.com/ardazeybek-dev/trkit.git
cd trkit
python -m venv .venv
.venv\Scripts\activate        # Linux/macOS: source .venv/bin/activate
pip install -e ".[dev]"

pytest                          # testler
ruff check .                    # lint

Lisans

MIT © Arda Zeybek

Metadata

Release files for trkit 0.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 trkit 0.1.0
File Size Uploaded
trkit-0.1.0.tar.gz 10.5 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for trkit 0.1.0
File Interpreter ABI Platform
trkit-0.1.0-py3-none-any.whl Python 3 none any Details

Total release size: 20.5 kB

Release files / trkit-0.1.0.tar.gz

Download URL trkit-0.1.0.tar.gz
Size 10.5 kB
Tags Source
SHA-256 checksum
How to use checksums
fc5118c6bf9974d6fe77acff30cc3f5b11f2d3d3dda159d0738f1dd18767afd7
BLAKE2b-256 checksum
How to use checksums
09fa710d8e1be042d53640d80c6dd574d6f870cbc9c5b2fcf6471acdf9b9a14d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.14

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Jul 29, 2026.

Transparency log

Release files / trkit-0.1.0-py3-none-any.whl

Download URL trkit-0.1.0-py3-none-any.whl
Size 10.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
dee689a77f3f7b09ced00818dbb9580b521e3e0d73f55cc3b65d580b858a4bfd
BLAKE2b-256 checksum
How to use checksums
c56dd9f4d1b2405c9c12dc0de31e00e2f1878f004e0de5a788c38ef016707e92
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.14

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Jul 29, 2026.

Transparency log

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 release files

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