tdk-py
Python API for the Turkish Language Foundation
tdk-py is a Python package allowing access to Turkish dictionaries of the TDK, the Turkish Language Association.
tdk-py provides both synchronous and asynchronous interfaces to the TDK's
APIs and parses their responses into Python class objects based on Pydantic,
so you can do things like
.model_dump_json()
them, or use them in your API endpoints and generate beautiful schemas.
Quick start
tdk-py is supported on Python 3.10+. First, make sure you have a Python environment set up.
# in the shell
poetry add tdk-py # if using python-poetry.org (recommended)
pipenv install tdk-py # if using pipenv.pypa.io
pip install tdk-py # straight pip.pypa.io
# in Python
import tdk
Examples
import tdk
results = tdk.search_gts_sync("merkeziyetçilik")
print(results[0].meanings[0].meaning)
Otoritenin ve işin tek bir merkezde toplanmasını amaçlayan görüş; merkeziyet, merkezcilik
You can query suggestions for misspelt words or for other similar words.
from difflib import get_close_matches
import tdk
# Calculate suggestions locally using the index:
words = get_close_matches("feldispat", tdk.get_gts_index_sync())
assert words == ['feldspat', 'ispat', 'fesat']
# Use the TDK API: (sometimes errors out)
words = tdk.get_gts_suggestions_sync("feldispat")
assert words == ['feldspat', 'felekiyat', 'ispat']
You can perform complex analyses very easily. Let's see the distribution of entries by the number of maximum consecutive consonants.
import tdk
annotated_dict = {}
for entry in tdk.get_gts_index_sync():
streaks = tdk.tools.max_streak(entry)
if streaks not in annotated_dict:
annotated_dict[streaks] = [entry]
else:
annotated_dict[streaks].append(entry)
for i in set(annotated_dict):
print(i, len(annotated_dict[i]))
0 19
1 15199
2 73511
3 3605
4 68
5 5
License
tdk-py's source code is provided under the MIT License
Copyright © 2021-2026 Emre Özcan
Metadata
Release files for tdk-py 2.0.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| tdk_py-2.0.1.tar.gz | 22.2 kB | With provenance | Details for tdk_py-2.0.1.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| tdk_py-2.0.1-py3-none-any.whl | Python 3 | none | any | Details for tdk_py-2.0.1-py3-none-any.whl |
Total release size: 52.8 kB
Release files / tdk_py-2.0.1.tar.gz
| Download URL | tdk_py-2.0.1.tar.gz |
|---|---|
| Size | 22.2 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
e4e03133d1009e339bcb91aca1bf78e45b43ff71ee5b990ce04d3b079d099fa0
|
|
BLAKE2b-256 checksum How to use checksums |
5305ab10aeab208788b2512d1864d9163b83e90211f3e2d8cb7c9eccc3d945e6
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.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 Aug 7, 2026.
Transparency logRelease files / tdk_py-2.0.1-py3-none-any.whl
| Download URL | tdk_py-2.0.1-py3-none-any.whl |
|---|---|
| Size | 30.6 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
cf25c98ec784e35b5f8786b206c734d3cd964e79087f046f57f3d0ee9e7c467b
|
|
BLAKE2b-256 checksum How to use checksums |
a2fc22d3a8922be9b85d7f4358dd5cf641240e8c5c1a181648f69a28923d4977
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.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 Aug 7, 2026.
Transparency logSecurity for tdk-py 2.0.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.
Full provenance
Both files in this release have been uploaded with provenance metadata.
Attestation for tdk_py-2.0.1.tar.gz
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 Aug 7, 2026.
Transparency logA 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.