Skip to main content

HTTP API client for Taskdog server

Project description

taskdog-client

HTTP API client library for Taskdog server.

Overview

This package provides a type-safe HTTP client for communicating with the Taskdog API server. It handles authentication, error mapping, and response conversion to domain DTOs.

Use cases:

  • Building custom CLI tools
  • Integrating Taskdog with other systems
  • Creating automated workflows
  • Testing API endpoints

Installation

pip install taskdog-client

For development:

pip install -e ".[dev]"

Client Classes

Client Purpose
TaskClient Task CRUD operations (create, update, delete, archive)
LifecycleClient Status changes (start, complete, pause, cancel, reopen)
RelationshipClient Dependencies and tags
QueryClient List tasks, get task details
AnalyticsClient Statistics and Gantt data
NotesClient Task notes (markdown)
AuditClient Audit log access
BaseApiClient Base class with common HTTP logic

Usage Example

from taskdog_client import TaskClient, LifecycleClient, QueryClient

# Create clients
base_url = "http://127.0.0.1:8000"
api_key = "your-api-key"  # Optional, for authenticated servers

task_client = TaskClient(base_url, api_key)
lifecycle_client = LifecycleClient(base_url, api_key)
query_client = QueryClient(base_url, api_key)

# Create a task
task = task_client.create_task(
    name="My Task",
    priority=100,
    estimated_duration=8.0,
    tags=["backend"]
)
print(f"Created task: {task.id}")

# List tasks
tasks = query_client.list_tasks(status="pending")
for t in tasks:
    print(f"- {t.name} (ID: {t.id})")

# Start a task
lifecycle_client.start_task(task.id)

# Complete a task
lifecycle_client.complete_task(task.id)

Error Handling

Clients raise exceptions from taskdog_core.domain.exceptions:

from taskdog_core.domain.exceptions import TaskNotFoundException, TaskValidationError

try:
    task_client.get_task(999)
except TaskNotFoundException:
    print("Task not found")
except TaskValidationError as e:
    print(f"Validation error: {e}")

Configuration

Clients accept optional configuration:

from taskdog_client import TaskClient

# Basic usage (no auth)
client = TaskClient("http://127.0.0.1:8000")

# With API key authentication
client = TaskClient(
    base_url="http://127.0.0.1:8000",
    api_key="your-secret-key"
)

# Custom timeout (in seconds)
client = TaskClient(
    base_url="http://127.0.0.1:8000",
    timeout=30.0
)

Dependencies

  • taskdog-core: Domain DTOs and exceptions
  • httpx: HTTP client library

Related Packages

Testing

pytest tests/

License

MIT

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

taskdog_client-0.18.1.tar.gz (34.3 kB view details)

Uploaded Source

Built Distribution

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

taskdog_client-0.18.1-py3-none-any.whl (30.7 kB view details)

Uploaded Python 3

File details

Details for the file taskdog_client-0.18.1.tar.gz.

File metadata

  • Download URL: taskdog_client-0.18.1.tar.gz
  • Upload date:
  • Size: 34.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.11.0 {"installer":{"name":"uv","version":"0.11.0","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Arch Linux","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for taskdog_client-0.18.1.tar.gz
Algorithm Hash digest
SHA256 4f8e4ebe6d5571f18d2e9d078daa384e362a40fd435616f325134d3e7ae8cf0e
MD5 2d1cbdb0d3adc384abb5b86701e87ae1
BLAKE2b-256 f9a15d9384bf2fd58734eb88423188476eddb9c312f79babf1da6811cb17c702

See more details on using hashes here.

File details

Details for the file taskdog_client-0.18.1-py3-none-any.whl.

File metadata

  • Download URL: taskdog_client-0.18.1-py3-none-any.whl
  • Upload date:
  • Size: 30.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.11.0 {"installer":{"name":"uv","version":"0.11.0","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Arch Linux","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for taskdog_client-0.18.1-py3-none-any.whl
Algorithm Hash digest
SHA256 2f9fc49a3beb652f2f791dc2f713af935cf279ee5a976e33d22554ed2a022a57
MD5 140f4b0a8426fb9de449b25ada0dda7c
BLAKE2b-256 4946f721ace8a2257af4ff5eef4666af7a3d17b01b755855e167feb98fb844da

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