Skip to main content

Python SDK for the Kanboard JSON-RPC API — typed models, structured exceptions, and complete API coverage

Project description

kanboard-sdk

Python SDK for the Kanboard JSON-RPC API — typed models, structured exceptions, and complete coverage of all 158 API methods.

Python 3.11+ License: MIT

Installation

pip install kanboard-sdk

Quick Start

from kanboard import KanboardClient

with KanboardClient(url="https://kanboard.example.com/jsonrpc.php",
                     token="your-api-token") as kb:
    # Create a project
    project_id = kb.projects.create_project(name="My Project")

    # Create a task
    task_id = kb.tasks.create_task(
        title="Implement feature X",
        project_id=project_id,
        color_id="green",
        priority=2,
    )

    # Get all active tasks
    tasks = kb.tasks.get_all_tasks(project_id, status_id=1)
    for task in tasks:
        print(f"#{task.id} [{task.color_id}] {task.title}")

Features

  • Complete API coverage — All 158 Kanboard JSON-RPC methods across 24 resource categories
  • Typed models — Dataclass response models with from_api() factory methods that handle Kanboard's type inconsistencies
  • Structured exceptionsKanboardAuthError, KanboardNotFoundError, KanboardAPIError, etc. with rich context
  • Resource-based accessclient.tasks, client.projects, client.columns, etc.
  • Context managerKanboardClient supports with statements for clean resource management
  • Batch callsclient.batch() for sending multiple JSON-RPC requests in one HTTP round-trip
  • Cross-project orchestration — Portfolio management, milestones, dependency analysis, and critical-path computation via kanboard.orchestration
  • Minimal dependencies — Only httpx

Resource Categories

Accessor Methods Description
client.tasks 14 Task CRUD, search, move, duplicate
client.projects 14 Project CRUD, enable/disable, activity
client.board 1 Full board view (columns → swimlanes → tasks)
client.columns 6 Column management and positioning
client.swimlanes 11 Swimlane management
client.comments 5 Task comments
client.categories 5 Project categories
client.tags 7 Global and project tags
client.subtasks 5 Subtask management
client.users 10 User administration
client.links 7 Link type definitions
client.task_links 5 Internal task-to-task links
client.external_task_links 7 External URL links on tasks
client.groups 5 Group management
client.group_members 5 Group membership
client.actions 6 Automatic action configuration
client.project_files 6 Project file attachments
client.task_files 6 Task file attachments
client.project_metadata 4 Project key-value metadata
client.task_metadata 4 Task key-value metadata
client.project_permissions 9 Project user/group permissions
client.subtask_time_tracking 4 Subtask time tracking
client.me 7 Current user (requires user auth)
client.application 7 Application info (version, colors, roles)
client.portfolios 18 Portfolio plugin — portfolio CRUD, project membership, dependency queries (requires plugin)
client.milestones 10 Portfolio plugin — milestone CRUD, task membership, progress (requires plugin)

Exception Hierarchy

KanboardError (base)
├── KanboardConfigError          # Missing/invalid configuration
├── KanboardConnectionError      # Network/connection failures
├── KanboardAuthError            # HTTP 401/403, invalid credentials
├── KanboardAPIError             # JSON-RPC error responses
│   ├── KanboardNotFoundError    # Resource not found (null response)
│   └── KanboardValidationError  # Invalid parameters
└── KanboardResponseError        # Malformed/unparseable responses

Configuration

KanboardClient accepts URL and token directly, or use KanboardConfig.resolve() for layered config resolution (TOML file → environment variables → explicit args):

from kanboard import KanboardClient, KanboardConfig

# Direct
client = KanboardClient(url="...", token="...")

# From config file / env vars
config = KanboardConfig.resolve()
client = KanboardClient(url=config.url, token=config.token)

Environment Variables

Variable Purpose
KANBOARD_URL JSON-RPC endpoint
KANBOARD_TOKEN API token
KANBOARD_PROFILE Active config profile
KANBOARD_OUTPUT_FORMAT Default output format
KANBOARD_AUTH_MODE app (token) or user (username/password)
KANBOARD_USERNAME Username (user auth mode)
KANBOARD_PASSWORD Password (user auth mode)
KANBOARD_PORTFOLIO_BACKEND local (JSON file) or remote (plugin API)

Portfolio Backend (Orchestration)

The orchestration layer (PortfolioManager, DependencyAnalyzer) supports two storage backends. Select via KanboardConfig or the create_backend() factory:

from kanboard import KanboardClient, KanboardConfig, create_backend
from kanboard.orchestration import PortfolioManager

config = KanboardConfig.resolve()  # reads portfolio_backend from env/config file

with KanboardClient(url=config.url, token=config.token) as kb:
    backend = create_backend(config.portfolio_backend, client=kb)
    manager = PortfolioManager(kb, backend)
    tasks = manager.get_portfolio_tasks("My Portfolio")
  • "local" (default) — data stored in ~/.config/kanboard/portfolios.json; no plugin required; machine-local only
  • "remote" — data stored server-side via the Kanboard Portfolio plugin; shared across all users

CLI Companion

For a full command-line interface built on this SDK, install kanboard-cli:

pip install kanboard-cli

Documentation

  • SDK Guide — Full usage guide with examples for every resource
  • Configuration — Config file, env vars, and profiles
  • API Reference — Complete Kanboard JSON-RPC method signatures

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

kanboard_sdk-1.2.1.tar.gz (4.5 kB view details)

Uploaded Source

Built Distribution

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

kanboard_sdk-1.2.1-py3-none-any.whl (80.8 kB view details)

Uploaded Python 3

File details

Details for the file kanboard_sdk-1.2.1.tar.gz.

File metadata

  • Download URL: kanboard_sdk-1.2.1.tar.gz
  • Upload date:
  • Size: 4.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for kanboard_sdk-1.2.1.tar.gz
Algorithm Hash digest
SHA256 fc0180df5e8a337801f12b5070e061c201c8ee1abf32b05b751a44733e43f5e3
MD5 5ab60d014e3fd442556273a10a912cf3
BLAKE2b-256 8f3e7b1cebb89769e96fd984f7e93cf057989182382789938defc584938aaab8

See more details on using hashes here.

Provenance

The following attestation bundles were made for kanboard_sdk-1.2.1.tar.gz:

Publisher: publish.yml on geekmuse/kanboard-cli

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

File details

Details for the file kanboard_sdk-1.2.1-py3-none-any.whl.

File metadata

  • Download URL: kanboard_sdk-1.2.1-py3-none-any.whl
  • Upload date:
  • Size: 80.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for kanboard_sdk-1.2.1-py3-none-any.whl
Algorithm Hash digest
SHA256 0470d2b7c7379ae05e212325cca9ef226980a33423dbf20e89b216eb5f3603ca
MD5 e216b034b491d480c0b1ca320dc6a197
BLAKE2b-256 62aba24ca5a5ea36512c6e5b240a798809afdd298148732d73e18e83a9b8113b

See more details on using hashes here.

Provenance

The following attestation bundles were made for kanboard_sdk-1.2.1-py3-none-any.whl:

Publisher: publish.yml on geekmuse/kanboard-cli

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