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:
- Field Service — https://getplansolve.com/docs/fieldservice/sdk/python
- Professional Services — https://getplansolve.com/docs/professionalservices/sdk/python
- Shift — https://getplansolve.com/docs/shiftsolver/sdk/python
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
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
60c2264f5d21d8b686bbb076c9f46e3ff542bc794f35e9ad3218a7a4fef1fac8
|
|
| MD5 |
a6a40cf10b035af26e124e1f97b2c349
|
|
| BLAKE2b-256 |
e05aec8719cdd94c3741de3fc5a4e459c20611f1e12c99ef57b05f4a3c1d6f9d
|
Provenance
The following attestation bundles were made for plansolve-0.25.8.tar.gz:
Publisher:
python-publish.yml on plansolve/sdk
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
plansolve-0.25.8.tar.gz -
Subject digest:
60c2264f5d21d8b686bbb076c9f46e3ff542bc794f35e9ad3218a7a4fef1fac8 - Sigstore transparency entry: 2216559851
- Sigstore integration time:
-
Permalink:
plansolve/sdk@92418da1e0531c656395aff46102266fb9ca650d -
Branch / Tag:
refs/tags/python/v0.25.8 - Owner: https://github.com/plansolve
-
Access:
private
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
python-publish.yml@92418da1e0531c656395aff46102266fb9ca650d -
Trigger Event:
push
-
Statement type:
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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
74fe48b813c5779bc486f7dc8cf4babab3b409976cb0f5686084c80114b9409b
|
|
| MD5 |
e78d8d0c5efbacb2d5b1c15a999ddd45
|
|
| BLAKE2b-256 |
1e126aa3758a3400e7bb2b8c0669f1d052e66b1c20cd8a904ed1d43dabcc6a7e
|
Provenance
The following attestation bundles were made for plansolve-0.25.8-py3-none-any.whl:
Publisher:
python-publish.yml on plansolve/sdk
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
plansolve-0.25.8-py3-none-any.whl -
Subject digest:
74fe48b813c5779bc486f7dc8cf4babab3b409976cb0f5686084c80114b9409b - Sigstore transparency entry: 2216559865
- Sigstore integration time:
-
Permalink:
plansolve/sdk@92418da1e0531c656395aff46102266fb9ca650d -
Branch / Tag:
refs/tags/python/v0.25.8 - Owner: https://github.com/plansolve
-
Access:
private
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
python-publish.yml@92418da1e0531c656395aff46102266fb9ca650d -
Trigger Event:
push
-
Statement type: