Skip to main content
The official Solvice VRP Solver Python SDK is now available on PyPI! Install it today to streamline your route optimization integrations.

Installation

Install the SDK using your preferred Python package manager:
The --pre flag is currently required as the package is in pre-release status.

Quick Start

Get up and running with the VRP Solver in minutes:

Key Features

Type Safety

Full type definitions for all request parameters and response fields

Async Support

Native async/await support with both httpx and optional aiohttp backends

Pythonic Interface

Follows Python conventions with snake_case methods and proper error handling

Auto Retry

Built-in retry logic with configurable attempts for resilient integrations

Configuration

Configure the SDK client with these options:
Never hardcode your API key. Always use environment variables or secure key management systems.

Advanced Usage

Asynchronous Client

For better performance with multiple requests, use the async client:

Error Handling

The SDK provides comprehensive error handling:

Using with Real Road Distances

Enable real-world routing distances instead of straight-line calculations:

Python Version Support

The SDK supports multiple Python versions:
Minimum supported version:

Complete Example

Here’s a comprehensive example showcasing various SDK features:

API Methods

The SDK provides access to all VRP Solver endpoints:

Core Methods

  • sync_solve() - Synchronous solving for smaller problems
  • solve() - Asynchronous solving for larger problems
  • jobs.status() - Check job status
  • jobs.solution() - Retrieve solution

Advanced Methods

  • evaluate() - Evaluate an existing solution
  • suggest() - Get improvement suggestions
  • jobs.explanation() - Get detailed explanations
  • demo() - Get a demo request for testing
For problems with more than 100 jobs or complex constraints, use the asynchronous solve() method to avoid timeouts.

Integration with Data Science Libraries

The Python SDK works seamlessly with popular data science libraries:

Resources

PyPI Package

View on Python Package Index

GitHub Repository

View source code and contribute

API Reference

Complete API documentation

Support

Get help from our team