Skip to main content

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

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.1.tar.gz (14.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

klozeo-0.1.1-py3-none-any.whl (20.7 kB view details)

Uploaded Python 3

File details

Details for the file klozeo-0.1.1.tar.gz.

File metadata

  • Download URL: klozeo-0.1.1.tar.gz
  • Upload date:
  • Size: 14.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.7

File hashes

Hashes for klozeo-0.1.1.tar.gz
Algorithm Hash digest
SHA256 b42ec7920440d77327fbc451126ddc44ece496d457375fabe254372d6632106d
MD5 58d65260f9071fa6d05dda12e290207e
BLAKE2b-256 2b7d9516fa6ceba7e1739519abe09bcbe250621e11e16ce2196c490647ff8312

See more details on using hashes here.

File details

Details for the file klozeo-0.1.1-py3-none-any.whl.

File metadata

  • Download URL: klozeo-0.1.1-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.13.7

File hashes

Hashes for klozeo-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 eccba85aa4bc7d63cc3f8d3b788e96c5fb54c4680cdd8d4d5606abe98479bafc
MD5 551fc82a9076213b0982b2dcf03a997c
BLAKE2b-256 d6fa0582249434c32cdb8e24df30e985b384cc3f83cc2aa2185a1aebd3dd3e12

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page