PostHubify resmî Python SDK'sı — sosyal medya yayını, gelen kutusu, kişiler, reklam ve telekom (SMS/OTP) API'si.
Project description
PostHubify Python SDK
PostHubify /v1 API'sinin resmî Python istemcisi — sosyal medya yayını, gelen kutusu,
kişiler, analitik, reklam (ads) ve telekom (SMS/OTP) için tek paket.
- Sıfır runtime bağımlılığı — yalnızca Python standart kütüphanesi (
urllib). - Tam yüzey —
/v1spec'inin 190+ operasyonu birebir kapsanır (kontrat testiyle doğrulanır). - Python 3.8+
Kurulum
pip install posthubify
Hızlı başlangıç
from posthubify import Posthubify, PosthubifyError
ph = Posthubify(api_key="sk_...", base_url="https://api.posthubify.com/v1")
# Bağlantı testi
print(ph.ping()) # {"pong": True, "version": "v1", ...}
# Gönderi yayınla
draft = ph.posts.create({
"content": "Merhaba dünya!",
"accountIds": ["acc_123"],
})
# Gelen kutusu analitiği
vol = ph.inbox_analytics.volume(from_date="2026-06-01", to_date="2026-06-14")
print(vol["summary"]) # {"received": ..., "sent": ..., ...}
# Reklam kampanyası
camps = ph.ads.campaigns("adacc_1", status="enabled")
# Hata yönetimi
try:
ph.posts.get("yok")
except PosthubifyError as e:
print(e.status, e.message, e.code) # 404 "..." "..."
Resource grupları
İstemci, Node SDK'sıyla birebir aynı yüzeyi snake_case niteliklerle sunar:
profiles · accounts · posts · media · tools · ads · insights ·
platform_analytics · inbox_analytics · inbox · comments · reviews ·
contacts · automations · broadcasts · sequences · webhooks · api_keys ·
queue (.schedules) · account_groups · engagement (.x) · users ·
invite_tokens · numbers · senders · sms · otp
Üst seviye: ph.openapi(), ph.ping(), ph.me(), ph.analytics(),
ph.analytics_posts(), ph.analytics_timeseries(), ph.logs(), ph.usage().
Medya yükleme
with open("logo.png", "rb") as f:
asset = ph.media.upload(f.read(), filename="logo.png")
print(asset["url"])
Geliştirme
cd packages/python-sdk
python3 -m unittest discover -s tests # kontrat + transport testleri
Kontrat testi (tests/test_contract.py) her SDK metodunun ürettiği uç yolunun
OpenAPI spec'inde (tests/openapi.json) tanımlı olduğunu doğrular. Spec fixture'ı
yeni uç eklendiğinde güncellemek için repo kökünden:
npx tsx -e "import {buildOpenApiSpec} from './apps/server/src/openapi.ts'; \
import {writeFileSync} from 'node:fs'; \
writeFileSync('packages/python-sdk/tests/openapi.json', JSON.stringify(buildOpenApiSpec(),null,2))"
Lisans
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 posthubify-0.1.0.tar.gz.
File metadata
- Download URL: posthubify-0.1.0.tar.gz
- Upload date:
- Size: 29.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.9.6
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
6ef8f6f59f3ab11781e18025d2770ccf623db22a1fbdc394e786232413bf7a0e
|
|
| MD5 |
8ace6b97d2b21f3d44e75db4c2352f8d
|
|
| BLAKE2b-256 |
d60cbf8aa8afac832796e9cc97939c1a704b17451ab038464fd8672a8ae71914
|
File details
Details for the file posthubify-0.1.0-py3-none-any.whl.
File metadata
- Download URL: posthubify-0.1.0-py3-none-any.whl
- Upload date:
- Size: 29.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.9.6
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
4a70f14a048efb9dae48545030cddaf86c7f37120288fac58183926d33b8e7d4
|
|
| MD5 |
89ffcbaf2dbc8200996d04d51f9f245a
|
|
| BLAKE2b-256 |
cf7524974f783acc100cef4a8deace52ea46f1f0952539ff40e3d70997480a55
|