Skip to main content

ccpm-scheduler

Deterministic Critical Chain Project Management (CCPM) scheduling as a Python library and CLI — built for humans, AI agents, and integration with project management tools.

PyPI Version Python Versions License

Give ccpm-scheduler a project network (tasks, dependencies, duration estimates, resource assignments) plus resource availability, and it produces a proper Critical Chain schedule:

  • Resource-Leveled: Resolves resource contention so no resource is over-allocated.
  • As-Late-As-Possible (ALAP) Scheduling: Eliminates Parkinson's Law by scheduling non-critical work to finish just when needed.
  • Protected by Buffers: Insulates project completion with a Project Buffer and protects merge points with Feeding Buffers.
  • Buffer-Aware Visualizations: Generates rich Gantt charts (.png) and interactive standalone web dependency graphs (.html).
  • Fully Deterministic: The same input always produces byte-identical schedule outputs — ideal for automation, scripting, and CI/CD pipelines.

Quickstart

Installation

Install via pip or run instantly with uv:

# Install via pip
pip install ccpm-scheduler

# Or run directly without installation via uv
uvx ccpm-scheduler --help

Status & Roadmap

All primary development phases outlined in PLAN.md (Phases 1 through 6) are fully complete, including:

  • Behaviour-preserving core engine and typed data model.
  • Agent-friendly CLI with machine-readable --json contracts.
  • Integration with AI agents (Claude skills) and GUI planners (our-planner).
  • Selectable buffer-sizing methods (cap Cut & Paste, hchain 50% chain, rsem root-squared error).

Future Direction: Fractional Resource Assignments

Currently, ccpm-scheduler enforces whole-resource allocations (1.0 capacity per task). Fractional resource assignments (e.g. allocating 0.5 FTE of a resource to a task) are identified as the primary area for future improvement. Future decisions on fractional leveling algorithms will be guided by feedback from real-world usage and community input.


CLI Usage

Built for humans and AI agents: exit codes form a strict contract (0 = ok, 1 = validation or schedule issue with structured report, 2 = usage error), --json prints machine-readable JSON documents, and outputs are strictly deterministic.

# 1. Validate a project network
ccpm-scheduler validate tasks.csv resources.csv calendar.csv

# 2. Build a resource-leveled, buffered schedule
ccpm-scheduler build tasks.csv resources.csv --calendar calendar.csv \
    --out-dir plan --title "Website relaunch" --buffer-method cap

# 3. Verify schedule integrity against project constraints
ccpm-scheduler check plan/schedule.csv tasks.csv resources.csv calendar.csv

# 4. Plot a buffer-aware Gantt chart with resource utilization
ccpm-scheduler plot plan/schedule.csv plan/gantt.png --resources resources.csv

# 5. Generate an interactive web graph visualization
ccpm-scheduler graph plan/schedule.csv plan/project-network.html \
    --tasks tasks.csv --title "Website relaunch"

# 6. Inspect machine-readable JSON Schemas
ccpm-scheduler schema network

JSON Input & Pipe Support

Networks can be passed as CSV files or as a single JSON document (via file path or - for stdin):

echo '{"tasks": [...], "resources": [...]}' | ccpm-scheduler build - --json

Library API

Import ccpm-scheduler directly into Python applications:

from ccpm_scheduler import (
    load_network,
    validate_network,
    build_schedule,
    check_schedule,
    plot_schedule,
)

# Load network from CSV or JSON
network = load_network("tasks.csv", "resources.csv", "calendar.csv")

# Validate network rules (cycle detection, resource assignment, duration checks)
report = validate_network(network)
if report.ok:
    # Build schedule using Cut & Paste (cap) buffer sizing
    result = build_schedule(network, title="My Project", buffer_method="cap")
    
    # Verify schedule rules
    assert check_schedule(result.schedule, network).ok
    
    # Plot Gantt chart
    plot_schedule(
        result.schedule,
        "gantt.png",
        resources=network.resources,
        calendar=network.calendar,
    )
    print(result.stats.status_line("My Project"))

File Contracts

