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

Uploaded Python 3

File details

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

File metadata

  • Download URL: kadoa_sdk-0.6.0.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.0.tar.gz
Algorithm Hash digest
SHA256 f483ec92a006aacaeed8658653aac4a466d4bd182fc715b98dbae6b5752913e3
MD5 f41a3f2e522a38d1f29500554667a2e2
BLAKE2b-256 fdaf3355064ea817007d22285130ddcbabfedda2c5558a1455a845eb6f5f7994

See more details on using hashes here.

File details

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

File metadata

  • Download URL: kadoa_sdk-0.6.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.6.0-py3-none-any.whl
Algorithm Hash digest
SHA256 01c1af53123a460638955cccd52d8bb262f97f8c3483757ddc9b96b2ad464a91
MD5 9af856754e8d6c6249dc2d3ac93b0886
BLAKE2b-256 d0e252be76061bd8f65c84728548e2ef229a7dc6740b3527a137703af62ce29a

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