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.2.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.2-py3-none-any.whl (20.7 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: klozeo-0.1.2.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.2.tar.gz
Algorithm Hash digest
SHA256 23d012abdd781009386f2df14c105026cc469d71a3e6d7d21b7d7d3902bfd91c
MD5 ba0a869683f49b7d350c639c9712c666
BLAKE2b-256 2150c76a78e376290477797aefc8e48c543d14c30c12387094782cd389eac0ac

See more details on using hashes here.

Provenance

The following attestation bundles were made for klozeo-0.1.2.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.2-py3-none-any.whl.

File metadata

  • Download URL: klozeo-0.1.2-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.2-py3-none-any.whl
Algorithm Hash digest
SHA256 46dd8f6e0fa4ece02b10caf6448a16e8e18a6c1325df3cdeb618a89e1cc865c1
MD5 32491e6f8f513cbcaf5c41540285d34c
BLAKE2b-256 3448228b912e1bb16e30da00883694ecf5907e921ba2ac3f279627bba097d1a5

See more details on using hashes here.

Provenance

The following attestation bundles were made for klozeo-0.1.2-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