Official Python SDK for the Klozeo Lead Management API
Project description
Klozeo Python SDK
Official Python client for the Klozeo Lead Management API.
Installation
pip install klozeo
Requires Python 3.10+.
Quick Start
from klozeo import Klozeo, Lead
client = Klozeo("sk_live_your_api_key")
# Create a lead
resp = client.create(Lead(
name="Acme Corporation",
source="website",
city="San Francisco",
email="contact@acme.com",
rating=4.5,
tags=["enterprise", "saas"],
))
print(f"Created: {resp.id}")
# List with filters
from klozeo import city, rating, SortField, SortOrder
result = client.list(
city().eq("Berlin"),
rating().gte(4.0),
sort_by=SortField.RATING,
sort_order=SortOrder.DESC,
limit=20,
)
for lead in result.leads:
print(f"{lead.name} — score: {lead.score}")
# Paginate automatically
for lead in client.iterate(city().eq("Berlin")):
print(lead.name)
Async Client
import asyncio
from klozeo import AsyncKlozeo, Lead
async def main():
async with AsyncKlozeo("sk_live_your_api_key") as client:
resp = await client.create(Lead(name="Acme", source="website"))
async for lead in client.iterate(city().eq("Berlin")):
print(lead.name)
asyncio.run(main())
Error Handling
from klozeo import NotFoundError, RateLimitedError, ForbiddenError, KlozeoError
try:
lead = client.get("cl_nonexistent")
except NotFoundError:
print("Lead not found")
except RateLimitedError as e:
print(f"Rate limited. Retry after {e.retry_after}s")
except ForbiddenError:
print("Leads limit reached — upgrade your plan")
except KlozeoError as e:
print(f"HTTP {e.status_code}: {e.message}")
Links
- Documentation: https://docs.klozeo.com
- API Reference: https://docs.klozeo.com/api/leads
- PyPI: https://pypi.org/project/klozeo
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
klozeo-0.1.0.tar.gz
(14.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
klozeo-0.1.0-py3-none-any.whl
(20.7 kB
view details)
File details
Details for the file klozeo-0.1.0.tar.gz.
File metadata
- Download URL: klozeo-0.1.0.tar.gz
- Upload date:
- Size: 14.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.14.2
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
1c36ec09419a53cc1bbd73e2cbd33b1abee3e2e4a0eb2c5f0269018fc5c5b606
|
|
| MD5 |
9d489aa34b6029b8d4bad218faa4a999
|
|
| BLAKE2b-256 |
2c1a07b5606b6090b38b9efac6abe6de1902db75cfcd15db013b87b02d742389
|
File details
Details for the file klozeo-0.1.0-py3-none-any.whl.
File metadata
- Download URL: klozeo-0.1.0-py3-none-any.whl
- Upload date:
- Size: 20.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.14.2
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
06db555050118243a2ddc1fd2aa23facb38aa427a6ded550d9f39053d1e12e5a
|
|
| MD5 |
17f374fc60679bd6ce205f1b8668af8c
|
|
| BLAKE2b-256 |
d6133fc7dbd6cad9d91ac1b016af43b9af6d314851cb1cdbf22b70ec498c0622
|