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.

Download files

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

Source Distribution

plansolve-0.25.8.tar.gz (25.2 kB view details)

Uploaded Source

Built Distribution

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

plansolve-0.25.8-py3-none-any.whl (32.0 kB view details)

Uploaded Python 3

File details

Details for the file plansolve-0.25.8.tar.gz.

File metadata

  • Download URL: plansolve-0.25.8.tar.gz
  • Upload date:
  • Size: 25.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.14

File hashes

Hashes for plansolve-0.25.8.tar.gz
Algorithm Hash digest
SHA256 60c2264f5d21d8b686bbb076c9f46e3ff542bc794f35e9ad3218a7a4fef1fac8
MD5 a6a40cf10b035af26e124e1f97b2c349
BLAKE2b-256 e05aec8719cdd94c3741de3fc5a4e459c20611f1e12c99ef57b05f4a3c1d6f9d

See more details on using hashes here.

Provenance

The following attestation bundles were made for plansolve-0.25.8.tar.gz:

Publisher: python-publish.yml on plansolve/sdk

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

File details

Details for the file plansolve-0.25.8-py3-none-any.whl.

File metadata

  • Download URL: plansolve-0.25.8-py3-none-any.whl
  • Upload date:
  • Size: 32.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.14

File hashes

Hashes for plansolve-0.25.8-py3-none-any.whl
Algorithm Hash digest
SHA256 74fe48b813c5779bc486f7dc8cf4babab3b409976cb0f5686084c80114b9409b
MD5 e78d8d0c5efbacb2d5b1c15a999ddd45
BLAKE2b-256 1e126aa3758a3400e7bb2b8c0669f1d052e66b1c20cd8a904ed1d43dabcc6a7e

See more details on using hashes here.

Provenance

The following attestation bundles were made for plansolve-0.25.8-py3-none-any.whl:

Publisher: python-publish.yml on plansolve/sdk

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