Input Format

  • tasks.csv: id, name, realistic_duration, optimal_duration (optional), predecessor_ids, resource_ids, url (optional)
    • realistic_duration: Estimate including safety margin.
    • optimal_duration: Padding-free duration. If omitted, the classic 50% safety cut is applied automatically.
    • predecessor_ids: Semicolon-separated links (A, A:SS+2, A:FF, A:SF).
    • resource_ids: Semicolon-separated resource IDs assigned to the task.
  • resources.csv: id, name, capacity, url (optional), emails (optional) (capacity defaults to 1; emails holds one or more contact addresses separated by , or ;, for use during project execution).
  • calendar.csv (optional): resource_id, from, to, capacity: Overrides resource capacity on half-open day intervals [from, to).

Output Format

  • schedule.csv: Scheduled tasks and buffers with start/finish dates, chain designations (critical, feeding-n), and link attachments (:PB, :FB).
  • summary.md: Project summary documenting critical chain duration, project buffer size, feeding buffers, promised completion date, and buffer calculation method (cap, hchain, rsem).
  • gantt.png: High-resolution Gantt chart showing critical chain, feeding chains, buffers, dependencies, and daily resource utilization.
  • project-network.html: Standalone interactive HTML graph (Vis-network) allowing zooming, panning, node dragging, and resource filtering.

Development & Testing

We welcome contributions! The repository uses uv for fast dependency management and prek for git pre-commit checks.

Development Setup

# Clone the repository
git clone https://github.com/rnwolf/ccpm-scheduler.git
cd ccpm-scheduler

# Install development dependencies in virtualenv
uv sync

# Run the test suite with coverage report
uv run pytest

# Run pre-commit checks (ruff check & ruff format)
prek run --all-files

Dev Dependencies & Tooling

  • Test Runner & Coverage: pytest, pytest-cov (unit, integration, and CLI contract testing with coverage reports).
  • Property-Based Testing: hypothesis (generates random DAG project networks to test scheduling invariants).
  • Linter & Formatter: ruff (fast linting and code formatting).
  • Pre-commit Hooks: prek (verifies ruff rules before git commits).

Feedback, Suggestions & Issues

If you encounter tool errors, engine bugs, or have suggestions for improvements (such as real-world use cases for fractional resource assignments), please open an issue on GitHub:

👉 Submit a GitHub Issue

When reporting bugs, please attach your project input (tasks.csv, resources.csv, or anonymized JSON) and the error report emitted by --json to help us diagnose and resolve the issue quickly.


License

Dual-licensed under either of MIT or Apache License 2.0, at your option.

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

ccpm_scheduler-0.13.0.tar.gz (342.6 kB view details)

Uploaded Source

Built Distribution

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

ccpm_scheduler-0.13.0-py3-none-any.whl (58.8 kB view details)

Uploaded Python 3

File details

Details for the file ccpm_scheduler-0.13.0.tar.gz.

File metadata

  • Download URL: ccpm_scheduler-0.13.0.tar.gz
  • Upload date:
  • Size: 342.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.12.3 {"installer":{"name":"uv","version":"0.12.3","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for ccpm_scheduler-0.13.0.tar.gz
Algorithm Hash digest
SHA256 b1cd20b64c4dbd2edd1a6cc62a6a00b28ef54efae701db448291574184210b46
MD5 d26bedc283d8fd8db7fc4c92a320ee7e
BLAKE2b-256 44ed0248d05734e2fd3f156714683fe730b9a3de0357c2d221f2baed25093faf

See more details on using hashes here.

File details

Details for the file ccpm_scheduler-0.13.0-py3-none-any.whl.

File metadata

  • Download URL: ccpm_scheduler-0.13.0-py3-none-any.whl
  • Upload date:
  • Size: 58.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.12.3 {"installer":{"name":"uv","version":"0.12.3","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for ccpm_scheduler-0.13.0-py3-none-any.whl
Algorithm Hash digest
SHA256 8d28f125d6cac9a023fa15637fa15397b596fe1d63a1dd0879e5bf1bc6918ff1
MD5 d6dd674f76d31ea95943d5a5982b0e12
BLAKE2b-256 6da1ef4edf0de107aaa93b55fa35b295d02e1f22a6def007687f9298eab0b282

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