Skip to main content

Flow metrics library for kanban forecasting

This project has been archived.

The maintainers of this project have marked this project as archived. No new releases are expected.

Project description

6# quando

CI Python 3.11+ License: MIT

Kanban flow metrics for Python. Answers the eternal question: "quando vai ficar pronto?"when will it be done?

quando computes Service Level Expectations (SLE) from your team's historical delivery data: given a list of work item start/end dates, it tells you at what percentile a single item will be finished.

This library was built to support the talk "Quando vai ficar pronto?", which walks through SLE and Monte Carlo forecasting for software teams using kanban.


Installation

pip install quando-forecast

Quick start

from datetime import date
from quando import Quando

items = [
    (date(2024, 1,  1), date(2024, 1,  3)),  # 3 days
    (date(2024, 1,  5), date(2024, 1,  5)),  # 1 day  (same-day delivery)
    (date(2024, 1,  8), date(2024, 1, 14)),  # 7 days
    # ... more historical items
]

w = Quando(items)

w.percentile(85)   # → int: 85% of items finish within this many days
w.percentile(50)   # → int: median lead time

sle = w.sle()      # → SLE(p50=..., p85=..., p95=...)
sle.p85            # → int: named access
p50, p85, p95 = sle  # or unpack as a tuple

Loading from a CSV

w = Quando.from_csv("delivery_data.csv")

The CSV is expected to have started_at and finished_at columns (header is optional). Both date (2024-01-15) and datetime (2024-01-15 09:00:00) formats are accepted.

started_at,finished_at
2024-01-01,2024-01-03
2024-01-05,2024-01-05
2024-01-08,2024-01-14

Custom column names are supported:

w = Quando.from_csv("export.csv", started_col="start_date", finished_col="end_date")

API

Quando(items)

Constructs a flow dataset from a sequence of (start, end) tuples.

  • start and end can be datetime.date or datetime.datetime (time component is ignored)
  • Raises ValueError if items is empty or any tuple has end < start

Quando.from_csv(path, *, started_col="started_at", finished_col="finished_at")

Constructs from a CSV file. Handles mixed date/datetime formats and drops unparseable rows.

.lead_times -> list[int]

The computed lead time in calendar days for each item (end - start + 1, so a same-day item = 1).

.percentile(p: float) -> int

Returns the p-th percentile of the lead time distribution, ceiling-rounded. p is 0–100 (e.g. 85, not 0.85).

.sle() -> SLE

Returns an SLE(p50, p85, p95) named tuple — the three standard confidence thresholds for a kanban SLE commitment. Can be unpacked or accessed by name.


What is SLE?

A Service Level Expectation is a probabilistic commitment: "X% of our work items finish within N days."

"Our SLE is 7 days @ 85% confidence"
→ 85% of items in our history finished in 7 days or fewer.

P85 is the recommended default for external commitments: it gives a 15% error rate by design, which is honest and achievable. P50 (median) is useful internally; P95 is for high-stakes items.


Related

  • quando-vai-ficar-pronto — the companion talk and Jupyter notebook that demonstrates SLE and Monte Carlo forecasting end-to-end

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

quando_forecast-0.1.0.tar.gz (20.8 kB view details)

Uploaded Source

Built Distribution

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

quando_forecast-0.1.0-py3-none-any.whl (5.2 kB view details)

Uploaded Python 3

File details

Details for the file quando_forecast-0.1.0.tar.gz.

File metadata

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

File hashes

Hashes for quando_forecast-0.1.0.tar.gz
Algorithm Hash digest
SHA256 1c407a3efc3bdc6476ab60d4bb5195d18df28a7988b5f0d763e43e5f89021992
MD5 12aa7a90be11c49daa4649d632a3fe16
BLAKE2b-256 1eacda6105c9fc85ff510ae89c68c0b14c0e61fdda0a4b3650a6ef9b356b0006

See more details on using hashes here.

Provenance

The following attestation bundles were made for quando_forecast-0.1.0.tar.gz:

Publisher: publish.yml on rodbv/quando

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

File details

Details for the file quando_forecast-0.1.0-py3-none-any.whl.

File metadata

File hashes

Hashes for quando_forecast-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 a0213db9bd6b8b1bdf4b0a06b38b981017ebc2047770d25f64cce883ae6ee2de
MD5 79908decfd069a07485583b8a5856f27
BLAKE2b-256 14a4a90c5817d296773236e6a16476fec432af8d9ccb05783e59accb7ebb9449

See more details on using hashes here.

Provenance

The following attestation bundles were made for quando_forecast-0.1.0-py3-none-any.whl:

Publisher: publish.yml on rodbv/quando

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