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.dev13.tar.gz
(29.6 kB
view details)
Built Distribution
File details
Details for the file nextmv-0.1.0.dev13.tar.gz
.
File metadata
- Download URL: nextmv-0.1.0.dev13.tar.gz
- Upload date:
- Size: 29.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.12.1
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 56c54ea462be48936034ee1b4cc9acb0afacee1ad9960bae836069238fbeb795 |
|
MD5 | f74c97008dec5d6d40abeb79793a36f6 |
|
BLAKE2b-256 | dab02d78cbba2ae90f86f08e18292479093ce8573f32b04c514cf57edac7b0b1 |
File details
Details for the file nextmv-0.1.0.dev13-py3-none-any.whl
.
File metadata
- Download URL: nextmv-0.1.0.dev13-py3-none-any.whl
- Upload date:
- Size: 27.4 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 | 14d0a6c7014ab8cf1657bcd7d7bd8871a833513eaa9818c781140e4ad028e307 |
|
MD5 | 489a10ba8f1c0f08dcaef069486b5c8d |
|
BLAKE2b-256 | 8fb5dd83ad74f8abf126cf79361eec9455b3e51edd95e40411dbfcb7b5a6b8e2 |