The Python SDK for Nextmv
Project description
Nextmv Python SDK
This is the Python SDK for the Nextmv Platform. Before starting:
- Sign up for a Nextmv account.
- Get your API key. Go to Team > API Key.
Visit the docs for more information.
Installation
Requires Python >=3.8
. 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 Nextmv Cloud.
- Make a run and get the results.
import os
from nextmv.cloud import Application, Client, PollingOptions
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"},
polling_options=PollingOptions(), # Customize the polling options.
)
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.5.1.tar.gz
(31.0 kB
view details)
Built Distribution
nextmv-0.5.1-py3-none-any.whl
(28.4 kB
view details)
File details
Details for the file nextmv-0.5.1.tar.gz
.
File metadata
- Download URL: nextmv-0.5.1.tar.gz
- Upload date:
- Size: 31.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/5.0.0 CPython/3.12.2
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 763151b5f41aa1d1a341fd279d7d129e2d74355510e445989a95f7041561b18c |
|
MD5 | ef1fc6e541fc33db3e4b793da2d79ca4 |
|
BLAKE2b-256 | 7e9d54db53e59ff92a256202f1b6e3677180fde533356e5a98a9fc6e635c2654 |
File details
Details for the file nextmv-0.5.1-py3-none-any.whl
.
File metadata
- Download URL: nextmv-0.5.1-py3-none-any.whl
- Upload date:
- Size: 28.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/5.0.0 CPython/3.12.2
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 7ac128ea6fedb4722459143657737bd11d057af15e9b4b66e161f791056608d7 |
|
MD5 | e1626282785bcd065c4e86efcdb635d8 |
|
BLAKE2b-256 | 41f7e2f39af9986764f6e5d5c8fd76a2129ace3ce1fabadf512edcfbe4866139 |