Official Bulutklinik API SDK for Python
Project description
bulutklinik-sdk
Official Bulutklinik API SDK for Python. Sync and async (httpx), fully typed
(py.typed), Python 3.9+.
Covers the patient flow: auth, doctor search, slots, appointments, payments,
and health measures. See DESIGN.md for the full wire contract.
Install
pip install bulutklinik-sdk
Quick start (sync)
from bulutklinik import BulutklinikClient
with BulutklinikClient(
environment="production", # "production" | "test" | "local"
client_id="…",
client_secret="…",
) as client:
# 1) Log in (tokens are stored automatically)
login = client.auth.connect("patient@example.com", "•••••••", "email")
if login.two_factor_required:
client.auth.connect_with_two_factor("123456", login.two_factor_response)
# 2) Find a doctor
result = client.doctors.search(
search_params={"withFreeText": "kardiyoloji"},
order_params=["slot"],
other_params=["isInterviewable"],
)
# 3) Slots, then 4) reserve ("YYYY-MM-DD HH:mm")
doctor_id = result["foundDoctors"][0]["doctor_id"]
slots = client.slots.schedule(doctor_id, "interview")
client.appointments.reserve_interview(doctor_id, "2026-06-20 14:30")
Quick start (async)
from bulutklinik import AsyncBulutklinikClient
async with AsyncBulutklinikClient(environment="production", client_id="…", client_secret="…") as client:
await client.auth.connect("patient@example.com", "•••••••", "email")
result = await client.doctors.search(search_params={"withFreeText": "kardiyoloji"})
Services
| Group | Methods |
|---|---|
client.auth |
connect, connect_with_two_factor, register, refresh, disconnect |
client.doctors |
branches, locations, quick_search, search, detail |
client.slots |
schedule |
client.appointments |
reserve_interview, add_physical, cancel |
client.payments |
check_discount_code, get_cards, save_card, pay, delete_card |
client.measures |
add_list, add, update, delete, last, list, graph, partner_health_information |
The async client exposes the same methods (awaitable) under the same names.
Authentication & tokens
connect/connect_with_two_factor/registerstore the access + refresh tokens automatically.- On a
401(orresultType 4), the SDK silently refreshes once and retries. - Provide a custom token store by implementing
bulutklinik.TokenStoreand passing it viatoken_store=….
Payments (3-D Secure)
payments.pay(...) returns a dict with payment3DUrl on a 3DS flow. Open that URL
in a browser; the bank → server callback completes the capture. The SDK never
opens or parses the URL.
Health measures
client.measures.add_list([
{"type": "tension", "date_time": "2026-06-17 09:30", "hypertension": 120, "hypotension": 80},
{"type": "glucose", "date_time": "2026-06-17 09:35", "glucose": 95, "glucose_type": 0},
])
client.measures.last()
client.measures.list("glucose", 1, 0) # glucose_type 0=fasting, 1=postprandial
client.measures.graph("tension", 2, 1) # period 2 = weekly
The partner endpoint (
partner_health_information) usespartner_tokenfrom the client config. The API currently matches the patient byphone_number; pass bothidentityandphone_numberfor forward compatibility.
Errors
All errors subclass bulutklinik.BulutklinikError:
TransportError (network) · ApiError → ValidationError (422),
AuthenticationError (401 / logout), AuthorizationError (403),
NotFoundError (404), RateLimitError (429, .retry_after).
Attributes: http_status, result_type, error_type, data, method, path,
retry_after.
from bulutklinik import RateLimitError, ValidationError
try:
client.payments.pay(doctor_id, "2026-06-20 14:30", is_3d=True, terms_accept=True, card_id=5)
except RateLimitError as exc:
print("retry after", exc.retry_after)
except ValidationError as exc:
print("invalid:", exc.data)
Development
pip install -e ".[dev]"
ruff check .
ruff format --check .
mypy
pytest
License
MIT
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file bulutklinik_sdk-0.2.0.tar.gz.
File metadata
- Download URL: bulutklinik_sdk-0.2.0.tar.gz
- Upload date:
- Size: 26.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
d1da1e27a327200e0250391210728da06db858b5af5e7a11e411d81f16a1d6af
|
|
| MD5 |
94b1e185932a93b372867df2d056661f
|
|
| BLAKE2b-256 |
b1315414484611d3948f3bbf895f0b1d43e1919838946d06db549c9bf29ad015
|
Provenance
The following attestation bundles were made for bulutklinik_sdk-0.2.0.tar.gz:
Publisher:
publish.yml on bulutklinik/python-sdk
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
bulutklinik_sdk-0.2.0.tar.gz -
Subject digest:
d1da1e27a327200e0250391210728da06db858b5af5e7a11e411d81f16a1d6af - Sigstore transparency entry: 1869365132
- Sigstore integration time:
-
Permalink:
bulutklinik/python-sdk@83cb1a2535375ab0710b268c18955ceb9fba2e55 -
Branch / Tag:
refs/tags/v0.2.0 - Owner: https://github.com/bulutklinik
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@83cb1a2535375ab0710b268c18955ceb9fba2e55 -
Trigger Event:
push
-
Statement type:
File details
Details for the file bulutklinik_sdk-0.2.0-py3-none-any.whl.
File metadata
- Download URL: bulutklinik_sdk-0.2.0-py3-none-any.whl
- Upload date:
- Size: 17.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
d5cb806e2392751323e57f6e7eed157f058d120752b18cb1047b64c865942fb8
|
|
| MD5 |
08d7c67897e8662627fceed500c85484
|
|
| BLAKE2b-256 |
6d9789acf1355c77e699ab9379a4b5a37169ec4c376786cbd18517c8731f0a4f
|
Provenance
The following attestation bundles were made for bulutklinik_sdk-0.2.0-py3-none-any.whl:
Publisher:
publish.yml on bulutklinik/python-sdk
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
bulutklinik_sdk-0.2.0-py3-none-any.whl -
Subject digest:
d5cb806e2392751323e57f6e7eed157f058d120752b18cb1047b64c865942fb8 - Sigstore transparency entry: 1869365234
- Sigstore integration time:
-
Permalink:
bulutklinik/python-sdk@83cb1a2535375ab0710b268c18955ceb9fba2e55 -
Branch / Tag:
refs/tags/v0.2.0 - Owner: https://github.com/bulutklinik
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@83cb1a2535375ab0710b268c18955ceb9fba2e55 -
Trigger Event:
push
-
Statement type: