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.6.tar.gz (33.8 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.6-py3-none-any.whl (30.7 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: taskdog_client-0.18.6.tar.gz
  • Upload date:
  • Size: 33.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for taskdog_client-0.18.6.tar.gz
Algorithm Hash digest
SHA256 2deafc10ee7bd03155e0dee084bc70ca8765c8e80db834c53976521711163868
MD5 3d13005c54c1a39a980b222d7bd1c77f
BLAKE2b-256 c80b9593dd0bfbe072e3b6fc186ca758f85fabbfb7dcebaecb2a0312af2c1aa1

See more details on using hashes here.

Provenance

The following attestation bundles were made for taskdog_client-0.18.6.tar.gz:

Publisher: release.yml on Kohei-Wada/taskdog

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

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

File metadata

  • Download URL: taskdog_client-0.18.6-py3-none-any.whl
  • Upload date:
  • Size: 30.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for taskdog_client-0.18.6-py3-none-any.whl
Algorithm Hash digest
SHA256 4e91d576650111642b5ca6d6b7c7ddd0a18784881d9861396f9dbe970b2fe1d9
MD5 fcc246990e6b8ca3f7c83dbf6b769f78
BLAKE2b-256 e4d196dd20a4b0272abea9950c25061e8add222d6a7b71ca233a5def0bd118d0

See more details on using hashes here.

Provenance

The following attestation bundles were made for taskdog_client-0.18.6-py3-none-any.whl:

Publisher: release.yml on Kohei-Wada/taskdog

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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