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.3.tar.gz (15.0 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.3-py3-none-any.whl (20.7 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: klozeo-0.1.3.tar.gz
  • Upload date:
  • Size: 15.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for klozeo-0.1.3.tar.gz
Algorithm Hash digest
SHA256 e67525266b5c8f20b95f95c0f7a8f4119131eae3a8a8753aa29b4967cb5b7a3d
MD5 6cc6ded9c58ac4725e04a45ff40250b9
BLAKE2b-256 6467fc4b2819fe4b9a9fd6bf353c93d9eebf247c579948c7d39fd692200fbc1e

See more details on using hashes here.

Provenance

The following attestation bundles were made for klozeo-0.1.3.tar.gz:

Publisher: release.yml on lbframe/klozeo-sdk-python

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

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

File metadata

  • Download URL: klozeo-0.1.3-py3-none-any.whl
  • Upload date:
  • Size: 20.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for klozeo-0.1.3-py3-none-any.whl
Algorithm Hash digest
SHA256 d05c3e10cb630e879d49398b59d905ee2bc23af184bf3e15221d64a58c72ae76
MD5 8d5af91e381a6b15d57a21b21b3f0a94
BLAKE2b-256 b7f72c86d42cd734851df5dba0e5d7d18e9e370a71e25623773ee3fe4e74a69e

See more details on using hashes here.

Provenance

The following attestation bundles were made for klozeo-0.1.3-py3-none-any.whl:

Publisher: release.yml on lbframe/klozeo-sdk-python

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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