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.26.0.tar.gz (27.9 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.26.0-py3-none-any.whl (32.7 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for plansolve-0.26.0.tar.gz
Algorithm Hash digest
SHA256 d32606fe3c2cf8cd86fb28867fbff4739d302587ce4d5b6e72ad6f1d7b6a44f4
MD5 60d919626a8f49930b837ea7f92194cb
BLAKE2b-256 9325efd1b725680942ef17d0f710db09b38413b9e543f901ed149d099988a37a

See more details on using hashes here.

Provenance

The following attestation bundles were made for plansolve-0.26.0.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.26.0-py3-none-any.whl.

File metadata

  • Download URL: plansolve-0.26.0-py3-none-any.whl
  • Upload date:
  • Size: 32.7 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.26.0-py3-none-any.whl
Algorithm Hash digest
SHA256 36c4d0ae7a23dff5ed7931a0414ebcd6ffaa0e129731c434a588a148114e1bdf
MD5 ec460fdcaa94ac0350ed03c26e5b5d7a
BLAKE2b-256 9a2779384ba40165040a1862110272fc769ba2cd7aac5178353aa89a63baca40

See more details on using hashes here.

Provenance

The following attestation bundles were made for plansolve-0.26.0-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