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 pushed to 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.dev1.tar.gz
(19.4 kB
view details)
Built Distribution
File details
Details for the file nextmv-0.1.0.dev1.tar.gz
.
File metadata
- Download URL: nextmv-0.1.0.dev1.tar.gz
- Upload date:
- Size: 19.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.12.1
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 834858f85b74ac38ad1eb5269f4836a7b7eb7005c1548128d0c65de21f389be5 |
|
MD5 | edba7bde4078329697fb7bfef8b0e31b |
|
BLAKE2b-256 | bc0bb0468c4b050a2607d99182a5bbc71306b3544da6a9f3c2023582a5507e98 |
File details
Details for the file nextmv-0.1.0.dev1-py3-none-any.whl
.
File metadata
- Download URL: nextmv-0.1.0.dev1-py3-none-any.whl
- Upload date:
- Size: 23.3 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 | 76b0b7d9a35952b3cfd17f072bf73b2c9d2a135d7a49201aa6608d37762546f7 |
|
MD5 | 5f1555b3d3f4b625023718b93b61a6f4 |
|
BLAKE2b-256 | 6a48380756ce451c1c9937f331cbb0af2d3dd824738af600497fc55299178bf1 |