Skip to main content

Official Kadoa SDK for Python - Web data extraction and automation

Project description

Kadoa SDK for Python

Official Python SDK for the Kadoa API, providing easy integration with Kadoa's web data extraction platform.

Installation

We recommend using a virtual environment to avoid dependency conflicts (optional). Use your preferred tool (venv, virtualenv, conda, poetry, uv).

python3 -m venv .venv
source .venv/bin/activate
pip install kadoa-sdk

Getting Started

Obtaining an API Key

  1. Register at kadoa.com
  2. Navigate to your account page
  3. Copy your API key

Quick Start

import logging
from kadoa_sdk import KadoaClient, KadoaClientConfig, ExtractionOptions

logging.basicConfig(level=logging.INFO)
logger = logging.getLogger("kadoa_sdk.examples")

# Initialize the client
client = KadoaClient(KadoaClientConfig(
    api_key="your-api-key"
))

# Run an extraction
result = client.extraction.run(ExtractionOptions(
    urls=["https://example.com"],
    name="My Extraction Workflow"
))

if result:
    logger.info("Workflow created with ID: %s", result.workflow_id)

Configuration

Basic Configuration

client = KadoaClient(KadoaClientConfig(
    api_key="your-api-key",
    base_url="https://api.kadoa.com",  # optional
    timeout=30                         # optional, in seconds
))

Using Environment Variables

KADOA_API_KEY=your-api-key
KADOA_API_URL=https://api.kadoa.com
KADOA_TIMEOUT=30
import os
from dotenv import load_dotenv
from kadoa_sdk import KadoaClient, KadoaClientConfig

load_dotenv()

client = KadoaClient(KadoaClientConfig(
    api_key=os.environ["KADOA_API_KEY"],
    base_url=os.environ.get("KADOA_API_URL", "https://api.kadoa.com"),
    timeout=int(os.environ.get("KADOA_TIMEOUT", "30"))
))

Event Handling

import logging
from kadoa_sdk import KadoaClient, KadoaClientConfig

logging.basicConfig(level=logging.INFO)
logger = logging.getLogger("kadoa_sdk.examples")

client = KadoaClient(KadoaClientConfig(api_key="your-api-key"))

# Listen to events with a lambda and log output
client.on_event(lambda e: logger.info("event: %s", e.to_dict()))

# Event types:
# - entity:detected
# - extraction:started
# - extraction:status_changed
# - extraction:data_available
# - extraction:completed

API Reference

KadoaClient(config: KadoaClientConfig)

  • api_key (required): Your Kadoa API key
  • base_url (optional): API base URL (default: 'https://api.kadoa.com')
  • timeout (optional): Request timeout in seconds (default: 30)

Returns a client instance with:

  • extraction: Extraction module with run() method
  • on_event(): Subscribe to events
  • off_event(): Unsubscribe from events
  • dispose(): Releases resources and removes all event listeners

client.extraction.run(options: ExtractionOptions)

  • urls: List of URLs to extract from
  • name: Workflow name
  • Additional options available in API documentation

Examples

See examples directory for more usage examples.

Requirements

  • Python 3.8+

License

MIT

Support

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

kadoa_sdk-0.6.1.tar.gz (167.1 kB view details)

Uploaded Source

Built Distribution

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

kadoa_sdk-0.6.1-py3-none-any.whl (659.8 kB view details)

Uploaded Python 3

File details

Details for the file kadoa_sdk-0.6.1.tar.gz.

File metadata

  • Download URL: kadoa_sdk-0.6.1.tar.gz
  • Upload date:
  • Size: 167.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.13

File hashes

Hashes for kadoa_sdk-0.6.1.tar.gz
Algorithm Hash digest
SHA256 5117ef1ebf29b48ce819cd0f4aa4a43903ed37b2842b183d1a0227d1828d679b
MD5 208fd2bae124a33b90a03247f354f602
BLAKE2b-256 899b7403d0bb72e1c8ec8b107d2341980deff86f212fa9e4f34360ac1289e808

See more details on using hashes here.

File details

Details for the file kadoa_sdk-0.6.1-py3-none-any.whl.

File metadata

  • Download URL: kadoa_sdk-0.6.1-py3-none-any.whl
  • Upload date:
  • Size: 659.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.13

File hashes

Hashes for kadoa_sdk-0.6.1-py3-none-any.whl
Algorithm Hash digest
SHA256 2a79b9eff3fdfd70d8af35c01bd96fdd0a8cff832c521456551aefd07ff3d66a
MD5 bfc55826b9459c72dcb910b1fe382252
BLAKE2b-256 140ebaa0ee54084363b88d6353955502c5be3f072ca2904596db18401c200bb5

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