Python SDK
mevzuatradar Python package sync-only v1 client’tır. Runtime dependency
yalnız requests paketidir; async connector ve ERP-specific write-back akışları
müşteri workshop’u sonrasına bırakılır.
Kurulum
Registry kurulumu yalnız kuruma paket erişimi verildiyse kullanılır. Erişim henüz açılmadıysa repo-local build çıktısı artifact olarak alınır ve kurum içi registry’ye taşınır.
pip install mevzuatradarEndpoint Coverage
| SDK method | API path | Auth |
|---|---|---|
get_public_source_stats() | GET /api/v1/public/source-stats | none |
list_public_regulations() | GET /api/v1/public/regulations | none |
list_changes() | GET /api/v1/changes | x-api-key |
list_deadlines() | GET /api/v1/deadlines | x-api-key |
list_actions() | GET /api/v1/actions | x-api-key |
list_verification_reports() | GET /api/v1/verification-reports | x-api-key |
get_verification_report(report_id) | GET /api/v1/verification-reports/:id | x-api-key |
list_board_reports() | GET /api/v1/board-reports | x-api-key |
get_board_report(report_id) | GET /api/v1/board-reports/:id | x-api-key |
get_evidence_pack(evidence_pack_id) | GET /api/v1/evidence-packs/:id | x-api-key |
list_webhooks() | GET /api/v1/webhooks | JWT |
create_webhook() | POST /api/v1/webhooks | JWT |
get_webhook() | GET /api/v1/webhooks/:id | JWT |
update_webhook() | PUT /api/v1/webhooks/:id | JWT |
delete_webhook() | DELETE /api/v1/webhooks/:id | JWT |
test_webhook() | POST /api/v1/webhooks/:id/test | JWT |
rotate_webhook_secret() | POST /api/v1/webhooks/:id/rotate-secret | JWT |
list_webhook_deliveries() | GET /api/v1/webhooks/:id/deliveries | JWT |
Genel API İstemcisi
import os
from mevzuatradar import MevzuatRadarClient
client = MevzuatRadarClient(
api_key=os.environ["MEVZUATRADAR_API_KEY"],
base_url="https://api.mevzuatradar.com",
)
changes = client.list_changes(limit=20, sourceCode="BDDK")
for change in changes["items"]:
print(change["id"], change["title"])Doğrulama Raporları
reports = client.list_verification_reports(
status="VERIFIED",
regulatorCode="BDDK",
limit=10,
)
report = client.get_verification_report(reports["items"][0]["id"])Webhook Yönetimi
Webhook CRUD/test/secret rotation endpointleri admin JWT ister. API key ile webhook management çağrısı yapılmaz.
admin_client = MevzuatRadarClient(
jwt=os.environ["MEVZUATRADAR_ADMIN_JWT"],
)
admin_client.create_webhook(
{
"url": "https://grc.example.com/webhooks/mevzuatradar",
"events": ["NEW_REGULATION", "ACTION_DEADLINE_APPROACHING"],
}
)HMAC Verification
from mevzuatradar import verify_webhook_signature
valid = verify_webhook_signature(
payload=raw_body_bytes,
secret=os.environ["MEVZUATRADAR_WEBHOOK_SECRET"],
signature=headers["x-webhook-signature"],
)
if not valid:
return {"error": "invalid signature"}, 401Error Handling
from mevzuatradar import MevzuatRadarApiError
try:
client.list_changes(sourceCode="BDDK")
except MevzuatRadarApiError as error:
print(error.status, error.request_id, str(error))
raise