Skip to main content

SDK for creating and managing distributed workers and tools with socket.io connectivity

Project description

iq-sdk

A Python SDK for creating and managing distributed workers in IQ Flow orchestration platform.

PyPI version CI License: MIT

Quickstart

# Create project directory
mkdir my_iq_tools_project
cd my_iq_tools_project

# Set up virtual environment
python -m venv .venv
source .venv/bin/activate

# Install iq-sdk
pip install iq-sdk

# Initialize project
iq init .

This creates a complete project with configuration, Docker setup, GitHub Actions, and more.

Next steps:

# Set your password in .env
echo "IQ_SITE_DEFAULT_PASSWORD=secret" >> .env

# Create a tool
iq tool create hello

# Create a worker
iq worker create main --tools hello

# Start the worker
iq worker start main

Full Quickstart Guide

Features

  • Site-Based Configuration - Manage multiple sites with host/env/user/password
  • CLI for Project Scaffolding - Complete setup with iq init
  • Socket.IO Worker Connectivity - Workers connect to one or more sites
  • Secure Secrets Handling - Passwords via ENV or K8s-style file references
  • Configurable Threading - Set thread counts, enable autoscaling
  • Docker Integration - Built-in support for baker-cli

Project Structure

After iq init, you get:

my-project/
├── config/
│   └── settings.yml      # Sites and tool configuration
├── .env                  # Secrets (passwords)
├── .gitignore
├── pyproject.toml
├── build-settings.yml    # Docker build config
├── tools/                # Your tool implementations
├── .devcontainer/        # VS Code DevContainer
├── .github/workflows/    # GitHub Actions
└── docker/               # Dockerfile & compose

CLI Reference

Site Management

iq site list              # List all sites
iq site list --check      # Check connectivity
iq site add prod --host http://prod:3000
iq site drop prod

Tool Management

iq tool create NAME       # Create a tool
iq tool list              # List tools

Worker Management

iq worker list            # Show configured tools/workers
iq worker list --check    # Check tool availability
iq worker start [OPTIONS]

Options:
  --threads, -t INT      Thread count
  --max-threads INT      Max threads (autoscaling)
  --autoscale            Enable autoscaling
  --tool TOOL            Tools to register (repeatable)
  --site, -s SITE        Sites to connect (repeatable)
  --config, -c FILE      Config file

Configuration

Sites (config/settings.yml)

site:
  id: "default"
  host: "http://localhost:3000"
  user: "worker"
  tools:
    - "my-tool"

sites:
  - id: "production"
    host: "http://prod:3000"
    user: "prod-worker"
    tools:
      - "my-tool"

Secrets (.env)

# Direct password
IQ_SITE_DEFAULT_PASSWORD=secret
IQ_SITE_PRODUCTION_PASSWORD=prod-secret

# Or file reference (K8s/Docker secrets)
IQ_SITE_PRODUCTION_PASSWORD_FILE=/run/secrets/prod-password

# For JSON/YAML secrets, extract with _PASSWORD_KEY
IQ_SITE_STAGING_PASSWORD_FILE=/etc/secrets/creds.json
IQ_SITE_STAGING_PASSWORD_KEY=database.password

Environment Override

export IQ_SITE_PRODUCTION_HOST='http://new-host:3000'
export IQ_WORKER__THREADS=8

Documentation

Development

For contributing or local development:

git clone https://github.com/iq-company/iq-sdk.git
cd iq-sdk
python -m venv .venv
source .venv/bin/activate
pip install -e ".[dev]"

# Test your changes
iq init demo
cd demo

Development Guide

License

MIT License - see LICENSE for details.

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

iq_sdk-0.1.0.tar.gz (66.0 kB view details)

Uploaded Source

Built Distribution

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

iq_sdk-0.1.0-py3-none-any.whl (69.9 kB view details)

Uploaded Python 3

File details

Details for the file iq_sdk-0.1.0.tar.gz.

File metadata

  • Download URL: iq_sdk-0.1.0.tar.gz
  • Upload date:
  • Size: 66.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for iq_sdk-0.1.0.tar.gz
Algorithm Hash digest
SHA256 f63b84a2326fa1083732702992e6b83f253ea44d2b17f5a12de63370429b4bc7
MD5 64add5a07edfed8dfb13b2d517a34d2d
BLAKE2b-256 d887a9cc0db48ac6cc830bfb5fc6968c5ab953601b8c1139d4991830d23425d8

See more details on using hashes here.

File details

Details for the file iq_sdk-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: iq_sdk-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 69.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for iq_sdk-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 02e355f1f737888eb086aea84c997c9dfa78782f6af48d116b86f7e060511f9b
MD5 420d8197ac78ccc18f4bb8a0296e75c1
BLAKE2b-256 d735a0f846e6954b17ad7bfd4f7219c9dd06aac820d1c5e7a429b1601b885bd0

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