Skip to main content

PlanSolve for Python

Official Python client for the PlanSolve optimization API. One typed client covers three solvers — field service routing, professional-services task assignment, and shift scheduling — with built-in polling and clean error messages.

Installation

pip install plansolve

Requires Python 3.8+. Type hints are bundled.

Quick start

from plansolve import PlanSolveClient

client = PlanSolveClient(api_key="YOUR_API_KEY")

request = {
    "vehicles": [
        {
            "id": "tech1",
            "location": [40.7128, -74.0060],
            "skills": ["repair"],
            "shifts": [
                {"id": "morning", "minStartTime": "2026-04-02T08:00:00", "maxEndTime": "2026-04-02T17:00:00"}
            ],
        }
    ],
    "visits": [
        {
            "id": "visit1",
            "name": "AC Repair - Downtown Office",
            "location": [40.7589, -73.9851],
            "serviceDuration": "PT60M",
            "priority": "HIGH",
            "requiredSkills": ["repair"],
            "timeWindows": [
                {"minStartTime": "2026-04-02T09:00:00", "maxEndTime": "2026-04-02T17:00:00"}
            ],
        }
    ],
}

# Submit and block until the optimized plan is ready
result = client.field_service.start_and_wait_for_completion(request)

for vehicle in result.vehicles:
    print(f"Vehicle {vehicle.id}: {len(vehicle.visits)} visits")

Requests accept a plain dict (as above) or the typed dataclasses (FieldServiceRequest, Vehicle, Visit, ...).

Solvers

One client, three solvers — all share the same submit → poll → result workflow:

Solver Accessor Use for
Field Service client.field_service Vehicle routing with travel time, time windows, and skills
Professional Services client.professional_services Task assignment by skill, availability, priority, and deadlines
Shift client.shift Shift scheduling across contracts, availability, and fairness

Each accessor exposes start, get_status, get_result, analyze, wait_for_completion, and start_and_wait_for_completion.

Configuration

Pass your API key to the constructor: PlanSolveClient(api_key="..."). It is sent as the X-API-KEY header on every request.

Error handling

API errors raise requests.HTTPError with a readable message (e.g. HTTP 400: vehicles: At least one vehicle is required.):

try:
    result = client.field_service.start_and_wait_for_completion(request)
except Exception as e:
    print(e)

Documentation

Full guides, per-solver data models, and parameter reference live on the docs site:

Package: PyPI

License

Apache-2.0 — see LICENSE.

Metadata

Release files for plansolve 0.28.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 plansolve 0.28.0
File Size Uploaded
plansolve-0.28.0.tar.gz 40.0 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for plansolve 0.28.0
File Interpreter ABI Platform
plansolve-0.28.0-py3-none-any.whl Python 3 none any Details

Total release size: 82.5 kB

Release files / plansolve-0.28.0.tar.gz

Download URL plansolve-0.28.0.tar.gz
Size 40.0 kB
Tags Source
SHA-256 checksum
How to use checksums
432d0a86d271214f00af6d1b3382f170737db56a30b43b4ed2b5b9afafefbae6
BLAKE2b-256 checksum
How to use checksums
838471ddc1f40c366a08da8f20fb5312be3dc73fb0ea500971244ade1db5c021
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Sep 22, 2026.

Transparency log

Release files / plansolve-0.28.0-py3-none-any.whl

Download URL plansolve-0.28.0-py3-none-any.whl
Size 42.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
60aa9c97a68f76296bb74e23ca56d6d61bdb73fb6aa83381c946de00a09a8e81
BLAKE2b-256 checksum
How to use checksums
469e33b6806e2c7d48bc55d5aff3e3e43583b08f55a2a747119845f4a43b655b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Sep 22, 2026.

Transparency log

Release history Release notifications | RSS feed

0.37.0

2 release files

0.36.0

2 release files

0.35.0

2 release files

0.34.0

2 release files

0.29.0

2 release files

This release

0.28.0 This release

2 release files

0.27.0

2 release files

0.26.0

2 release files

0.25.8

2 release files

0.25.7

2 release files

0.25.6

2 release files

0.25.5

2 release files

0.25.4

2 release files

0.25.3

2 release files

0.25.2

2 release files

0.25.1

2 release files

0.25.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