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
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.dev2.tar.gz
(19.2 kB
view details)
Built Distribution
File details
Details for the file nextmv-0.1.0.dev2.tar.gz
.
File metadata
- Download URL: nextmv-0.1.0.dev2.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
Algorithm | Hash digest | |
---|---|---|
SHA256 | e0963ee41aeeed17a429d336eb7e7b0a7bb0adc7115da0f8b85dc44f950b8ac6 |
|
MD5 | 423c93f6e5bc4fc8a3bce732796253c9 |
|
BLAKE2b-256 | 733392988fc1e7e6d677df4c69df4b9a543a55adc1fc2a17ffdfb289a6c40fe2 |
File details
Details for the file nextmv-0.1.0.dev2-py3-none-any.whl
.
File metadata
- Download URL: nextmv-0.1.0.dev2-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
Algorithm | Hash digest | |
---|---|---|
SHA256 | ed0befbe7966a730b558be9995b95e55771e4605b0b8180e4ac666926f95ef74 |
|
MD5 | dbb8cd298e63804eb7d13c2a4b3f2d4c |
|
BLAKE2b-256 | 38fdaf7764e541e5c1c981a83e5596d0f5de18d0dbe546214e9f8d85f7c396c6 |