Skip to main content

The Python SDK for Nextmv

Project description

Nextmv Python SDK

This is the Python SDK for the Nextmv Platform. Before starting:

  1. Sign up for a Nextmv account.
  2. Get your API key. Go to Team > API Key.

Visit the docs for more information.

Installation

Install using pip:

pip install nextmv

Usage

Make sure that you have your API key set as an environment variable:

export NEXTMV_API_KEY=<your-API-key>

Additionally, you must have a valid app in the Nextmv Cloud.

  • Make a run and get the results.
import os

from nextmv.cloud import Application, Client

input = {
    "defaults": {"vehicles": {"speed": 20}},
    "stops": [
        {
            "id": "Nijō Castle",
            "location": {"lon": 135.748134, "lat": 35.014239},
            "quantity": -1,
        },
        {
            "id": "Kyoto Imperial Palace",
            "location": {"lon": 135.762057, "lat": 35.025431},
            "quantity": -1,
        },
    ],
    "vehicles": [
        {
            "id": "v2",
            "capacity": 2,
            "start_location": {"lon": 135.728898, "lat": 35.039705},
        },
    ],
}

client = Client(api_key=os.getenv("NEXTMV_API_KEY"))
app = Application(client=client, id="your-app-id")
result = app.new_run_with_result(
    input=input,
    instance_id="latest",
    run_options={"solve.duration": "1s"},
)
print(result.to_dict())

Project details


Release history Release notifications | RSS feed

Download files

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

Source Distribution

nextmv-0.1.0.dev3.tar.gz (19.2 kB view details)

Uploaded Source

Built Distribution

nextmv-0.1.0.dev3-py3-none-any.whl (23.1 kB view details)

Uploaded Python 3

File details

Details for the file nextmv-0.1.0.dev3.tar.gz.

File metadata

  • Download URL: nextmv-0.1.0.dev3.tar.gz
  • Upload date:
  • Size: 19.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.12.1

File hashes

Hashes for nextmv-0.1.0.dev3.tar.gz
Algorithm Hash digest
SHA256 3ee7d7dddcd54b4f619ead18611006ae6d09b3cac0bfcbb92ca3272a22b22c8f
MD5 0fb1a6b91d9b7680a6d81118a3a1ce11
BLAKE2b-256 6c75826896929dd407b64ae66ee9be421f49d7e88f79e3f02b8e8bb4a8b4da80

See more details on using hashes here.

File details

Details for the file nextmv-0.1.0.dev3-py3-none-any.whl.

File metadata

  • Download URL: nextmv-0.1.0.dev3-py3-none-any.whl
  • Upload date:
  • Size: 23.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.12.1

File hashes

Hashes for nextmv-0.1.0.dev3-py3-none-any.whl
Algorithm Hash digest
SHA256 6b472aab22ea411770d380c1ffe5683f32c755795666ba54ab15062fec984187
MD5 ccc6878998e0f247248f75b88e6b9af4
BLAKE2b-256 75d925ac65007f9a29520081647830c584513166e1f3fce65ca3df41f2258560

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page