Skip to content

Python SDK: all imports require deeply nested paths with no top-level convenience re-exports #44

@nthmost-orkes

Description

@nthmost-orkes

Summary

Every import in the Python SDK requires the full deep package path. There are no convenience re-exports at conductor or conductor.client level. This makes quickstarts and real code unusually verbose, and is a friction point for every new user.

Current state

A minimal quickstart requires five imports like:

from conductor.client.automator.task_handler import TaskHandler
from conductor.client.configuration.configuration import Configuration
from conductor.client.orkes_clients import OrkesClients
from conductor.client.workflow.conductor_workflow import ConductorWorkflow
from conductor.client.worker.worker_task import worker_task

None of these work:

from conductor import Configuration          # ImportError
from conductor.client import Configuration  # ImportError
from conductor.client import TaskHandler    # ImportError

Why this matters

  • The import block is longer than the actual application logic in a "Hello World"
  • Deep paths like conductor.client.configuration.configuration.Configuration repeat the module name twice (configuration.configuration)
  • Every tutorial/example must repeat these five boilerplate lines verbatim
  • It's a source of copy-paste errors (e.g., using WorkflowExecutor directly instead of going through OrkesClients)

Comparison

Popular Python libraries provide flat or shallow imports:

  • FastAPI: from fastapi import FastAPI, HTTPException
  • Pydantic: from pydantic import BaseModel
  • Celery: from celery import Celery, shared_task

Expected fix

Add re-exports in conductor/client/__init__.py (and optionally conductor/__init__.py) for the most commonly used symbols:

# conductor/client/__init__.py
from conductor.client.configuration.configuration import Configuration
from conductor.client.automator.task_handler import TaskHandler
from conductor.client.orkes_clients import OrkesClients
from conductor.client.workflow.conductor_workflow import ConductorWorkflow
from conductor.client.worker.worker_task import worker_task

This would allow:

from conductor.client import Configuration, TaskHandler, OrkesClients, ConductorWorkflow, worker_task

Fix location

conductor-oss/python-sdksrc/conductor/client/__init__.py

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions