Türkçe Caps Arşivi Python SDK ve CLI aracı
Project description
capsarsiv
Türkçe Caps Arşivi Python SDK ve CLI aracı.
Türkçe Caps Arşivi API'sine erişmek için Python SDK ve komut satırı aracı.
Kurulum
pip install capsarsiv
API Key
API key almak için:
- capsarsiv.com/uyelik sayfasından giriş yapın.
- Hesap altındaki developer API bölümünde API key oluştur'a tıklayın.
- Key yalnızca oluşturulduğu anda bir kez gösterilir; güvenli bir yerde saklayın.
Key'inizi ortam değişkeni olarak ayarlayın:
export CAPSARSIV_API_KEY="senin_api_keyin"
Python SDK
from capsarsiv import CapsArsiv
# Context manager ile kullanım (önerilir)
with CapsArsiv() as client:
# Capsleri listele
caps_list = client.caps(sort="popular", limit=10)
for c in caps_list:
print(f"{c.title} — puan: {c.score}")
# Arama yap
results = client.caps(q="futbol", sort="popular")
# Tag ile filtrele
spor_caps = client.caps(tag="spor", limit=5)
# Rastgele caps getir
rastgele = client.random()
print(f"Rastgele: {rastgele.title}")
# Slug ile detay getir
caps = client.get("ornek-caps")
print(caps.image_url)
# Tagleri listele
tags = client.tags(limit=20)
for t in tags:
print(f"#{t.name} ({t.count} caps)")
# Caps görselini indir
filepath = client.download("ornek-caps", directory="./caps")
print(f"İndirildi: {filepath}")
API Key'i parametre olarak verme
client = CapsArsiv(api_key="senin_api_keyin")
CLI Kullanımı
# Capsleri listele
capsarsiv caps
capsarsiv caps --sort popular --limit 10
capsarsiv caps --query futbol
capsarsiv caps --tag spor
# Rastgele caps
capsarsiv random
# Caps detayı
capsarsiv get ornek-caps
# Tagleri listele
capsarsiv tags
capsarsiv tags --limit 20
# Caps görselini indir
capsarsiv download ornek-caps
capsarsiv download ornek-caps -o ./caps/
# JSON çıktı
capsarsiv --json caps --limit 5
capsarsiv --json random
# Yardım
capsarsiv --help
capsarsiv caps --help
CLI ile API Key
# Ortam değişkeni (önerilir)
export CAPSARSIV_API_KEY="senin_api_keyin"
capsarsiv caps
# Parametre olarak
capsarsiv --api-key "senin_api_keyin" caps
Hata Yönetimi
from capsarsiv import CapsArsiv, NotFoundError, RateLimitError, AuthenticationError
with CapsArsiv() as client:
try:
caps = client.get("olmayan-caps")
except NotFoundError:
print("Caps bulunamadı!")
except RateLimitError:
print("İstek limiti aşıldı, lütfen bekleyin.")
except AuthenticationError:
print("API key geçersiz!")
API Limitleri
- Dakikada en fazla 60 istek
- Aylık 1000 istek (key başına)
Lisans
MIT — detaylar için LICENSE dosyasına bakın.
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
capsarsiv-0.1.0.tar.gz
(13.7 kB
view details)
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
capsarsiv-0.1.0-py3-none-any.whl
(11.0 kB
view details)
File details
Details for the file capsarsiv-0.1.0.tar.gz.
File metadata
- Download URL: capsarsiv-0.1.0.tar.gz
- Upload date:
- Size: 13.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.9.25
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
2fc8b20a0458f4d4c74a09c9dd88f25cc746d689e19576b4efef824adb4c65f1
|
|
| MD5 |
e5f5edb0524d28238b216104bec4f16c
|
|
| BLAKE2b-256 |
86599e21491d7d2837653712939847802f80c5376b88a92b579ce723e150d880
|
File details
Details for the file capsarsiv-0.1.0-py3-none-any.whl.
File metadata
- Download URL: capsarsiv-0.1.0-py3-none-any.whl
- Upload date:
- Size: 11.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.9.25
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
6ebb20c3c3d6edfd3bc67ae8b42e791aedd365e1efea189759d170129fd83d80
|
|
| MD5 |
d83521ee325a6c71f37a648f817c5981
|
|
| BLAKE2b-256 |
648345490262e452c74c99a23ed2bfe1c60519fb538095be897ee2beda2bf06d
|