Skip to main content

Core business logic and infrastructure for Taskdog

Project description

taskdog-core

Core business logic and infrastructure for Taskdog task management system.

Overview

This package contains the core components shared by both the Taskdog server and UI:

  • Domain Layer: Business entities, domain services, and interfaces
  • Application Layer: Use cases, queries, DTOs, and business logic orchestration
  • Infrastructure Layer: Persistence implementations, external service integrations
  • Controllers: Business logic orchestrators used by presentation layers

Installation

pip install taskdog-core

For development:

pip install -e ".[dev]"

Architecture

Follows Clean Architecture principles:

Domain (entities, services, repositories)
  ↑
Application (use cases, queries, DTOs)
  ↑
Infrastructure (SQLite, file storage)
  ↑
Controllers (orchestration layer)

Key Components

Domain Layer (taskdog_core/domain/):

  • Task - Core entity with status, priority, deadlines, dependencies
  • TaskStatus - PENDING, IN_PROGRESS, COMPLETED, CANCELED
  • TimeTracker - Records actual_start/actual_end timestamps
  • TaskNotFoundException, TaskValidationError - Domain exceptions

Application Layer (taskdog_core/application/):

  • Use Cases: CreateTaskUseCase, StartTaskUseCase, OptimizeScheduleUseCase, etc.
  • Validators: TaskFieldValidatorRegistry with Status and Dependency validators
  • Services: WorkloadAllocator, OptimizationSummaryBuilder, TaskQueryService
  • Optimization: 9 scheduling strategies (greedy, balanced, backward, priority_first, earliest_deadline, round_robin, dependency_aware, genetic, monte_carlo)

Infrastructure Layer (taskdog_core/infrastructure/):

  • SqliteTaskRepository - SQLite persistence with transactional writes
  • SqliteNotesRepository - Database-based notes storage
  • ConfigManager - TOML configuration loading

Controllers (taskdog_core/controllers/):

  • TaskCrudController - Create, update, delete operations
  • TaskLifecycleController - Start, complete, pause, cancel, reopen
  • TaskRelationshipController - Dependencies and tags
  • TaskAnalyticsController - Statistics and optimization
  • QueryController - Read-only operations

Usage Example

from taskdog_core.domain.entities.task import Task, TaskStatus
from taskdog_core.infrastructure.persistence.database.sqlite_task_repository import SqliteTaskRepository
from taskdog_core.controllers.task_crud_controller import TaskCrudController
from taskdog_core.infrastructure.config.config_manager import ConfigManager
from taskdog_core.shared.utils.logger import StandardLogger

# Setup
repository = SqliteTaskRepository("sqlite:///tasks.db")
config = ConfigManager()
logger = StandardLogger("example")

# Create controller
crud_controller = TaskCrudController(repository, config, logger)

# Create a task
from taskdog_core.application.dto.task_request import CreateTaskRequest
request = CreateTaskRequest(name="My Task", priority=100)
task = crud_controller.create_task(request)

Dependencies

  • holidays: Holiday checking for scheduling
  • python-dateutil: Date/time utilities
  • sqlalchemy: Database ORM

Related Packages

For detailed architecture documentation, see CLAUDE.md.

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_core-0.18.1.tar.gz (121.0 kB view details)

Uploaded Source

Built Distribution

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

taskdog_core-0.18.1-py3-none-any.whl (198.7 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: taskdog_core-0.18.1.tar.gz
  • Upload date:
  • Size: 121.0 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_core-0.18.1.tar.gz
Algorithm Hash digest
SHA256 edd914505c93b72e0c39d3a1e676caac61695484043b05fe6baef9390933821f
MD5 800303e26934d94fe9ea5eee0b20595e
BLAKE2b-256 fbd411d62099567e13ecce4126d716b3825151830dd2f4c89098c505ebac42c9

See more details on using hashes here.

File details

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

File metadata

  • Download URL: taskdog_core-0.18.1-py3-none-any.whl
  • Upload date:
  • Size: 198.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_core-0.18.1-py3-none-any.whl
Algorithm Hash digest
SHA256 2c802b7f64be4782cc188698d1060c18aa765d540d196d5bdd9039b1a84fdb12
MD5 e705096072edcc13925fad1e8d870c29
BLAKE2b-256 d531e3dc89f723f7380121608002b48a2191b4f604b88b620ac85f163f35f590

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