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.7.0.tar.gz (167.2 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.7.0-py3-none-any.whl (659.8 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: kadoa_sdk-0.7.0.tar.gz
  • Upload date:
  • Size: 167.2 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.7.0.tar.gz
Algorithm Hash digest
SHA256 3d996b92357bede5ea07a27d2f77538f69b3612c54016755e17708349e976823
MD5 0b1d8155f8ebdcc78dba7a1bd3ea50ca
BLAKE2b-256 ad55a21283b02cc274bc6c685b862fc1526ddffaf4a2ea06237e2dca4f700074

See more details on using hashes here.

File details

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

File metadata

  • Download URL: kadoa_sdk-0.7.0-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.7.0-py3-none-any.whl
Algorithm Hash digest
SHA256 8e317ff45c81b59c6f3b123e73239ff534583ba5b591504e45ae96a8d7cb368e
MD5 82552bb6ef5163dcbf1a9be5a126ef30
BLAKE2b-256 5c7fc4f3b36ab6c46f4e432248aa06302cf532e74b839e1f59d7bc35df03454d

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