Skip to main content

kanban-core

Tests

A framework-independent Kanban business module for Python 3.10+.

This is not a Kanban board app. It's the engine underneath one — boards, columns, cards, moves, workflow rules, permissions, automation and events — with no UI and no database of its own. You supply persistence, authorization and an interface; kanban-core guarantees the board behaves correctly underneath them.

Board mechanics — moving cards, enforcing WIP limits, tracking state — get rewritten in nearly every Kanban tool because it's hard to find an implementation with no UI or database bolted on. kanban-core is that missing piece.

Your application talks to one public business API, KanbanFacade. The module owns its business state and invariants; persistence, authorization, search, automation and event delivery are supplied from outside at composition time.

kanban-core system boundary: applications call KanbanFacade, while infrastructure supplies replaceable contracts

What's included

  • Boards, columns and cards, with move validation, WIP limits, card ordering and dependency-cycle checks
  • Configurable workflow policies for deployment-specific rules
  • Permission checks via an injected policy — not hardcoded into the module
  • Search over cards via a pluggable searcher
  • Automation that reacts to events and proposes actions
  • An event system for audit trails, outboxes and integrations
  • Deterministic testing support via injected clock and ID factory
  • Opaque card attributes, external block reasons, and shared WIP limits
  • Card age queries and bounded host-scheduled automation ticks
  • Historical board import and transactional attribute patches
  • Zero dependencies outside the Python standard library

Installation

pip install kanban-core

Quick example

from kanban import KanbanFacade
from kanban_adapters import (
    EventBus,
    InMemoryKanbanRepository,
    SynchronousKanbanUnitOfWork,
)

repository = InMemoryKanbanRepository()
events = EventBus()

# Commits the board state and the events produced by the same operation.
uow = SynchronousKanbanUnitOfWork(repository, events)

kanban = KanbanFacade(repository, uow)

board = kanban.create_board("alice", "Launch")
todo = board.column_named("To Do")
in_progress = board.column_named("In Progress")
assert todo is not None and in_progress is not None

card = kanban.add_card("alice", board.id, todo.id, "Publish release notes")
kanban.move_card("alice", board.id, card.id, in_progress.id)

BoardView, ColumnView and CardView are immutable observations. Change business state only through KanbanFacade.

Swap InMemoryKanbanRepository for a Postgres- or Django-backed implementation and nothing above this line changes — that boundary is the whole point of the module. See Extending Kanban Core.

Why both a repository and a unit of work?

They have different responsibilities:

  • KanbanRepository reads and stores board snapshots.
  • KanbanUnitOfWork commits one business operation, including both the new board snapshot and the events produced by that operation.

The distinction matters most in production. A database-backed unit of work can save the board and append its events to an outbox in one transaction, so you do not end up with committed state but a lost event.

A useful shorthand is:

Repository reads state. Unit of work commits an operation.

SynchronousKanbanUnitOfWork is the reference implementation for tests and simple single-process applications. It saves through the repository and then publishes through the supplied event publisher.

Demo UI

The repository includes a small FastAPI example in kanban-demo-ui. It is an application of the module, not part of the business package. The example composes KanbanFacade with the in-memory repository, synchronous unit of work and event bus, then keeps HTTP routes and browser behavior outside Kanban Core.

Kanban Core demo UI showing boards, cards, drag-and-drop columns, and live business events

Install and run it from the repository root:

python -m pip install -e .
python -m pip install -r kanban-demo-ui/requirements.txt
python kanban-demo-ui/run_demo.py

The browser uses native HTML drag-and-drop. It updates the card list optimistically, then sends the requested move through the facade; the server remains authoritative for WIP limits, workflow rules, ordering and event generation. The demo deliberately uses in-memory state and has no authentication, CSRF protection or durable outbox.

Documentation

Public contract

Only names in kanban.__all__ are supported application API:

  • KanbanFacade is the only business-operation entry point.
  • BoardView, ColumnView and CardView are immutable return values.
  • public exceptions are exported from kanban.
  • infrastructure and extension contracts live under kanban.spi.

Internal models and application services are implementation details.

Development

python -m pip install -e ".[dev]"
make check
make test

License

MIT

Metadata

Release files for kanban-core 2.3.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for kanban-core 2.3.0
File Size Uploaded
kanban_core-2.3.0.tar.gz 44.8 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for kanban-core 2.3.0
File Interpreter ABI Platform
kanban_core-2.3.0-py3-none-any.whl Python 3 none any Details

Total release size: 79.6 kB

Release files / kanban_core-2.3.0.tar.gz

Download URL kanban_core-2.3.0.tar.gz
Size 44.8 kB
Tags Source
SHA-256 checksum
How to use checksums
339ffc7fd0d4668e4bbb99599cbb80a5096caeca72ce7d0d0f36276048e4c542
BLAKE2b-256 checksum
How to use checksums
923cdcfd4f6960688f78e1a9ef0c74fea353de24f0b628864aad2d25a9a3291e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.3

Release files / kanban_core-2.3.0-py3-none-any.whl

Download URL kanban_core-2.3.0-py3-none-any.whl
Size 34.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
849c4aaaa74918ff97597a4478a9e9201e707dd84eff8c1e884161c9c80ce66c
BLAKE2b-256 checksum
How to use checksums
93dbd29fe67c279a703b0322182106d801173a872ac40a863747922561c2e6f5
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.3

Release history Release notifications | RSS feed

This release

2.3.0 This release

2 release files

2.1.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page